Merge pull request #1903 from anthrotype/remove-feature-variations
subset: remove FeatureVariations, downgrade GSUB/GPOS to version 1 when empty
This commit is contained in:
commit
fc10f74a19
@ -1631,11 +1631,11 @@ def prune_post_subset(self, font, options):
|
||||
#if table.ScriptList and not table.ScriptList.ScriptRecord:
|
||||
# table.ScriptList = None
|
||||
|
||||
if not table.FeatureList and hasattr(table, 'FeatureVariations'):
|
||||
if hasattr(table, 'FeatureVariations'):
|
||||
if not (table.FeatureList and table.FeatureVariations.FeatureVariationRecord):
|
||||
table.FeatureVariations = None
|
||||
|
||||
if hasattr(table, 'FeatureVariations') and not table.FeatureVariations:
|
||||
if table.Version == 0x00010001:
|
||||
if not table.FeatureVariations and table.Version == 0x00010001:
|
||||
table.Version = 0x00010000
|
||||
|
||||
return True
|
||||
|
@ -793,7 +793,8 @@ def test_subset_feature_variations_drop_all(featureVarsTestFont):
|
||||
assert "rvrn" not in featureTags
|
||||
assert glyphs == {".notdef", "f", "dollar"}
|
||||
# all FeatureVariationRecords were dropped
|
||||
assert not font["GSUB"].table.FeatureVariations.FeatureVariationRecord
|
||||
assert font["GSUB"].table.FeatureVariations is None
|
||||
assert font["GSUB"].table.Version == 0x00010000
|
||||
|
||||
|
||||
# TODO test_subset_feature_variations_drop_from_end_empty_records
|
||||
|
Loading…
x
Reference in New Issue
Block a user