* docs/CHANGES: Document SHZ fix. * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom points.
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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
diff --git a/ChangeLog b/ChangeLog
index b2da9cd..43f368f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2007-01-21 Werner Lemberg <wl@gnu.org>
+ * docs/CHANGES: Document SHZ fix.
+
+2007-01-21 George Williams <gww@silcom.com>
+
+ * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom
+ points.
+
+2007-01-21 Werner Lemberg <wl@gnu.org>
+
* src/sfnt/ttmtx.c (tt_face_get_metrics)
[!FT_CONFIG_OPTION_OLD_INTERNALS]: Fix limit check.
diff --git a/docs/CHANGES b/docs/CHANGES
index 0fe209f..f5be848 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -1,3 +1,13 @@
+CHANGES BETWEEN 2.3.0 and 2.3.1
+
+ I. IMPORTANT BUG FIXES
+
+ - The TrueType interpreter sometimes returned incorrect horizontal
+ metrics due to a bug in the handling of the SHZ instruction.
+
+
+======================================================================
+
CHANGES BETWEEN 2.3.0 and 2.2.1
I. IMPORTANT BUG FIXES
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 640001b..f6bcec1 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -2769,12 +2769,12 @@
CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
- /* XXX: UNDOCUMENTED! or bug in the Windows engine? */
- /* */
- /* It seems that the value that is read here is */
- /* expressed in 16.16 format rather than in font */
- /* units. */
- /* */
+ /* XXX: UNDOCUMENTED! or bug in the Windows engine? */
+ /* */
+ /* It seems that the value that is read here is */
+ /* expressed in 16.16 format rather than in font */
+ /* units. */
+ /* */
#define DO_SSW \
CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 );
@@ -5430,7 +5430,7 @@
last_point = 0;
}
- /* XXX: UNDOCUMENTED! SHC does touch the points */
+ /* XXX: UNDOCUMENTED! SHC touches the points */
for ( i = first_point; i <= last_point; i++ )
{
if ( zp.cur != CUR.zp2.cur || refp != i )
@@ -5466,8 +5466,14 @@
if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
return;
- if ( CUR.zp2.n_points > 0 )
- last_point = (FT_UShort)(CUR.zp2.n_points - 1);
+ /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points. */
+ /* Twilight zone has no contours, so use `n_points'. */
+ /* Normal zone's `n_points' includes phantoms, so must */
+ /* use end of last contour. */
+ if ( CUR.GS.gep2 == 0 && CUR.zp2.n_points > 0 )
+ last_point = (FT_UShort)( CUR.zp2.n_points - 1 );
+ else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )
+ last_point = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] );
else
last_point = 0;