[gs-cvs] rev 6948 - in trunk/gs: lib src

lpd at ghostscript.com lpd at ghostscript.com
Wed Aug 2 05:29:14 PDT 2006


Author: lpd
Date: 2006-08-02 05:29:12 -0700 (Wed, 02 Aug 2006)
New Revision: 6948

Modified:
   trunk/gs/lib/gs_init.ps
   trunk/gs/src/zpath1.c
Log:
Changes pathbbox from an operator procedure to an operator, in order to
match the stack trace (on an error) from Adobe interpreters (checked by the
Genoa CET).


Modified: trunk/gs/lib/gs_init.ps
===================================================================
--- trunk/gs/lib/gs_init.ps	2006-08-02 04:35:45 UTC (rev 6947)
+++ trunk/gs/lib/gs_init.ps	2006-08-02 12:29:12 UTC (rev 6948)
@@ -470,9 +470,6 @@
 /languagelevel 1 def		% gs_lev2.ps may change this
 /makeimagedevice { false makewordimagedevice } odef
 /matrix	{ 6 array identmatrix } odef
-/pathbbox
-	{ false .pathbbox
-	} odef
 % .promptmsg is redefined if the interpreter includes readline support.
 /.promptmsg {
 	(GS) print

Modified: trunk/gs/src/zpath1.c
===================================================================
--- trunk/gs/src/zpath1.c	2006-08-02 04:35:45 UTC (rev 6947)
+++ trunk/gs/src/zpath1.c	2006-08-02 12:29:12 UTC (rev 6948)
@@ -140,7 +140,7 @@
 
 /* <bool> .pathbbox <llx> <lly> <urx> <ury> */
 private int
-zpathbbox(i_ctx_t *i_ctx_p)
+z1pathbbox(i_ctx_t *i_ctx_p)
 {
     os_ptr op = osp;
     gs_rect box;
@@ -158,6 +158,26 @@
     return 0;
 }
 
+/*
+ * In order to match Adobe output on a Genoa test, pathbbox must be an
+ * operator, not an operator procedure, even though it has a trivial
+ * definition as a procedure.
+ */
+private int
+zpathbbox(i_ctx_t *i_ctx_p)
+{
+    os_ptr op = osp;
+    int code;
+
+    push(1);
+    make_false(op);
+    code = z1pathbbox(i_ctx_p);
+    if (code < 0) {
+	pop(1);			/* remove the Boolean */
+    }
+    return code;
+}
+
 /* <moveproc> <lineproc> <curveproc> <closeproc> pathforall - */
 private int path_continue(i_ctx_t *);
 private int path_cleanup(i_ctx_t *);
@@ -269,7 +289,8 @@
     {"4pathforall", zpathforall},
     {"0reversepath", zreversepath},
     {"0strokepath", zstrokepath},
-    {"1.pathbbox", zpathbbox},
+    {"1.pathbbox", z1pathbbox},
+    {"0pathbbox", zpathbbox},
 		/* Internal operators */
     {"0%path_continue", path_continue},
     op_def_end(0)



More information about the gs-cvs mailing list