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

chrisl at ghostscript.com chrisl at ghostscript.com
Fri Mar 25 10:22:06 UTC 2011


Author: chrisl
Date: 2011-03-25 10:22:06 +0000 (Fri, 25 Mar 2011)
New Revision: 12309

Modified:
   trunk/gs/psi/zfapi.c
Log:
The code was erroneously attempting to get a glyph name for a case where
we already had a glyph index for a Truetype font.

Add a check for object type before trying to get a string from a name object.


Bug 692095

No cluster differences expected.



Modified: trunk/gs/psi/zfapi.c
===================================================================
--- trunk/gs/psi/zfapi.c	2011-03-24 17:26:17 UTC (rev 12308)
+++ trunk/gs/psi/zfapi.c	2011-03-25 10:22:06 UTC (rev 12309)
@@ -2446,7 +2446,12 @@
 #endif
 
     /* Provide glyph data for renderer : */
-    if (!I->ff.is_cid) {
+    /* Occasionally, char_name is already a glyph index to pass to the rendering engine
+     * so don't treat it as a name object.
+     * I believe this will only happen with a TTF/Type42, but checking the object type
+     * is cheap, and covers all font type eventualities.
+     */
+    if (!I->ff.is_cid && r_has_type(&char_name, t_name)) {
         ref sname;
         name_string_ref(imemory, &char_name, &sname);
         I->ff.char_data = sname.value.const_bytes;



More information about the gs-commits mailing list