Skip to content

Commit

Permalink
Normalize public.markColor during lib normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelsousa committed Oct 27, 2015
1 parent 469e4e3 commit faf4c01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion normalization/data/glif/format2.glif
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<key>com.letterror.somestuff</key>
<string>arbitrary custom data!</string>
<key>public.markColor</key>
<string>1.0,0.0,0,0.5</string>
<string>1,0,0,0.5</string>
</dict>
</lib>
<note>
Expand Down
15 changes: 7 additions & 8 deletions normalization/ufonormalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def normalizeGLIF(ufoPath, *subpath):
... <key>com.letterror.somestuff</key>
... <string>arbitrary custom data!</string>
... <key>public.markColor</key>
... <string>1.0,0.0,0,0.5</string>
... <string>1,0,0,0.5</string>
... </dict>
... </lib>
... <note>
Expand Down Expand Up @@ -859,13 +859,6 @@ def normalizeGLIF(ufoPath, *subpath):
elif tag == "lib":
lib = element
imageFileName = None
# normalize the mark color
if lib is not None:
if "public.markColor" in lib:
color = lib.pop("public.markColor")
color = _normalizeColorString(color)
if color is not None:
lib["public.markColor"] = color
# write the data
writer.beginElement("glyph", attrs=dict(name=name, format=glifVersion))
for uni in unicodes:
Expand Down Expand Up @@ -1332,6 +1325,12 @@ def _normalizeGlifLib(element, writer):
return
obj = _convertPlistElementToObject(element[0])
if obj:
# normalize the mark color
if "public.markColor" in obj:
color = obj.pop("public.markColor")
color = _normalizeColorString(color)
if color is not None:
obj["public.markColor"] = color
writer.beginElement("lib")
writer.propertyListObject(obj)
writer.endElement("lib")
Expand Down

0 comments on commit faf4c01

Please sign in to comment.