[S_V_G_] fix dumping toXML SVG tables containing colorPalettes
As reported by glukfonts in https://github.com/fonttools/fonttools/issues/1124
This commit is contained in:
parent
5e23b0545b
commit
c42749466a
@ -285,7 +285,7 @@ class table_S_V_G_(DefaultTable.DefaultTable):
|
||||
writer.newline()
|
||||
for uiNameID in self.colorPalettes.colorParamUINameIDs:
|
||||
writer.begintag("colorParamUINameID")
|
||||
writer.writeraw(str(uiNameID))
|
||||
writer._writeraw(str(uiNameID))
|
||||
writer.endtag("colorParamUINameID")
|
||||
writer.newline()
|
||||
for colorPalette in self.colorPalettes.colorPaletteList:
|
||||
@ -343,8 +343,7 @@ class ColorPalettes(object):
|
||||
|
||||
def fromXML(self, name, attrs, content, ttFont):
|
||||
for element in content:
|
||||
element = element.strip()
|
||||
if not element:
|
||||
if not isinstance(element, tuple):
|
||||
continue
|
||||
name, attrib, content = element
|
||||
if name == "colorParamUINameID":
|
||||
@ -353,7 +352,7 @@ class ColorPalettes(object):
|
||||
elif name == "colorPalette":
|
||||
colorPalette = ColorPalette()
|
||||
self.colorPaletteList.append(colorPalette)
|
||||
colorPalette.fromXML((name, attrib, content), ttFont)
|
||||
colorPalette.fromXML(name, attrib, content, ttFont)
|
||||
|
||||
self.numColorParams = len(self.colorParamUINameIDs)
|
||||
self.numColorPalettes = len(self.colorPaletteList)
|
||||
|
Loading…
x
Reference in New Issue
Block a user