| 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 | |
| 129 | meshStrikeHeaderFormat = """ |