[ttVarGlyphSet-CFF] Handle font without advance variation
This commit is contained in:
parent
a949380b4a
commit
f5a1d0ba10
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user