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

alexcher at ghostscript.com alexcher at ghostscript.com
Sat Feb 17 06:14:10 PST 2007


Author: alexcher
Date: 2007-02-17 06:14:09 -0800 (Sat, 17 Feb 2007)
New Revision: 7710

Modified:
   trunk/gs/doc/pscet_status.txt
   trunk/gs/lib/gs_typ32.ps
   trunk/gs/src/int.mak
   trunk/gs/src/zcharx.c
   trunk/gs/src/zfont32.c
Log:
Throw /invalidfont error when glyph 0 is accessed but it is missing from
the type 32 font,

DETAILS:
CET 35_all-12 checks, among other things, how glyphshow operator handles
type 32 fonts without glyph 0. This patch add a check to the BuildGlyph
procedure of type 32 font for the missing 0 glyph that throws /invalidfont
error. The offending command name is retrieved from the text enumeration
structure using a new operator: .getshowoperator

DIFFERENCES:
No raster differences on the comparefiles test.
409-01.PS has different order of resource enumeration
Type1C fonts in generated PDF files depend on directory enumeration order.

The following CET pages have different checksums because of the different
memory layout or differences in dictionary and resource enumeration.
09-56-01 different resource enumeration order
23-25-03 different resource enumeration order
23-32-02 different address of an operator that propagates to the output
28-06-01 different directory enumeration order


Modified: trunk/gs/doc/pscet_status.txt
===================================================================
--- trunk/gs/doc/pscet_status.txt	2007-02-16 20:40:10 UTC (rev 7709)
+++ trunk/gs/doc/pscet_status.txt	2007-02-17 14:14:09 UTC (rev 7710)
@@ -5523,7 +5523,7 @@
 		GS is not removing glyphs from previous page "currentfont removeall".
 		Assign: Ray
 
-35_all-12  DIFF	glyphshow : Different error reporting. Analyzed by Igor. assign: Alex.
+35_all-12 OK  	Fixed by rev. 7710 - Alex.
 
 35_all-2  OK  	Fixed as of rev 7583.
 

Modified: trunk/gs/lib/gs_typ32.ps
===================================================================
--- trunk/gs/lib/gs_typ32.ps	2007-02-16 20:40:10 UTC (rev 7709)
+++ trunk/gs/lib/gs_typ32.ps	2007-02-17 14:14:09 UTC (rev 7710)
@@ -95,8 +95,14 @@
 (%Type32BuildGlyph) cvn {	% <font> <cid> %Type32BuildGlyph -
   1 index /CharStrings get
 		% Stack: font cid CharStrings
-  dup 2 index .knownget
- { exch pop } { 0 get } ifelse
+  dup 2 index .knownget {
+    exch pop
+  } {
+    0 .knownget not {
+      exch pop  % Stack: cid
+      .getshowoperator /invalidfont signalerror
+    } if
+  } ifelse
 		% Stack: font cid cstr
   dup //.getmetrics32	% use // because of .undef below
   dup 14 gt {
@@ -116,7 +122,7 @@
     [ 1 0 0 1 11 -2 roll exch neg exch neg ] 5 -1 roll imagemask
   } ifelse
   pop pop pop pop
-} bind def
+} .bind def
 
 systemdict /.getmetrics32 .undef
 

Modified: trunk/gs/src/int.mak
===================================================================
--- trunk/gs/src/int.mak	2007-02-16 20:40:10 UTC (rev 7709)
+++ trunk/gs/src/int.mak	2007-02-17 14:14:09 UTC (rev 7710)
@@ -777,8 +777,8 @@
 	$(PSCC) $(PSO_)zchar32.$(OBJ) $(C_) $(PSSRC)zchar32.c
 
 $(PSOBJ)zfont32.$(OBJ) : $(PSSRC)zfont32.c $(OP)\
