[truetype] Fix positioning of composite glyphs. Problem reported by Nigel Tao <nigeltao@golang.org>. * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts the glyph (component) by a fractional value computed from the LSB phantom point. This is wrong, since the horizontal phantom points get rounded horizontally later on.
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
diff --git a/ChangeLog b/ChangeLog
index b67e436..d06ec93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-12-10 Werner Lemberg <wl@gnu.org>
+
+ [truetype] Fix positioning of composite glyphs.
+ Problem reported by Nigel Tao <nigeltao@golang.org>.
+
+ * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts
+ the glyph (component) by a fractional value computed from the LSB
+ phantom point. This is wrong, since the horizontal phantom points
+ get rounded horizontally later on.
+
2013-12-08 Werner Lemberg <wl@gnu.org>
* Version 2.5.2 released.
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 0d74248..f4081a0 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -738,7 +738,6 @@
#endif
TT_GlyphZone zone = &loader->zone;
- FT_Pos origin;
#ifdef TT_USE_BYTECODE_INTERPRETER
FT_UInt n_ins;
@@ -755,14 +754,7 @@
loader->glyph->control_len ));
}
n_ins = (FT_UInt)( loader->glyph->control_len );
-#endif
-
- origin = zone->cur[zone->n_points - 4].x;
- origin = FT_PIX_ROUND( origin ) - origin;
- if ( origin )
- translate_array( zone->n_points, zone->cur, origin, 0 );
-#ifdef TT_USE_BYTECODE_INTERPRETER
/* save original point position in org */
if ( n_ins > 0 )
FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );
@@ -1286,8 +1278,8 @@
* pp1 = (round(xmin - lsb), 0) ,
* pp2 = (round(pp1 + aw), 0) .
*
- * Note that the rounding to the grid is not documented currently in the
- * specification.
+ * Note that the rounding to the grid (in the device space) is not
+ * documented currently in the specification.
*
* However, the specification lacks the precise definition of vertical
* phantom points. Greg Hitchcock provided the following explanation.