[gs-devel] Type 1 subglyph positioning.
Igor V. Melichev
igor.melichev at artifex.com
Thu Jan 11 12:35:24 PST 2007
Folks,
Working on the subglyph placement in CET 16-01.PS,
I've got another magic formula :
overall_x_offset = composite_glyph_lsb + seac.adxy.x
- seac.asb + accent_lsb - base_lsb;
It give a CPSI compatible result,
but it is some different what we used in the past.
See the attached patch.
At this moment I'm unable to estimate this result.
>From some point of view it looks as a reasonable extension
for the Type 1 specification.
I'd like to know what other Type 1 experts may think about it.
Thank you.
Leo.
-------------- next part --------------
Not committed yet.
[Log message beg]
Provide the CPSI compatibility for Type1 subglyph placement.
DETAILS :
Debugged with CET 16-01.PS .
The new 'seac' offset formula 'overall_x_offset'
has been empirically derived from placements of
the "round" accent subglyph in the CPSI rendering.
The formula looks reasonable, but we don't like that
the old workaround for Phontographer bug appears
to account "pcis->save_asb" with the opposite sign.
The new formula works for the CPSI compatibility mode only.
EXPECTED DIFFERENCES :
None.
[Log message end]
*** F:\SVN-GS\HEAD\gs\src\gstype1.c Mon Jan 8 18:04:59 2007
--- files\gs\src\gstype1.c Thu Jan 11 23:14:18 2007
***************
*** 77,80 ****
--- 77,81 ----
int code = 0;
fixed ftx = pcis->origin.x, fty = pcis->origin.y;
+ extern bool CPSI_mode;
switch (pcis->init_done) {
***************
*** 301,306 ****
wy = pcis->width.y;
}
! }
code = t1_hinter__sbw(h, sbx, sby, wx, wy);
} else
code = t1_hinter__sbw_seac(h, pcis->adxy.x, pcis->adxy.y);
--- 302,313 ----
wy = pcis->width.y;
}
! } else
! pcis->base_lsb = sbx;
code = t1_hinter__sbw(h, sbx, sby, wx, wy);
+ } else if (CPSI_mode) {
+ 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);
} else
code = t1_hinter__sbw_seac(h, pcis->adxy.x, pcis->adxy.y);
***************
*** 323,327 ****
* 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
--- 330,334 ----
* a second time for the base character of a seac.
*/
! if (pcis->seac_accent >= 0 && !CPSI_mode) {
/*
* As a special hack to work around a bug in
*** F:\SVN-GS\HEAD\gs\src\gxtype1.c Wed Mar 15 15:04:54 2006
--- files\gs\src\gxtype1.c Thu Jan 11 23:11:49 2007
***************
*** 175,178 ****
--- 175,179 ----
/* 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;
*** F:\SVN-GS\HEAD\gs\src\gxtype1.h Wed Mar 15 15:04:54 2006
--- files\gs\src\gxtype1.h Thu Jan 11 23:11:49 2007
***************
*** 126,129 ****
--- 126,130 ----
gs_fixed_point adxy; /* seac accent displacement, */
/* needed to adjust currentpoint */
+ fixed base_lsb; /* Only for CPSI_mode==true. */
int flex_path_state_flags; /* record whether path was open */
/* at start of Flex section */
More information about the gs-devel
mailing list