shithub: freetype+ttf2subf

Download patch

ref: 79c23ae28a09255dbb10033e5eca6e2b6c86fcf0
parent: 146ff279b4cdb6af0d6eedaf42ab3dbda848fad5
author: David Turner <[email protected]>
date: Wed Jan 22 17:53:55 EST 2003

* src/sfnt/ttload.c (sfnt_dir_check): relaxed the "head" table size
    verification to accept a few broken fonts who pad the size incorrectly
    (the table should be padded, but its "size" field shouldn't per se
     the spec)

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
       adding a new API, named FT_Get_BDF_Property to retrieve the BDF
       properties of a given PCF or BDF font
 
+    * src/sfnt/ttload.c (sfnt_dir_check): relaxed the "head" table size
+    verification to accept a few broken fonts who pad the size incorrectly
+    (the table should be padded, but its "size" field shouldn't per se
+     the spec)
 
 2003-01-18  Werner Lemberg  <[email protected]>
 
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -213,7 +213,14 @@
 
         has_head = 1;
 
-        if ( table.Length != 0x36                ||
+       /* the table length should be 0x36, but certain font tools
+        * make it 0x38, so we will just check that it is greater.
+        *
+        * note that according to the specification,
+        * the table must be padded to 32-bit lengths, but this doesn't
+        * apply to the value of its "Length" field !!
+        */
+        if ( table.Length < 0x36                 ||
              FT_STREAM_SEEK( table.Offset + 12 ) ||
              FT_READ_ULONG( magic )              ||
              magic != 0x5F0F3CF5UL               )