[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.
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
diff --git a/ChangeLog b/ChangeLog
index 7986940..5d25d78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-13 Werner Lemberg <wl@gnu.org>
+
+ [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 <mpsuzuki@hiroshima-u.ac.jp>
[cache] Fix Savannah bug #31923, patch drafted by Harsha.
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 9638dfb..a6d3179 100644
--- 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;
@@ -2579,6 +2584,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 top pixel instead */
+ if ( pxl < 0 )
+ pxl = e1;
+
/* check that the other pixel isn't set */
e1 = pxl == e1 ? e2 : e1;