diff --git a/ChangeLog b/ChangeLog index b2da9cd16..43f368f4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-01-21 Werner Lemberg + + * docs/CHANGES: Document SHZ fix. + +2007-01-21 George Williams + + * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom + points. + 2007-01-21 Werner Lemberg * src/sfnt/ttmtx.c (tt_face_get_metrics) diff --git a/docs/CHANGES b/docs/CHANGES index 0fe209fef..f5be8481e 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 640001b69..f6bcec1ee 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;