diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-04-04 18:34:38 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-04-04 18:46:08 +0200 |
commit | 976a5231b2d6a8ab3417e27f79482b06202eb2a0 (patch) | |
tree | b345b43819a1064d9843e01debb9268f2d2cd89b /source | |
parent | a1c34c0224d32ed4f9f2909863e8ac907c94524d (diff) | |
download | mupdf-976a5231b2d6a8ab3417e27f79482b06202eb2a0.tar.xz |
Always set glyph_count!
We were setting it to zero if not building a bbox table, which caused havoc
with the advance width caching.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index 392e5a71..b0adae71 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -55,10 +55,11 @@ fz_new_font(fz_context *ctx, const char *name, int use_glyph_bbox, int glyph_cou font->bbox.x1 = 1; font->bbox.y1 = 1; + font->glyph_count = glyph_count; + font->use_glyph_bbox = use_glyph_bbox; if (use_glyph_bbox && glyph_count <= MAX_BBOX_TABLE_SIZE) { - font->glyph_count = glyph_count; font->bbox_table = fz_malloc_array(ctx, glyph_count, sizeof(fz_rect)); for (i = 0; i < glyph_count; i++) font->bbox_table[i] = fz_infinite_rect; @@ -67,7 +68,6 @@ fz_new_font(fz_context *ctx, const char *name, int use_glyph_bbox, int glyph_cou { if (use_glyph_bbox) fz_warn(ctx, "not building glyph bbox table for font '%s' with %d glyphs", font->name, glyph_count); - font->glyph_count = 0; font->bbox_table = NULL; } |