shithub: freetype+ttf2subf

Download patch

ref: 19fbc576afe8e8de2f49f57ddbe4a27c84bcbaa1
parent: b72af52b9c6f2710e6338cad793ee9bb1c316ed3
author: Werner Lemberg <[email protected]>
date: Fri May 22 05:20:25 EDT 2009

Improve b/w rasterizer.
Problem reported by Krzysztof Kotlenga <[email protected]>.

* src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if
intersections are equally distant relative to next pixel center,
select the left pixel, not the right one.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-05-22  Werner Lemberg  <[email protected]>
+
+	Improve b/w rasterizer.
+	Problem reported by Krzysztof Kotlenga <[email protected]>.
+
+	* src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
+	Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if
+	intersections are equally distant relative to next pixel center,
+	select the left pixel, not the right one.
+
 2009-05-19  Werner Lemberg  <[email protected]>
 
 	Fix Savannah bug #26600.
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -2230,7 +2230,7 @@
           break;
 
         case 4: /* smart drop-outs including stubs */
-          pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+          pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
           break;
 
         case 1: /* simple drop-outs excluding stubs */
@@ -2276,7 +2276,7 @@
           if ( ras.dropOutControl == 1 )
             pxl = e2;
           else
-            pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+            pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
           break;
 
         default: /* modes 2, 3, 6, 7 */
@@ -2425,7 +2425,7 @@
           break;
 
         case 4: /* smart drop-outs including stubs */
-          pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+          pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
           break;
 
         case 1: /* simple drop-outs excluding stubs */
@@ -2443,7 +2443,7 @@
           if ( ras.dropOutControl == 1 )
             pxl = e2;
           else
-            pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+            pxl = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
           break;
 
         default: /* modes 2, 3, 6, 7 */
@@ -2675,7 +2675,7 @@
           break;
 
         case 4: /* smart drop-outs including stubs */
-          e1 = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+          e1 = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
           break;
 
         case 1: /* simple drop-outs excluding stubs */
@@ -2693,7 +2693,7 @@
           if ( ras.dropOutControl == 1 )
             e1 = e2;
           else
-            e1 = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half );
+            e1 = FLOOR( ( x1 + x2 + 1 ) / 2 + ras.precision_half - 1 );
 
           break;