shithub: freetype+ttf2subf

Download patch

ref: b897e4c9c10b669ab29b57bf5688f949bf76213d
parent: af4a4fdd30ee57bfa4e0279e276af0d71ff09f2d
author: Werner Lemberg <[email protected]>
date: Tue Dec 28 02:49:15 EST 2004

* src/cff/cffobjs.c (cff_face_init): A CFF within an SFNT can have
only a single font.  This is undocumented but has been verified on
the opentype list.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-27  Werner Lemberg  <[email protected]>
+
+	* src/cff/cffobjs.c (cff_face_init): A CFF within an SFNT can have
+	only a single font.  This is undocumented but has been verified on
+	the opentype list.
+
 2004-12-26  Werner Lemberg  <[email protected]>
 
 	* Jamfile (FT2_COMPONENTS): Add `otvalid'.
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -367,6 +367,7 @@
     FT_Bool             pure_cff    = 1;
     FT_Bool             sfnt_format = 0;
 
+
 #if 0
     FT_FACE_FIND_GLOBAL_SERVICE( face, sfnt,     SFNT );
     FT_FACE_FIND_GLOBAL_SERVICE( face, psnames,  POSTSCRIPT_NAMES );
@@ -403,6 +404,14 @@
       /* if we are performing a simple font format check, exit immediately */
       if ( face_index < 0 )
         return CFF_Err_Ok;
+
+      /* UNDOCUMENTED!  A CFF in an SFNT can have only a single font. */
+      if ( face_index > 0 )
+      {
+        FT_ERROR(( "cff_face_init: invalid face index\n" ));
+        error = CFF_Err_Invalid_Argument;
+        goto Exit;
+      }
 
       sfnt_format = 1;