From 299320d0b114875af0120ea92fc38bb4efa4fb4b Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 23 May 2018 11:50:40 +0100 Subject: [PATCH] Snippets/layout-features.py: allow to load from ttx file --- Snippets/layout-features.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Snippets/layout-features.py b/Snippets/layout-features.py index 5e6074e8e..25522cda0 100755 --- a/Snippets/layout-features.py +++ b/Snippets/layout-features.py @@ -10,7 +10,11 @@ if len(sys.argv) != 2: print("usage: layout-features.py fontfile.ttf") sys.exit(1) fontfile = sys.argv[1] -font = TTFont(fontfile) +if fontfile.rsplit(".", 1)[-1] == "ttx": + font = TTFont() + font.importXML(fontfile) +else: + font = TTFont(fontfile) for tag in ('GSUB', 'GPOS'): if not tag in font: continue