8
def __init__(self, tag):
11
def decompile(self, data, ttFont):
14
def compile(self, ttFont):
17
def toXML(self, writer, ttFont):
18
if hasattr(self, "ERROR"):
19
writer.comment("An error occurred during the decompilation of this table")
21
writer.comment(self.ERROR)
23
writer.begintag("hexdata")
25
writer.dumphex(self.compile(ttFont))
26
writer.endtag("hexdata")
29
def fromXML(self, (name, attrs, content), ttFont):
30
from fontTools.misc.textTools import readHex
31
from fontTools import ttLib
33
raise ttLib.TTLibError, "can't handle '%s' element" % name
34
self.decompile(readHex(content), ttFont)
37
return "<'%s' table at %x>" % (self.tableTag, id(self))
39
def __cmp__(self, other):
40
return cmp(self.__dict__, other.__dict__)