[gs-cvs] rev 7592 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Tue Jan 9 15:41:08 PST 2007


Author: leonardo
Date: 2007-01-09 15:41:08 -0800 (Tue, 09 Jan 2007)
New Revision: 7592

Modified:
   trunk/gs/src/gsmisc.c
   trunk/gs/src/gxhintn1.c
Log:
Type 1 hinter : Implementing a contour sign normalization, part 6.

DETAILS :

Bug 687826 "some glyphs filled in".
This old bug contains more test cases,
which allowed to improve the algorithm.

1. gx_intersect_small_bars returned a root,
   which appears outside the bar 1. 
2. A wrong index in t1_hinter__intersect_curve_bar. 
3. A wrong index in t1_hinter__contour_intersection.
4. Increased MAX_NORMALIZING_CONTOURS to 5 as in the '%' sign.
6. The check for contours number was wrong in 
   t1_hinter__fix_contour_signs.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gsmisc.c
===================================================================
--- trunk/gs/src/gsmisc.c	2007-01-09 21:15:01 UTC (rev 7591)
+++ trunk/gs/src/gsmisc.c	2007-01-09 23:41:08 UTC (rev 7592)
@@ -1376,10 +1376,13 @@
 		    return false;
 		}
 	    }
-	    if (dy1 > 0 && iy >= dy1)
-		return false; /* Outside the bar 1. */
-	    if (dy1 < 0 && iy <= dy1)
-		return false; /* Outside the bar 1. */
+	    if (dy1 > 0) {
+		if (iy < 0 || iy >= dy1)
+		    return false; /* Outside the bar 1. */
+	    } else {
+		if (iy > 0 || iy <= dy1)
+		    return false; /* Outside the bar 1. */
+	    }
 	    if (dy2 < dy3) {
 		if (iy <= dy2 || iy >= dy3)
 		    return false; /* Outside the bar 2. */

Modified: trunk/gs/src/gxhintn1.c
===================================================================
--- trunk/gs/src/gxhintn1.c	2007-01-09 21:15:01 UTC (rev 7591)
+++ trunk/gs/src/gxhintn1.c	2007-01-09 23:41:08 UTC (rev 7592)
@@ -339,7 +339,7 @@
     fixed x2 = this->pole[i + 2].gx - X0;
     fixed y2 = this->pole[i + 2].gy - Y0;
     fixed x3 = this->pole[i + 3].gx - X0;
-    fixed y3 = this->pole[i + 4].gy - Y0;
+    fixed y3 = this->pole[i + 3].gy - Y0;
     int k = curve_log2_samples(0, 0, x1, y1, x2, y2, x3, y3);
     int m = bar_samples(X1, Y1);
 
@@ -494,9 +494,9 @@
 	if (this->pole[i + 1].type != offcurve) {  /* line or close. */
 	    for (j = b1; j < e1;) {
 		if (this->pole[j + 1].type != offcurve) {  /* line or close. */
-		    j++;
 		    if (t1_hinter__intersect_bar_bar(this, i, j))
 			return true;
+		    j++;
 		} else {
 		    if (t1_hinter__intersect_curve_bar(this, j, i))
 			return true;
@@ -522,7 +522,7 @@
     return false;
 }
 
-#define MAX_NORMALIZING_CONTOURS 4
+#define MAX_NORMALIZING_CONTOURS 5
 
 private void t1_hinter__fix_subglyph_contour_signs(t1_hinter * this, int first_contour, int last_contour)
 {
@@ -710,7 +710,7 @@
 	int first_contour = this->subglyph[i - 1];
 	int last_contour  = this->subglyph[i] - 1;
 
-	if (last_contour - first_contour >= MAX_NORMALIZING_CONTOURS - 1) { 
+	if (last_contour - first_contour >= MAX_NORMALIZING_CONTOURS) { 
 	    /* 4 or more contours.
 	       We didn't meet so complex characters with wrong contours signs. 
 	       Skip it for saving the CPU time. */



More information about the gs-cvs mailing list