diff --git a/Lib/fontTools/ttLib/ttGlyphSet.py b/Lib/fontTools/ttLib/ttGlyphSet.py index c729f85ee..27903c245 100644 --- a/Lib/fontTools/ttLib/ttGlyphSet.py +++ b/Lib/fontTools/ttLib/ttGlyphSet.py @@ -205,13 +205,14 @@ class _TTVarGlyphCFF(_TTVarGlyph): self._glyph.draw(pen, blender) self.width = self._ttFont['hmtx'][self._glyphName][0] - hvar = self._ttFont['HVAR'].table - varidx = self._ttFont.getGlyphID(self._glyphName) - if hvar.AdvWidthMap is not None: - varidx = hvar.AdvWidthMap.mapping[self._glyphName] - vsInstancer = VarStoreInstancer(hvar.VarStore, self._ttFont['fvar'].axes, self._location) - delta = vsInstancer[varidx] - self.width += otRound(delta) + if 'HVAR' in self._ttFont: + hvar = self._ttFont['HVAR'].table + varidx = self._ttFont.getGlyphID(self._glyphName) + if hvar.AdvWidthMap is not None: + varidx = hvar.AdvWidthMap.mapping[self._glyphName] + vsInstancer = VarStoreInstancer(hvar.VarStore, self._ttFont['fvar'].axes, self._location) + delta = vsInstancer[varidx] + self.width += otRound(delta) class _TTVarGlyphGlyf(_TTVarGlyph):