use composition rather than inheritance; \
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@188 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
48e4b6254e
commit
2a9c630193
@ -2,17 +2,17 @@ import DefaultTable
|
||||
from fontTools import cffLib
|
||||
|
||||
|
||||
class table_C_F_F_(DefaultTable.DefaultTable, cffLib.CFFFontSet):
|
||||
class table_C_F_F_(DefaultTable.DefaultTable):
|
||||
|
||||
def __init__(self, tag):
|
||||
DefaultTable.DefaultTable.__init__(self, tag)
|
||||
cffLib.CFFFontSet.__init__(self)
|
||||
self.cff = cffLib.CFFFontSet()
|
||||
self._gaveGlyphOrder = 0
|
||||
|
||||
def decompile(self, data, otFont):
|
||||
self.data = data # XXX while work is in progress...
|
||||
cffLib.CFFFontSet.decompile(self, data)
|
||||
assert len(self.fonts) == 1, "can't deal with multi-font CFF tables."
|
||||
self.cff.decompile(data)
|
||||
assert len(self.cff.fonts) == 1, "can't deal with multi-font CFF tables."
|
||||
|
||||
#def compile(self, otFont):
|
||||
# xxx
|
||||
@ -22,13 +22,17 @@ class table_C_F_F_(DefaultTable.DefaultTable, cffLib.CFFFontSet):
|
||||
from fontTools import ttLib
|
||||
raise ttLib.TTLibError, "illegal use of getGlyphOrder()"
|
||||
self._gaveGlyphOrder = 1
|
||||
return self.fonts[self.fontNames[0]].getGlyphOrder()
|
||||
return self.cff.fonts[self.cff.fontNames[0]].getGlyphOrder()
|
||||
|
||||
def setGlyphOrder(self, glyphOrder):
|
||||
self.fonts[self.fontNames[0]].setGlyphOrder(glyphOrder)
|
||||
self.cff.fonts[self.cff.fontNames[0]].setGlyphOrder(glyphOrder)
|
||||
|
||||
def toXML(self, writer, otFont, progress=None):
|
||||
cffLib.CFFFontSet.toXML(self, writer, progress)
|
||||
if "disableCFFdump":
|
||||
# dump as hex as long as we can't compile
|
||||
DefaultTable.DefaultTable.toXML(self, writer, otFont)
|
||||
else:
|
||||
self.cff.toXML(writer, progress)
|
||||
|
||||
#def fromXML(self, (name, attrs, content), otFont):
|
||||
# xxx
|
||||
|
Loading…
x
Reference in New Issue
Block a user