[truetype] Fix handling of phantom points in composite glyphs. Problem reported by Nigel Tao <nigeltao@golang.org>. 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
diff --git a/ChangeLog b/ChangeLog
index 115333d..8b9d276 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2013-11-06 Werner Lemberg <wl@gnu.org>
+ [truetype] Fix handling of phantom points in composite glyphs.
+ Problem reported by Nigel Tao <nigeltao@golang.org>.
+
+ 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 <wl@gnu.org>
+
[truetype] Improve emulation of vertical metrics.
This commit also improves the start values of vertical phantom
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 0c3c7bd..5497562 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;