[gs-devel] Re: [gs-fonts] forbidden CDevProc in zcharstring_outline()

L. Peter Deutsch ghost at aladdin.com
Fri Aug 23 09:34:53 PDT 2002

CDevProc is rejected because the PostScript interpreter cannot be called
recursively, and specifically cannot be called from inside a driver such as

A fairly simple fix would be to change the PostScript code for definefont
and Font/defineresource so that they do the same thing with CDevProc that
the DeviceN code now does with some other procedures, namely, to convert the
CDevProc to a FunctionType 4 Function if that is possible.  This handles
many, but not all, reasonable and common CDevProcs.  (FunctionType 4
Functions, which are essentially PostScript procedures written in a very
restricted subset of PostScript, are documented in the PDF Reference;
Ghostscript implements them by converting them to an internal data structure
that can be "interpreted" very quickly and easily.  See zfunc4.c and

A fully complete fix would somehow use the approach that the PostScript
interpreter already uses for ordinary rendering, using a continuation.  I am
not sure how best to make this machinery available to high-level drivers
like pdfwrite.  See zchar1.c, zchar42.c, zcharout.c, zfapi.c.


L. Peter Deutsch     |    Aladdin Enterprises   |  203 Santa Margarita Ave.
ghost at aladdin.com    |  http://www.aladdin.com  |  Menlo Park, CA 94025

   No government censorship of software!  Oppose the CBDTPA!  www.eff.org

More information about the gs-devel mailing list