[gvar] Take glyphs from gvar.variations

When compiling the set of shared coordinates, walk over glyphs in
self.variations instead of retrieving them in glyph order.

This addresses a code review comment:
0f86c1c0d3 (commitcomment-11375190)
This commit is contained in:
Sascha Brawer 2015-06-01 11:02:41 +02:00
parent 1447730438
commit 5ba59b3f4b

View File

@ -86,9 +86,8 @@ class table__g_v_a_r(DefaultTable.DefaultTable):
def compileSharedCoords_(self, ttFont, axisTags): def compileSharedCoords_(self, ttFont, axisTags):
coordCount = {} coordCount = {}
for glyph in ttFont.getGlyphOrder(): for glyph, variations in self.variations.items():
if glyph in self.variations: for gvar in variations:
for gvar in self.variations[glyph]:
coord = gvar.compileCoord(axisTags) coord = gvar.compileCoord(axisTags)
coordCount[coord] = coordCount.get(coord, 0) + 1 coordCount[coord] = coordCount.get(coord, 0) + 1
sharedCoords = [(count, coord) for (coord, count) in coordCount.items() if count > 1] sharedCoords = [(count, coord) for (coord, count) in coordCount.items() if count > 1]