- $(gsccode_h) $(gsmatrix_h) $(gsutil_h) $(gxfont_h)\
- $(bfont_h) $(store_h)
+ $(gsccode_h) $(gsmatrix_h) $(gsutil_h) $(gxfont_h) $(gxtext_h)\
+ $(bfont_h) $(store_h) $(ichar_h)
 	$(PSCC) $(PSO_)zfont32.$(OBJ) $(C_) $(PSSRC)zfont32.c
 
 type32_=$(PSOBJ)zchar32.$(OBJ) $(PSOBJ)zfont32.$(OBJ)
@@ -1438,7 +1438,7 @@
 	$(PSCC) $(PSO_)ibnum.$(OBJ) $(C_) $(PSSRC)ibnum.c
 
 $(PSOBJ)zcharx.$(OBJ) : $(PSSRC)zcharx.c $(OP)\
- $(gsmatrix_h) $(gstext_h) $(gxfixed_h) $(gxfont_h)\
+ $(gsmatrix_h) $(gstext_h) $(gxfixed_h) $(gxfont_h) $(gxtext_h)\
  $(ialloc_h) $(ibnum_h) $(ichar_h) $(iname_h) $(igstate_h) $(memory__h)
 	$(PSCC) $(PSO_)zcharx.$(OBJ) $(C_) $(PSSRC)zcharx.c
 

Modified: trunk/gs/src/zcharx.c
===================================================================
--- trunk/gs/src/zcharx.c	2007-02-16 20:40:10 UTC (rev 7709)
+++ trunk/gs/src/zcharx.c	2007-02-17 14:14:09 UTC (rev 7710)
@@ -19,6 +19,7 @@
 #include "gstext.h"
 #include "gxfixed.h"		/* for gxfont.h */
 #include "gxfont.h"
+#include "gxtext.h"
 #include "ialloc.h"
 #include "ichar.h"
 #include "igstate.h"
@@ -58,6 +59,7 @@
     if ((code = glyph_show_setup(i_ctx_p, &glyph)) != 0 ||
 	(code = gs_glyphshow_begin(igs, glyph, imemory, &penum)) < 0)
 	return code;
+    *(op_proc_t *)&penum->enum_client_data = zglyphshow;
     if ((code = op_show_finish_setup(i_ctx_p, penum, 1, NULL)) < 0) {
 	ifree_object(penum, "zglyphshow");
 	return code;

Modified: trunk/gs/src/zfont32.c
===================================================================
--- trunk/gs/src/zfont32.c	2007-02-16 20:40:10 UTC (rev 7709)
+++ trunk/gs/src/zfont32.c	2007-02-17 14:14:09 UTC (rev 7710)
@@ -19,8 +19,10 @@
 #include "gsmatrix.h"
 #include "gsutil.h"
 #include "gxfont.h"
+#include "gxtext.h"
 #include "bfont.h"
 #include "store.h"
+#include "ichar.h"
 
 /* The encode_char procedure of a Type 32 font should never be called. */
 private gs_glyph
@@ -59,10 +61,31 @@
     return define_gs_font((gs_font *) pfont);
 }
 
+/* - .getshowoperator <oper|null> */
+/* Get the calling operator for error reporting in %Type32BuildGlyph */
+private int
+zgetshowoperator(i_ctx_t *i_ctx_p)
+{
+    os_ptr op = osp;
+    gs_text_enum_t *osenum = op_show_find(i_ctx_p);
+  
+    push(1);
+    if (osenum == NULL)
+        make_null(op);
+    else {
+        op_proc_t proc;
+        *(void **)&proc = osenum->enum_client_data;
+        make_oper(op, 0, proc);
+    }
+    return 0;
+}
+
+
 /* ------ Initialization procedure ------ */
 
 const op_def zfont32_op_defs[] =
 {
     {"2.buildfont32", zbuildfont32},
+    {"0.getshowoperator", zgetshowoperator},
     op_def_end(0)
 };



More information about the gs-cvs mailing list