From 32874cb3723b86ba2bdb67ddcd474ddb52943a89 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 2 Dec 2021 18:01:24 +0000 Subject: [PATCH] subset/COLR: add reproducer for issue #2461 this currently fails with struct.error. Fix will ensue shortly --- Tests/subset/data/BungeeColor-Regular.ttx | 438 ++++++++++++++++++++++ Tests/subset/subset_test.py | 21 ++ 2 files changed, 459 insertions(+) create mode 100644 Tests/subset/data/BungeeColor-Regular.ttx diff --git a/Tests/subset/data/BungeeColor-Regular.ttx b/Tests/subset/data/BungeeColor-Regular.ttx new file mode 100644 index 000000000..d14c89224 --- /dev/null +++ b/Tests/subset/data/BungeeColor-Regular.ttx @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Copyright 2008 The Bungee Project Authors (david@djr.com) + + + Bungee Color Regular + + + Regular + + + 1.000;djr ;BungeeColor-Regular + + + Bungee Color Regular Regular + + + Version 1.000;PS 1.0;hotconv 1.0.72;makeotf.lib2.5.5900 + + + BungeeColor-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/subset/subset_test.py b/Tests/subset/subset_test.py index d8f4dac0c..d1afb296f 100644 --- a/Tests/subset/subset_test.py +++ b/Tests/subset/subset_test.py @@ -1352,5 +1352,26 @@ def test_subset_svg_missing_lxml(ttf_path): subset.main([str(ttf_path), "--gids=0,1"]) +def test_subset_COLR_glyph_closure(tmp_path): + font = TTFont() + ttx = pathlib.Path(__file__).parent / "data" / "BungeeColor-Regular.ttx" + font.importXML(ttx) + font_path = tmp_path / "BungeeColor-Regular.ttf" + subset_path = font_path.with_suffix(".subset.ttf)") + font.save(font_path) + + subset.main( + [ + str(font_path), + "--glyph-names", + f"--output-file={subset_path}", + "--glyphs=Agrave", + ] + ) + subset_font = TTFont(subset_path) + # TODO + + + if __name__ == "__main__": sys.exit(unittest.main())