I believe there is a bug in the SHZ instruction.
I believe SHZ should not move the phantom points in the zone.

The attached font contains one interesting glyph "~" and lots of glyphs
which are vertical bars and are included to show spacing.

The interesting glyph moves the zone by 4 pixels. In freetype this
increases the advance width of the glyph. On the mac (with it's native
rasterizer) the advance width is not increased.

The example images were taken with a 9ppem rasterization.
   ftstring -m "A~A" 9 Untitled1.ttf

The attached patch fixes the problem I see...

Attachment: Untitled1.ttf
Description: application/font-ttf

Attachment: Untitled1-mac.png
Description: PNG image

Attachment: Untitled1-freetype.png
Description: PNG image

--- ttinterp.c~ 2007-01-19 16:44:07.000000000 -0800
+++ ttinterp.c  2007-01-19 17:14:22.000000000 -0800
@@ -5466,8 +5466,14 @@
     if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
       return;
 
-    if ( CUR.zp2.n_points > 0 )
+    /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points */
+    /* Twilight zone has no contours, so use n_points.        */
+    /* Normal zone 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;
 
_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to