shithub: freetype+ttf2subf

Download patch

ref: 6c98cc3e7cf2270bb5087f5cac47589e6bd194ea
parent: 9b067facf1e2ffc011591752a055fbc70b62d6f6
author: Werner Lemberg <[email protected]>
date: Fri Dec 12 02:59:16 EST 2003

* 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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-11  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	Use implementation specific SID value 0xFFFF to indicate that
--- 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;