From 5e225b7c15e6c6ff8b4b7059597319b26271bc67 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 6 Nov 2013 08:41:59 +0100 Subject: [PATCH] [truetype] Fix handling of phantom points in composite glyphs. Problem reported by Nigel Tao . This is a follow-up commit to the previous one. * src/truetype/ttgload.c (load_truetype_glyph): Call `tt_get_metrics' after loading the glyph header. --- ChangeLog | 10 ++++++++++ src/truetype/ttgload.c | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 115333dbb..8b9d276ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-11-06 Werner Lemberg + + [truetype] Fix handling of phantom points in composite glyphs. + Problem reported by Nigel Tao . + + This is a follow-up commit to the previous one. + + * src/truetype/ttgload.c (load_truetype_glyph): Call + `tt_get_metrics' after loading the glyph header. + 2013-11-06 Werner Lemberg [truetype] Improve emulation of vertical metrics. diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 0c3c7bdaf..54975624f 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -1387,8 +1387,6 @@ y_scale = 0x10000L; } - tt_get_metrics( loader, glyph_index ); - /* Set `offset' to the start of the glyph relative to the start of */ /* the `glyf' table, and `byte_len' to the length of the glyph in */ /* bytes. */ @@ -1448,7 +1446,15 @@ /* read glyph header first */ error = face->read_glyph_header( loader ); - if ( error || header_only ) + if ( error ) + goto Exit; + + /* the metrics must be computed after loading the glyph header */ + /* since we need the glyph's `yMax' value in case the vertical */ + /* metrics must be emulated */ + tt_get_metrics( loader, glyph_index ); + + if ( header_only ) goto Exit; } @@ -1459,6 +1465,8 @@ loader->bbox.yMin = 0; loader->bbox.yMax = 0; + tt_get_metrics( loader, glyph_index ); + if ( header_only ) goto Exit;