From 3a1df3e18857b1b2f7880525e5bf5167b9807186 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 19 Feb 2015 15:42:48 +0100 Subject: [PATCH] * 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 . --- ChangeLog | 9 +++++++++ src/truetype/ttgxvar.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index df93a20cd..f1d36690a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-02-19 Werner Lemberg + + * 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 . + 2015-02-19 Werner Lemberg [cff] Emit better error code for invalid private dict size. diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 27fae10b5..93b16a08e 100644 --- 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 ||