shithub: freetype+ttf2subf

Download patch

ref: 29bc310563d4c8c728adfa78e18af9e4d3c89116
parent: 3757b1e1c1ff64ccdaf8793c901359a033cea0ad
author: Werner Lemberg <[email protected]>
date: Thu Jan 13 07:22:55 EST 2011

[raster] Handle drop-outs at glyph borders according to Microsoft.

If a drop-out rule would switch on a pixel outside of the glyph's
bounding box, use the right (or top) pixel instead.  This is an
undocumented feature, but some fonts like `Helvetica Neue LT Com 65
Medium' heavily rely on it.

Thanks to Greg Hitchcock who explained this behaviour.

* src/raster/ftraster.c (Vertical_Sweep_Drop,
Horizontal_Sweep_Drop): Implement it.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-13  Werner Lemberg  <[email protected]>
+
+	[raster] Handle drop-outs at glyph borders according to Microsoft.
+
+	If a drop-out rule would switch on a pixel outside of the glyph's
+	bounding box, use the right (or top) pixel instead.  This is an
+	undocumented feature, but some fonts like `Helvetica Neue LT Com 65
+	Medium' heavily rely on it.
+
+	Thanks to Greg Hitchcock who explained this behaviour.
+
+	* src/raster/ftraster.c (Vertical_Sweep_Drop,
+	Horizontal_Sweep_Drop): Implement it.
+
 2011-01-09  suzuki toshiya  <[email protected]>
 
 	[cache] Fix Savannah bug #31923, patch drafted by Harsha.
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -2403,6 +2403,11 @@
           return;  /* no drop-out control */
         }
 
+        /* undocumented but confirmed: If the drop-out would result in a  */
+        /* pixel outside of the bounding box, use the right pixel instead */
+        if ( pxl < 0 )
+          pxl = e1;
+
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;
 
@@ -2578,6 +2583,11 @@
         default: /* modes 2, 3, 6, 7 */
           return;  /* no drop-out control */
         }
+
+        /* undocumented but confirmed: If the drop-out would result in a */
+        /* pixel outside of the bounding box, use the top pixel instead  */
+        if ( pxl < 0 )
+          pxl = e1;
 
         /* check that the other pixel isn't set */
         e1 = pxl == e1 ? e2 : e1;