[gs-cvs] gs/src
Igor Melichev
igor at ghostscript.com
Mon Jan 10 03:37:37 PST 2005
Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv8766/gs/src
Modified Files:
Tag: GS_8_1X
gxchar.c
Log Message:
Fix : CDevProc|Metrics|Metrics2 did not work with CIDFontType 0 (continued 2).
DETAILS :
Bug 687832 (PDF interpreter) : CID Font in PDF
The CDevProc output was transformed with w CID font leaf's FontMatrix.
See comment in code.
EXPECTED DIFFERENCES :
None.
Index: gxchar.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxchar.c,v
retrieving revision 1.27.2.4
retrieving revision 1.27.2.5
diff -u -d -r1.27.2.4 -r1.27.2.5
--- gxchar.c 23 Jun 2004 08:39:04 -0000 1.27.2.4
+++ gxchar.c 10 Jan 2005 11:37:35 -0000 1.27.2.5
@@ -335,6 +335,25 @@
if (penum->width_status != sws_none && penum->width_status != sws_retry)
return_error(gs_error_undefined);
+ if (penum->fstack.depth > 0 &&
+ penum->fstack.items[penum->fstack.depth].font->FontType == ft_CID_encrypted) {
+ /* We must not convert advance width with a CID font leaf's FontMatrix,
+ because CDevProc is attached to the CID font rather than to its leaf.
+ But show_state_setup sets CTM with the leaf's matrix.
+ Compensate it here with inverse FontMatrix of the leaf.
+ ( We would like to do without an inverse transform, but
+ we don't like to extend general gs_state or gs_show_enum
+ for this particular reason. ) */
+ const gx_font_stack_item_t *pfsi = &penum->fstack.items[penum->fstack.depth];
+ gs_point p;
+
+ code = gs_distance_transform_inverse(wx, wy,
+ &gs_cid0_indexed_font(pfsi->font, pfsi->index)->FontMatrix, &p);
+ if (code < 0)
+ return code;
+ wx = p.x;
+ wy = p.y;
+ }
if ((code = gs_distance_transform2fixed(&pgs->ctm, wx, wy, &penum->wxy)) < 0)
return code;
/* Check whether we're setting the scalable width */
More information about the gs-cvs
mailing list