diff --git a/Tests/subset/data/Andika-Regular.subset.ttx b/Tests/subset/data/Andika-Regular.subset.ttx new file mode 100644 index 000000000..8fd28a7a9 --- /dev/null +++ b/Tests/subset/data/Andika-Regular.subset.ttx @@ -0,0 +1,733 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright (c) 2004-2022 SIL International + + + Andika + + + Regular + + + SIL International: Andika Regular: 2022 + + + Andika + + + Version 6.101 + + + Andika + + + Capital Eng + + + Alternate forms of capital Eng + + + Ŋ + + + Lowercase no descender + + + Capital form + + + Lowercase short stem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/subset/subset_test.py b/Tests/subset/subset_test.py index abb82687e..8fdee83b4 100644 --- a/Tests/subset/subset_test.py +++ b/Tests/subset/subset_test.py @@ -2071,5 +2071,28 @@ def test_prune_unused_user_name_IDs_with_keep_all(ttf_path): assert nameIDs == keepNameIDs +def test_cvXX_feature_params_nameIDs_are_retained(): + # https://github.com/fonttools/fonttools/issues/3616 + font = TTFont() + ttx = pathlib.Path(__file__).parent / "data" / "Andika-Regular.subset.ttx" + font.importXML(ttx) + + keepNameIDs = {n.nameID for n in font["name"].names} + + options = subset.Options() + options.glyph_names = True + # that's where the FeatureParamsCharacteVariants are stored + options.layout_features.append("cv43") + + subsetter = subset.Subsetter(options) + subsetter.populate(glyphs=font.getGlyphOrder()) + subsetter.subset(font) + + # we expect that all nameIDs are retained, including all the nameIDs + # used by the FeatureParamsCharacterVariants + nameIDs = {n.nameID for n in font["name"].names} + assert nameIDs == keepNameIDs + + if __name__ == "__main__": sys.exit(unittest.main())