diff options
-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; } |