From 035008bded080b646526643d71fdf8dee29739e2 Mon Sep 17 00:00:00 2001 From: Jens Kutilek Date: Wed, 24 Sep 2014 12:21:33 +0200 Subject: [PATCH] Pad graphicType if len() < 4 --- Lib/fontTools/ttLib/tables/sbixStrike.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/fontTools/ttLib/tables/sbixStrike.py b/Lib/fontTools/ttLib/tables/sbixStrike.py index dedc01f1b..3f5959d1d 100644 --- a/Lib/fontTools/ttLib/tables/sbixStrike.py +++ b/Lib/fontTools/ttLib/tables/sbixStrike.py @@ -116,6 +116,12 @@ class Strike(object): elif name == "glyph": if "graphicType" in attrs: myFormat = attrs["graphicType"] + if len(myFormat) > 4: + from fontTools import ttLib + raise ttLib.TTLibError("graphicType must not be longer than 4 characters.") + elif len(myFormat) < 4: + # pad with spaces + myFormat += " " * (4 - len(myFormat)) else: myFormat = None if "glyphname" in attrs: