[subset] fixed VVAR subset failing with --retain-gids

Fixes https://github.com/fonttools/fonttools/issues/1552
This commit is contained in:
Cosimo Lupo 2019-04-08 17:28:05 +01:00
parent b327287f97
commit 0cf54802c5
No known key found for this signature in database
GPG Key ID: 20D4A261E4A0E642

View File

@ -1833,18 +1833,22 @@ def subset_glyphs(self, s):
used = set()
if table.AdvHeightMap:
if not s.options.retain_gids:
table.AdvHeightMap.mapping = _dict_subset(table.AdvHeightMap.mapping, s.glyphs)
used.update(table.AdvHeightMap.mapping.values())
else:
assert table.TsbMap is None and table.BsbMap is None and table.VOrgMap is None, "File a bug."
used.update(s.reverseOrigGlyphMap.values())
if table.TsbMap:
if not s.options.retain_gids:
table.TsbMap.mapping = _dict_subset(table.TsbMap.mapping, s.glyphs)
used.update(table.TsbMap.mapping.values())
if table.BsbMap:
if not s.options.retain_gids:
table.BsbMap.mapping = _dict_subset(table.BsbMap.mapping, s.glyphs)
used.update(table.BsbMap.mapping.values())
if table.VOrgMap:
if not s.options.retain_gids:
table.VOrgMap.mapping = _dict_subset(table.VOrgMap.mapping, s.glyphs)
used.update(table.VOrgMap.mapping.values())