From 7ca97d6d7f68dfc542b45864a990d5ef8377f6b2 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 19 Oct 2023 11:20:48 +0100 Subject: [PATCH] [subset_test] added NotoSansCJKjp subset to test east-asian-width feature are kept by defailt --- .../data/NotoSansCJKjp-Regular.subset.ttx | 417 ++++++++++++++++++ Tests/subset/subset_test.py | 20 + 2 files changed, 437 insertions(+) create mode 100644 Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx diff --git a/Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx b/Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx new file mode 100644 index 000000000..4dfc0b23c --- /dev/null +++ b/Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + © 2014-2021 Adobe (http://www.adobe.com/). + + + Noto Sans CJK JP + + + Regular + + + 2.004;GOOG;NotoSansCJKjp-Regular;ADOBE + + + Noto Sans CJK JP + + + Version 2.004;hotconv 1.0.118;makeotfexe 2.5.65603 + + + NotoSansCJKjp-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + endchar + + + -86 932 hstem + 588 360 vstem + 948 -57 rmoveto + -280 437 280 437 -63 29 -297 -466 297 -466 rlineto + endchar + + + -68 360 hstem + 34 932 vstem + 63 -68 rmoveto + 437 280 437 -280 29 63 -466 297 -466 -297 rlineto + endchar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/subset/subset_test.py b/Tests/subset/subset_test.py index f94fdfb07..2b57633c2 100644 --- a/Tests/subset/subset_test.py +++ b/Tests/subset/subset_test.py @@ -1074,6 +1074,26 @@ class SubsetTest: in caplog.text ) ^ ok + def test_retain_east_asian_spacing_features(self): + # This test font contains halt and vhal features, check that + # they are retained by default after subsetting. + ttx_path = self.getpath("NotoSansCJKjp-Regular.subset.ttx") + ttx = pathlib.Path(ttx_path).read_text() + assert 'FeatureTag value="halt"' in ttx + assert 'FeatureTag value="vhal"' in ttx + + fontpath = self.compile_font(ttx_path, ".otf") + subsetpath = self.temp_path(".otf") + subset.main( + [ + fontpath, + "--unicodes=*", + "--output-file=%s" % subsetpath, + ] + ) + # subset output is the same as the input + self.expect_ttx(TTFont(subsetpath), ttx_path) + @pytest.fixture def featureVarsTestFont():