[gs-commits] rev 11596 - trunk/gs/psi

ken at ghostscript.com ken at ghostscript.com
Tue Aug 3 12:02:47 UTC 2010


Author: ken
Date: 2010-08-03 12:02:47 +0000 (Tue, 03 Aug 2010)
New Revision: 11596

Modified:
   trunk/gs/psi/zfapi.c
Log:
Fix : FAPI (no bug number, discovered working on a different problem)

Another place where the FAPI code assumes that a text enumerator is a show_enum and 
casts it as such. While this is true for rendering, it is not the case when capturing
glyphs for pdfwrite.

Altered the code to test if the enumerator is a show_enum and if not, to get the
graphics state from the enumerator 'pis' pointer instead if possible. Signal an error
if this is not possible.

No differences expected.


Modified: trunk/gs/psi/zfapi.c
===================================================================
--- trunk/gs/psi/zfapi.c	2010-08-03 08:02:13 UTC (rev 11595)
+++ trunk/gs/psi/zfapi.c	2010-08-03 12:02:47 UTC (rev 11596)
@@ -1520,10 +1520,22 @@
 {   FAPI_path path_interface = path_interface_stub;
     FAPI_outline_handler olh;
     int code;
+    gs_state *pgs;
+    extern_st(st_gs_show_enum);
+    extern_st(st_gs_state);
 
+    if (gs_object_type(penum_s->memory, penum_s) == &st_gs_show_enum) {
+	pgs = penum_s->pgs;
+    } else {
+	if (gs_object_type(penum_s->memory, penum_s->pis) == &st_gs_state) {
+	    pgs = (gs_state *)penum_s->pis;
+	} else
+	    /* No graphics state, give up... */
+	    return_error(e_undefined);
+    }
     olh.path = path;
-    olh.x0 = penum_s->pgs->ctm.tx_fixed;
-    olh.y0 = penum_s->pgs->ctm.ty_fixed;
+    olh.x0 = pgs->ctm.tx_fixed;
+    olh.y0 = pgs->ctm.ty_fixed;
     olh.close_path = close_path;
     olh.need_close = false;
     path_interface.olh = &olh;



More information about the gs-commits mailing list