[subset] Starting to implement pruning VarStores

Part of https://github.com/fonttools/fonttools/issues/1179
This commit is contained in:
Behdad Esfahbod 2018-02-14 01:19:03 -08:00
parent 2d57c87a67
commit 3c717c7867

View File

@ -1633,8 +1633,12 @@ def prune_post_subset(self, options):
table.GlyphClassDef = None
if table.AttachList and not table.AttachList.GlyphCount:
table.AttachList = None
if (hasattr(table, "MarkGlyphSetsDef") and
table.MarkGlyphSetsDef and
if hasattr(table, "VarStore"):
if table.VarStore.VarDataCount == 0:
if table.Version == 0x00010003:
table.Version = 0x00010002
if (not hasattr(table, "MarkGlyphSetsDef") or
not table.MarkGlyphSetsDef or
not table.MarkGlyphSetsDef.Coverage):
table.MarkGlyphSetsDef = None
if table.Version == 0x00010002: