From 38a0ffb8154537ea2f5c8b93f2e0e1de749a9643 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 Feb 2018 17:42:49 -0800 Subject: [PATCH] Accept old version of HVAR XML https://github.com/fonttools/fonttools/commit/21cbab8ce9ded3356fef3745122da64dcaf314e9#commitcomment-27649836 --- Lib/fontTools/ttLib/tables/otTables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index 34ed64b42..0dc75aa9d 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -610,7 +610,10 @@ class VarIdxMap(BaseTable): if mapping is None: mapping = {} self.mapping = mapping - glyph = attrs['glyph'] + try: + glyph = attrs['glyph'] + except: # https://github.com/fonttools/fonttools/commit/21cbab8ce9ded3356fef3745122da64dcaf314e9#commitcomment-27649836 + glyph = font.getGlyphOrder()[attrs['index']] outer = safeEval(attrs['outer']) inner = safeEval(attrs['inner']) assert inner <= 0xFFFF