Commit 1e1688340e381cc77d8325e3cb0d1ed59504b83d

Andreas Pehnack 2012-10-20T11:42:22

[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'.

diff --git a/ChangeLog b/ChangeLog
index d6612c6..2be2972 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-10-20  Andreas Pehnack  <andreas.pehnack@me.com>
+
+	[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  <wl@gnu.org>
 
 	[psaux] Fix some value overflows and improve tracing.
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 2beb57b..16914f2 100644
--- 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;