From 92c8b3f75470422f516ce39ab760a4504e188b6b Mon Sep 17 00:00:00 2001 From: Jens Kutilek Date: Wed, 3 May 2017 11:31:47 +0200 Subject: [PATCH] Add test and test data for mutator with interpolated points --- .../master_ttx_varfont_ttf/Mutator_IUP.ttx | 549 ++++++++++++++++++ .../test_results/Mutator_IUP-instance.ttx | 343 +++++++++++ Tests/varLib/mutator_test.py | 22 + 3 files changed, 914 insertions(+) create mode 100755 Tests/varLib/data/master_ttx_varfont_ttf/Mutator_IUP.ttx create mode 100755 Tests/varLib/data/test_results/Mutator_IUP-instance.ttx diff --git a/Tests/varLib/data/master_ttx_varfont_ttf/Mutator_IUP.ttx b/Tests/varLib/data/master_ttx_varfont_ttf/Mutator_IUP.ttx new file mode 100755 index 000000000..8cbd8a69c --- /dev/null +++ b/Tests/varLib/data/master_ttx_varfont_ttf/Mutator_IUP.ttx @@ -0,0 +1,549 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VarFont + + + Regular + + + VarFont Regular: 2017 + + + VarFont Regular + + + VarFont-Regular + + + Width + + + Ascender + + + Regular + + + VarFont + + + Regular + + + VarFont Regular: 2017 + + + VarFont Regular + + + VarFont-Regular + + + Width + + + Ascender + + + Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wdth + 60.0 + 100.0 + 100.0 + 256 + + + + + ASCN + 608.0 + 608.0 + 648.0 + 257 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/varLib/data/test_results/Mutator_IUP-instance.ttx b/Tests/varLib/data/test_results/Mutator_IUP-instance.ttx new file mode 100755 index 000000000..49bbde242 --- /dev/null +++ b/Tests/varLib/data/test_results/Mutator_IUP-instance.ttx @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VarFont + + + Regular + + + VarFont Regular: 2017 + + + VarFont Regular + + + VarFont-Regular + + + Width + + + Ascender + + + Regular + + + VarFont + + + Regular + + + VarFont Regular: 2017 + + + VarFont Regular + + + VarFont-Regular + + + Width + + + Ascender + + + Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/varLib/mutator_test.py b/Tests/varLib/mutator_test.py index a17eada59..de794f0f7 100644 --- a/Tests/varLib/mutator_test.py +++ b/Tests/varLib/mutator_test.py @@ -117,6 +117,28 @@ class MutatorTest(unittest.TestCase): expected_ttx_path = self.get_test_output(varfont_name + '.ttx') self.expect_ttx(instfont, expected_ttx_path, tables) + def test_varlib_mutator_iup_ttf(self): + suffix = '.ttf' + ufo_dir = self.get_test_input('master_ufo') + ttx_dir = self.get_test_input('master_ttx_varfont_ttf') + + self.temp_dir() + ttx_paths = self.get_file_list(ttx_dir, '.ttx', 'Mutator_IUP') + for path in ttx_paths: + self.compile_font(path, suffix, self.tempdir) + + varfont_name = 'Mutator_IUP' + varfont_path = os.path.join(self.tempdir, varfont_name + suffix) + + args = [varfont_path, 'wdth=80', 'ASCN=628'] + mutator(args) + + instfont_path = os.path.splitext(varfont_path)[0] + '-instance' + suffix + instfont = TTFont(instfont_path) + tables = [table_tag for table_tag in instfont.keys() if table_tag != 'head'] + expected_ttx_path = self.get_test_output(varfont_name + '-instance.ttx') + self.expect_ttx(instfont, expected_ttx_path, tables) + if __name__ == "__main__": sys.exit(unittest.main())