Pad graphicType if len() < 4

This commit is contained in:
Jens Kutilek 2014-09-24 12:21:33 +02:00 committed by Behdad Esfahbod
parent 5d004eb936
commit 035008bded

View File

@ -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: