From 976a5231b2d6a8ab3417e27f79482b06202eb2a0 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 4 Apr 2016 18:34:38 +0200 Subject: Always set glyph_count! We were setting it to zero if not building a bbox table, which caused havoc with the advance width caching. --- source/fitz/font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') 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; } -- cgit v1.2.3