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

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Dec 30 22:10:33 PST 2007


Author: alexcher
Date: 2007-12-30 22:10:33 -0800 (Sun, 30 Dec 2007)
New Revision: 8466

Modified:
   trunk/gs/src/zchar1.c
Log:
Don't try to obtain the bounding box of a glyph when FontBBox is invalid and
CTM is singular. Set an empty box and consider it valid. The bounding box is
not used when the CTM is singular. Bug 689614, customer 384.

DIFFERENCES:
None.


Modified: trunk/gs/src/zchar1.c
===================================================================
--- trunk/gs/src/zchar1.c	2007-12-29 02:53:21 UTC (rev 8465)
+++ trunk/gs/src/zchar1.c	2007-12-31 06:10:33 UTC (rev 8466)
@@ -252,17 +252,33 @@
 	    code = (*exec_cont)(i_ctx_p);
 	return code;
     } else {
-	/*
-	 * The FontBBox is not valid.  In this case,
-	 * we create the path first, then do the setcachedevice.
+	/* The FontBBox is not valid */
+        const ref *opstr = op;
+	ref other_subr;
+        const gs_matrix * pctm = &ctm_only(igs);
+
+	/* First, check for singular CTM */
+        if (pctm->xx * pctm->yy == pctm->xy * pctm->yx) {
+           /* The code below won't be able to find the FontBBox but we
+            * don't need it anyway. Set an empty box and consider it valid.
+            */
+	    op_proc_t exec_cont = 0;
+
+	    cxs.char_bbox.p.x = 0;
+	    cxs.char_bbox.p.y = 0;
+	    cxs.char_bbox.q.x = 0;
+	    cxs.char_bbox.q.y = 0;
+	    code = type1exec_bbox(i_ctx_p, penum, &cxs, pfont, &exec_cont);
+	    if (code >= 0 && exec_cont != 0)
+	        code = (*exec_cont)(i_ctx_p);
+	    return code;
+        }
+	/* Now we create the path first, then do the setcachedevice.
 	 * If we are oversampling (in this case, only for anti-
 	 * aliasing, not just to improve quality), we have to
 	 * create the path twice, since we can't know the
 	 * oversampling factor until after setcachedevice.
 	 */
-	const ref *opstr = op;
-	ref other_subr;
-
 	if (cxs.present == metricsSideBearingAndWidth) {
 	    gs_point sbpt;
 



More information about the gs-cvs mailing list