From aef41419f234a23b2a2482afe7efcb79fa07ae81 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 3 Apr 2019 10:53:25 +0100 Subject: [PATCH] gvar: log the glyph name if any exception is caught when decompiling deltas --- Lib/fontTools/ttLib/tables/_g_v_a_r.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/_g_v_a_r.py b/Lib/fontTools/ttLib/tables/_g_v_a_r.py index 608b6a2d9..f9c9e5286 100644 --- a/Lib/fontTools/ttLib/tables/_g_v_a_r.py +++ b/Lib/fontTools/ttLib/tables/_g_v_a_r.py @@ -107,8 +107,15 @@ class table__g_v_a_r(DefaultTable.DefaultTable): glyph = ttFont["glyf"][glyphName] numPointsInGlyph = self.getNumPoints_(glyph) gvarData = data[offsetToData + offsets[i] : offsetToData + offsets[i + 1]] - self.variations[glyphName] = decompileGlyph_( - numPointsInGlyph, sharedCoords, axisTags, gvarData) + try: + self.variations[glyphName] = decompileGlyph_( + numPointsInGlyph, sharedCoords, axisTags, gvarData) + except Exception: + log.error( + "Failed to decompile deltas for glyph '%s' (%d points)", + glyphName, numPointsInGlyph, + ) + raise @staticmethod def decompileOffsets_(data, tableFormat, glyphCount):