From adf6a67a7ac24a7fea34a3a41bde1f232728a5c9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 17 Aug 2022 14:16:45 -0600 Subject: [PATCH] [scale-upem] Add docstring --- Snippets/scale-upem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Snippets/scale-upem.py b/Snippets/scale-upem.py index 5cad000dc..b26014172 100644 --- a/Snippets/scale-upem.py +++ b/Snippets/scale-upem.py @@ -1,3 +1,9 @@ +"""Change the units-per-EM of a font. + +Currently does not support CFF fonts. AAT, Graphite, or color tables are +not supported either.""" + + from fontTools.ttLib.ttVisitor import TTVisitor import fontTools.ttLib as ttLib import fontTools.ttLib.tables.otBase as otBase @@ -143,7 +149,7 @@ if __name__ == "__main__": font = TTFont(sys.argv[1]) new_upem = int(sys.argv[2]) - if 'CFF ' in font or 'CFF2' in font: + if "CFF " in font or "CFF2" in font: print("scale-upem: CFF/CFF2 fonts are not supported.", file=sys.stderr) sys.exit(1)