From 3c717c786700fc2e0dcbefc4d082a0d026560f50 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 14 Feb 2018 01:19:03 -0800 Subject: [PATCH] [subset] Starting to implement pruning VarStores Part of https://github.com/fonttools/fonttools/issues/1179 --- Lib/fontTools/subset/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py index 4386cbdcb..8edc3c70b 100644 --- a/Lib/fontTools/subset/__init__.py +++ b/Lib/fontTools/subset/__init__.py @@ -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: