Commit 6c98cc3e7cf2270bb5087f5cac47589e6bd194ea

Werner Lemberg 2003-12-12T07:59:16

* src/cff/cffobjs.c (cff_face_init): Don't set FT_FACE_FLAG_GLYPH_NAMES for CID-keyed fonts. Don't construct a cmap for CID-keyed fonts.

diff --git a/ChangeLog b/ChangeLog
index 97c19ae..8133b07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-11  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffobjs.c (cff_face_init): Don't set
+	FT_FACE_FLAG_GLYPH_NAMES for CID-keyed fonts.
+	Don't construct a cmap for CID-keyed fonts.
+
 2003-12-10  Werner Lemberg  <wl@gnu.org>
 
 	Use implementation specific SID value 0xFFFF to indicate that
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 8c4f07e..45b5830 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -484,7 +484,9 @@
 #endif
 
 #ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
-        flags |= FT_FACE_FLAG_GLYPH_NAMES;
+        /* CID-keyed CFF fonts don't have glyph names */
+        if ( dict->cid_registry == 0xFFFFU )
+          flags |= FT_FACE_FLAG_GLYPH_NAMES;
 #endif
 
         root->face_flags = flags;
@@ -541,7 +543,12 @@
             goto Skip_Unicode; /* Standard Unicode (deprecated) */
         }
 
-        /* we didn't find a Unicode charmap, synthetize one */
+        /* since CID-keyed fonts don't contain glyph names, we can't */
+        /* construct a cmap                                          */
+        if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
+          goto Exit;
+
+        /* we didn't find a Unicode charmap -- synthetize one */
         cmaprec.face        = root;
         cmaprec.platform_id = 3;
         cmaprec.encoding_id = 1;