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

leonardo at ghostscript.com leonardo at ghostscript.com
Tue Mar 6 13:37:14 PST 2007


Author: leonardo
Date: 2007-03-06 13:37:14 -0800 (Tue, 06 Mar 2007)
New Revision: 7770

Modified:
   trunk/gs/src/gstype1.c
   trunk/gs/src/gstype2.c
   trunk/gs/src/gxtype1.c
   trunk/gs/src/gxtype1.h
Log:
Fix (Type 1 interpreter) : Account the replaced side bearing in setcurrentpoint.

DETAILS :

When the side bearing is replaced with Metrics or Metrics2,
the old code didn't account that while executing setcurrentpoint,
so that further outline poles go to wrong (unreplaced) coordinates.
Fixes CET 16-03-2.

EXPECTED DIFFERENCES :

None with comparefiles.

CET 16-03-2 16-03-3 16-09-1


Modified: trunk/gs/src/gstype1.c
===================================================================
--- trunk/gs/src/gstype1.c	2007-03-06 19:46:12 UTC (rev 7769)
+++ trunk/gs/src/gstype1.c	2007-03-06 21:37:14 UTC (rev 7770)
@@ -293,6 +293,8 @@
 
 		    if (pcis->seac_accent < 0) {
 			if (pcis->sb_set) {
+			    pcis->origin_offset.x = pcis->lsb.x - sbx;
+			    pcis->origin_offset.y = pcis->lsb.y - sby;
 			    sbx = pcis->lsb.x;
 			    sby = pcis->lsb.y;
 			}
@@ -497,8 +499,8 @@
 			    return_error(code);
 			goto pushed;
 		    case ce1_setcurrentpoint:
-			cs0 += pcis->adxy.x;
-			cs1 += pcis->adxy.y;
+			cs0 += pcis->adxy.x + pcis->origin_offset.x;
+			cs1 += pcis->adxy.y + pcis->origin_offset.y;
 			t1_hinter__setcurrentpoint(h, cs0, cs1);
 			cnext;
 		    default:

Modified: trunk/gs/src/gstype2.c
===================================================================
--- trunk/gs/src/gstype2.c	2007-03-06 19:46:12 UTC (rev 7769)
+++ trunk/gs/src/gstype2.c	2007-03-06 21:37:14 UTC (rev 7770)
@@ -66,6 +66,8 @@
 	wx = pcis->pfont->data.defaultWidthX;
     if (pcis->seac_accent < 0) {
 	if (pcis->sb_set) {
+	    pcis->origin_offset.x = pcis->lsb.x - sbx;
+	    pcis->origin_offset.y = pcis->lsb.y - sby;
 	    sbx = pcis->lsb.x;
 	    sby = pcis->lsb.y;
 	}
@@ -335,7 +337,8 @@
 		    if (code < 0)
 			return code;
 		} else {
-		    t1_hinter__setcurrentpoint(h, pcis->save_adxy.x, pcis->save_adxy.y);
+		    t1_hinter__setcurrentpoint(h, pcis->save_adxy.x + pcis->origin_offset.x, 
+						  pcis->save_adxy.y + pcis->origin_offset.y);
 		    code = t1_hinter__end_subglyph(h);
 		    if (code < 0)
 			return code;

Modified: trunk/gs/src/gxtype1.c
===================================================================
--- trunk/gs/src/gxtype1.c	2007-03-06 19:46:12 UTC (rev 7769)
+++ trunk/gs/src/gxtype1.c	2007-03-06 21:37:14 UTC (rev 7770)
@@ -125,6 +125,7 @@
     pcis->num_hints = 0;
     pcis->seac_accent = -1;
     pcis->log2_subpixels = *plog2_subpixels;
+    pcis->origin_offset.x = pcis->origin_offset.y = 0;
 
     /* Set the sampling scale. */
     set_pixel_scale(&pcis->scale.x, plog2_scale->x);

Modified: trunk/gs/src/gxtype1.h
===================================================================
--- trunk/gs/src/gxtype1.h	2007-03-06 19:46:12 UTC (rev 7769)
+++ trunk/gs/src/gxtype1.h	2007-03-06 21:37:14 UTC (rev 7770)
@@ -134,6 +134,7 @@
     fixed base_lsb;		/* The lsb of the base character for 'seac'. */
     int flex_path_state_flags;	/* record whether path was open */
 				/* at start of Flex section */
+    gs_fixed_point origin_offset; /* Origin offset due to replaced metrics. */
 #define flex_max 8
     int flex_count;
     int ignore_pops;		/* # of pops to ignore (after */



More information about the gs-cvs mailing list