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

Method compile

ST2/meshtable.py:77–87  ·  view source on GitHub ↗
(self, ttFont)

Source from the content-addressed store, hash-verified

75 del self.gid
76
77 def compile(self, ttFont):
78 if self.glyphName is None:
79 from fontTools import ttLib
80 raise ttLib.TTLibError("Can't compile Glyph without glyph name")
81 # TODO: if ttFont has no maxp, cmap etc., ignore glyph names and compile by index?
82 # (needed if you just want to compile the mesh table on its own)
83 self.gid = struct.pack(">H", ttFont.getGlyphID(self.glyphName))
84 if self.graphicType is None:
85 self.rawdata = b""
86 else:
87 self.rawdata = sstruct.pack(meshGlyphHeaderFormat, self) + self.meshData
88
89 def toXML(self, xmlWriter, ttFont):
90 if self.graphicType == None:

Callers 4

compileMethod · 0.95
fromXMLMethod · 0.95
has_keyframesMethod · 0.45
compileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected