[gs-cvs] rev 7601 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Fri Jan 12 02:23:19 PST 2007
Author: leonardo
Date: 2007-01-12 02:23:19 -0800 (Fri, 12 Jan 2007)
New Revision: 7601
Modified:
trunk/gs/src/gstype1.c
trunk/gs/src/gxtype1.c
trunk/gs/src/gxtype1.h
Log:
Provide the CPSI compatibility for Type1 subglyph placement.
DETAILS :
Debugged with CET 16-01-1 16-02-1 16-10-1 16-10-2.
The new 'seac' offset formula 'overall_x_offset'
has been empirically derived from placements of
the "round" accent subglyph in the CPSI rendering.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/gstype1.c
===================================================================
--- trunk/gs/src/gstype1.c 2007-01-11 18:55:08 UTC (rev 7600)
+++ trunk/gs/src/gstype1.c 2007-01-12 10:23:19 UTC (rev 7601)
@@ -300,10 +300,15 @@
wx = pcis->width.x;
wy = pcis->width.y;
}
- }
+ } else
+ pcis->base_lsb = sbx;
code = t1_hinter__sbw(h, sbx, sby, wx, wy);
- } else
- code = t1_hinter__sbw_seac(h, pcis->adxy.x, pcis->adxy.y);
+ } else {
+ fixed accent_lsb = cs0;
+ fixed overall_x_offset = pcis->save_lsb.x + pcis->save_adxy.x - pcis->save_asb + accent_lsb - pcis->base_lsb;
+
+ code = t1_hinter__sbw_seac(h, overall_x_offset, pcis->adxy.y);
+ }
if (code < 0)
return code;
gs_type1_sbw(pcis, cs0, fixed_0, cs1, fixed_0);
@@ -317,29 +322,6 @@
if (pcis->init_done < 0) {
/* Finish init when we return. */
pcis->init_done = 0;
- } else {
- /*
- * Accumulate the side bearing now, but don't do it
- * a second time for the base character of a seac.
- */
- if (pcis->seac_accent >= 0) {
- /*
- * As a special hack to work around a bug in
- * Fontographer, we deal with the (illegal)
- * situation in which the side bearing of the
- * accented character (save_lsbx) is different from
- * the side bearing of the base character (cs0/cs1).
- */
- fixed dsbx = cs0 - pcis->save_lsb.x;
- fixed dsby = cs1 - pcis->save_lsb.y;
-
- if (dsbx | dsby) {
- pcis->lsb.x += dsbx;
- pcis->lsb.y += dsby;
- pcis->save_adxy.x -= dsbx;
- pcis->save_adxy.y -= dsby;
- }
- }
}
return type1_result_sbw;
case cx_escape:
@@ -386,7 +368,7 @@
case ce1_sbw:
if (!pcis->seac_flag)
code = t1_hinter__sbw(h, cs0, cs1, cs2, cs3);
- else
+ else
code = t1_hinter__sbw_seac(h, cs0 + pcis->adxy.x , cs1 + pcis->adxy.y);
if (code < 0)
return code;
Modified: trunk/gs/src/gxtype1.c
===================================================================
--- trunk/gs/src/gxtype1.c 2007-01-11 18:55:08 UTC (rev 7600)
+++ trunk/gs/src/gxtype1.c 2007-01-12 10:23:19 UTC (rev 7601)
@@ -174,6 +174,7 @@
/* Initialize hint-related scalars. */
pcis->asb_diff = pcis->adxy.x = pcis->adxy.y = 0;
+ pcis->base_lsb = 0;
pcis->flex_count = flex_max; /* not in Flex */
pcis->vs_offset.x = pcis->vs_offset.y = 0;
Modified: trunk/gs/src/gxtype1.h
===================================================================
--- trunk/gs/src/gxtype1.h 2007-01-11 18:55:08 UTC (rev 7600)
+++ trunk/gs/src/gxtype1.h 2007-01-12 10:23:19 UTC (rev 7601)
@@ -125,6 +125,7 @@
/* needed to adjust Flex endpoint */
gs_fixed_point adxy; /* seac accent displacement, */
/* needed to adjust currentpoint */
+ 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 */
#define flex_max 8
More information about the gs-cvs
mailing list