shithub: freetype+ttf2subf

Download patch

ref: 1e1688340e381cc77d8325e3cb0d1ed59504b83d
parent: eaf0afb4c75e18d323b7b762ac0c5dd0a8e5202c
author: Andreas Pehnack <[email protected]>
date: Sat Oct 20 07:42:22 EDT 2012

[sfnt] Load pure CFF fonts wrapped in SFNT container.

Such fonts only have a `cmap' and a `CFF' table.

* src/sfnt/ttload.c (tt_face_load_font_dir): Don't call
`check_table_dir' if font signature is `OTTO'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-10-20  Andreas Pehnack  <[email protected]>
+
+	[sfnt] Load pure CFF fonts wrapped in SFNT container.
+
+	Such fonts only have a `cmap' and a `CFF' table.
+
+	* src/sfnt/ttload.c (tt_face_load_font_dir): Don't call
+	`check_table_dir' if font signature is `OTTO'.
+
 2012-10-20  Werner Lemberg  <[email protected]>
 
 	[psaux] Fix some value overflows and improve tracing.
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -361,14 +361,17 @@
     FT_TRACE2(( "-- Number of tables: %10u\n",    sfnt.num_tables ));
     FT_TRACE2(( "-- Format version:   0x%08lx\n", sfnt.format_tag ));
 
-    /* check first */
-    error = check_table_dir( &sfnt, stream );
-    if ( error )
+    if ( sfnt.format_tag != TTAG_OTTO )
     {
-      FT_TRACE2(( "tt_face_load_font_dir:"
-                  " invalid table directory for TrueType\n" ));
+      /* check first */
+      error = check_table_dir( &sfnt, stream );
+      if ( error )
+      {
+        FT_TRACE2(( "tt_face_load_font_dir:"
+                    " invalid table directory for TrueType\n" ));
 
-      goto Exit;
+        goto Exit;
+      }
     }
 
     face->num_tables = sfnt.num_tables;