shithub: freetype+ttf2subf

Download patch

ref: 713d68ee9f47cc8df56e47fa2f54b191bb8c3186
parent: 9fbd0041ca1e3cd96ebd9e3ee1cf8797251198ed
author: Werner Lemberg <[email protected]>
date: Sat Feb 17 13:35:15 EST 2018

[sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-02-17  Werner Lemberg  <[email protected]>
+
+	[sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).
+
 2018-02-06  Werner Lemberg  <[email protected]>
 
 	[truetype] Integer overflow issues.
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1144,6 +1144,8 @@
     FT_Bool       has_outline;
     FT_Bool       is_apple_sbit;
     FT_Bool       is_apple_sbix;
+    FT_Bool       has_CBLC;
+    FT_Bool       has_CBDT;
     FT_Bool       ignore_typographic_family    = FALSE;
     FT_Bool       ignore_typographic_subfamily = FALSE;
 
@@ -1223,6 +1225,13 @@
       if ( error )
         goto Exit;
     }
+
+    has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
+    has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
+
+    /* Ignore outlines for CBLC/CBDT fonts. */
+    if ( has_CBLC || has_CBDT )
+      has_outline = FALSE;
 
     /* OpenType 1.8.2 introduced limits to this value;    */
     /* however, they make sense for older SFNT fonts also */