Pad graphicType if len() < 4
This commit is contained in:
parent
5d004eb936
commit
035008bded
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user