diff options
author | Simon Bünzli <zeniko@gmail.com> | 2013-11-11 22:42:06 +0100 |
---|---|---|
committer | Simon Bünzli <zeniko@gmail.com> | 2013-11-27 21:03:05 +0100 |
commit | 4ab737fa41a1c925319921f663e017c2c1a17e54 (patch) | |
tree | 302cee8407cf884bde65283fd8766afe73f65b62 | |
parent | 827a710ffda3a28a302f22233e45e18697bbfa26 (diff) | |
download | mupdf-4ab737fa41a1c925319921f663e017c2c1a17e54.tar.xz |
track font path in fz_font
ft_file was removed in a2c945506ea2a2b58edbde84124094c6b4f69eac even
though it might still be needed by downstream consumers (such as
SumatraPDF) for allowing devices to load fonts again when a font has
been loaded by fz_new_font_from_file which doesn't maintain a buffer.
-rw-r--r-- | include/mupdf/fitz/font.h | 2 | ||||
-rw-r--r-- | source/fitz/font.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h index 8cd6921e..ffba996c 100644 --- a/include/mupdf/fitz/font.h +++ b/include/mupdf/fitz/font.h @@ -37,7 +37,7 @@ struct fz_font_s /* origin of font data */ fz_buffer *ft_buffer; - int ft_size; + char *ft_filepath; /* kept for downstream consumers (such as SumatraPDF) */ fz_matrix t3matrix; void *t3resources; diff --git a/source/fitz/font.c b/source/fitz/font.c index 2e2cd53b..83fedc6a 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -33,7 +33,7 @@ fz_new_font(fz_context *ctx, const char *name, int use_glyph_bbox, int glyph_cou font->ft_hint = 0; font->ft_buffer = NULL; - font->ft_size = 0; + font->ft_filepath = NULL; font->t3matrix = fz_identity; font->t3resources = NULL; @@ -152,6 +152,7 @@ fz_drop_font(fz_context *ctx, fz_font *font) } fz_drop_buffer(ctx, font->ft_buffer); + fz_free(ctx, font->ft_filepath); fz_free(ctx, font->bbox_table); fz_free(ctx, font->width_table); fz_free(ctx, font); @@ -342,6 +343,7 @@ fz_new_font_from_file(fz_context *ctx, const char *name, const char *path, int i (float) face->bbox.yMin / face->units_per_EM, (float) face->bbox.xMax / face->units_per_EM, (float) face->bbox.yMax / face->units_per_EM); + font->ft_filepath = fz_strdup(ctx, path); return font; } |