MCPcopy Create free account
hub / github.com/coldtype/st2 / fromXML

Method fromXML

ST2/meshtable.py:116–126  ·  view source on GitHub ↗
(self, name, attrs, content, ttFont)

Source from the content-addressed store, hash-verified

114 xmlWriter.newline()
115
116 def fromXML(self, name, attrs, content, ttFont):
117 if name == "ref":
118 # glyph is a "dupe", i.e. a reference to another glyph's image data.
119 # in this case meshData contains the glyph id of the reference glyph
120 # get glyph id from glyphname
121 self.meshData = struct.pack(">H", ttFont.getGlyphID(safeEval("'''" + attrs["glyphname"] + "'''")))
122 elif name == "hexdata":
123 self.meshData = readHex(content)
124 else:
125 from fontTools import ttLib
126 raise ttLib.TTLibError("can't handle '%s' element" % name)
127
128
129meshStrikeHeaderFormat = """

Callers 1

fromXMLMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected