shithub: freetype+ttf2subf

Download patch

ref: 3a1df3e18857b1b2f7880525e5bf5167b9807186
parent: 93a884c6cdb4477ba14ec34cadcf5e137a3c7eff
author: Werner Lemberg <[email protected]>
date: Thu Feb 19 10:42:48 EST 2015

* src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'.

This is hard-coded to value 2 in `fvar' version 1.0 (and no newer
version exists), but some fonts set it incorrectly.

Problem reported by Adam Twardoch <[email protected]>.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2015-02-19  Werner Lemberg  <[email protected]>
 
+	* src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'.
+
+	This is hard-coded to value 2 in `fvar' version 1.0 (and no newer
+	version exists), but some fonts set it incorrectly.
+
+	Problem reported by Adam Twardoch <[email protected]>.
+
+2015-02-19  Werner Lemberg  <[email protected]>
+
 	[cff] Emit better error code for invalid private dict size.
 
 	* src/cff/cffparse.c (cff_parse_private_dict): Reject negative
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -673,7 +673,12 @@
         goto Exit;
 
       if ( fvar_head.version != (FT_Long)0x00010000L                      ||
+#if 0
+           /* fonts like `JamRegular.ttf' have an incorrect value for */
+           /* `countSizePairs'; since value 2 is hard-coded in `fvar' */
+           /* version 1.0, we simply ignore it                        */
            fvar_head.countSizePairs != 2                                  ||
+#endif
            fvar_head.axisSize != 20                                       ||
            /* axisCount limit implied by 16-bit instanceSize */
            fvar_head.axisCount > 0x3FFE                                   ||