Commit 624b6802890bff686c60f289217444e4c98c62c5

Werner Lemberg 2017-01-03T09:42:41

[sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid. These tables are optional. * src/sfnt/sfobjs.c (sfnt_load_face): Implement it.

diff --git a/ChangeLog b/ChangeLog
index fef7c1e..780714f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2017-01-03  Werner Lemberg  <wl@gnu.org>
 
+	[sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid.
+
+	These tables are optional.
+
+	* src/sfnt/sfobjs.c (sfnt_load_face): Implement it.
+
+2017-01-03  Werner Lemberg  <wl@gnu.org>
+
 	* src/cff/cffparse.c (cff_parse_num): Simplify.
 
 2017-01-03  Werner Lemberg  <wl@gnu.org>
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 5e7380b..b37f144 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1262,30 +1262,10 @@
 
     /* embedded bitmap support */
     if ( sfnt->load_eblc )
-    {
       LOAD_( eblc );
-      if ( error )
-      {
-        /* a font which contains neither bitmaps nor outlines is */
-        /* still valid (although rather useless in most cases);  */
-        /* however, you can find such stripped fonts in PDFs     */
-        if ( FT_ERR_EQ( error, Table_Missing ) )
-          error = FT_Err_Ok;
-        else
-          goto Exit;
-      }
-    }
 
+    /* consider the pclt, kerning, and gasp tables as optional */
     LOAD_( pclt );
-    if ( error )
-    {
-      if ( FT_ERR_NEQ( error, Table_Missing ) )
-        goto Exit;
-
-      face->pclt.Version = 0;
-    }
-
-    /* consider the kerning and gasp tables as optional */
     LOAD_( gasp );
     LOAD_( kern );