summaryrefslogtreecommitdiff
path: root/source/html/html-font.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2016-09-28 16:46:10 +0100
committerRobin Watts <robin.watts@artifex.com>2016-10-05 19:37:11 +0100
commit9e88b088ea2ddcb6f85584750eb3c989af101905 (patch)
tree19db41ec596cc347fd1b77389821135f8e934e84 /source/html/html-font.c
parent14109acf198d9371a4e2cb09ea4a125af67d441d (diff)
downloadmupdf-9e88b088ea2ddcb6f85584750eb3c989af101905.tar.xz
Move fz_font definition to be private.
Move the definition of fz_font to be in a private header file rather than in the public API. Add accessors for specific parts of the structure and use them as appropriate. The font flags, and the harfbuzz records remain public. This means that only 3 files now need access to the font implementation (font.c, pdf-font.c and pdf-type3.c). This may be able to be improved further in future.
Diffstat (limited to 'source/html/html-font.c')
-rw-r--r--source/html/html-font.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/html/html-font.c b/source/html/html-font.c
index 3b8f7c72..01ec10f5 100644
--- a/source/html/html-font.c
+++ b/source/html/html-font.c
@@ -19,7 +19,7 @@ fz_load_html_default_font(fz_context *ctx, fz_html_font_set *set, const char *fa
if (!data)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load html font: %s", real_family);
set->fonts[idx] = fz_new_font_from_memory(ctx, NULL, data, size, 0, 1);
- set->fonts[idx]->is_serif = !is_sans;
+ fz_font_flags(set->fonts[idx])->is_serif = !is_sans;
}
return set->fonts[idx];
}
@@ -60,10 +60,11 @@ fz_load_html_font(fz_context *ctx, fz_html_font_set *set, const char *family, in
if (data)
{
fz_font *font = fz_new_font_from_memory(ctx, NULL, data, size, 0, 0);
- if (is_bold && !font->is_bold)
- font->fake_bold = 1;
- if (is_italic && !font->is_italic)
- font->fake_italic = 1;
+ fz_font_flags_t *flags = fz_font_flags(font);
+ if (is_bold && !flags->is_bold)
+ flags->fake_bold = 1;
+ if (is_italic && !flags->is_italic)
+ flags->fake_italic = 1;
fz_add_html_font_face(ctx, set, family, is_bold, is_italic, "<builtin>", font);
fz_drop_font(ctx, font);
return font;