[visitor] ensureDecompiled(recurse=False)
This commit is contained in:
parent
de091983d5
commit
9b0d0e7b56
@ -85,7 +85,7 @@ class Visitor(object):
|
||||
class TTVisitor(Visitor):
|
||||
def visit(self, obj, *args, **kwargs):
|
||||
if hasattr(obj, "ensureDecompiled"):
|
||||
obj.ensureDecompiled()
|
||||
obj.ensureDecompiled(recurse=False)
|
||||
super().visit(obj, *args, **kwargs)
|
||||
|
||||
|
||||
|
@ -164,7 +164,7 @@ class table__c_m_a_p(DefaultTable.DefaultTable):
|
||||
if ttFont.lazy is False: # Be lazy for None and True
|
||||
self.ensureDecompiled()
|
||||
|
||||
def ensureDecompiled(self):
|
||||
def ensureDecompiled(self, recurse=None):
|
||||
for st in self.tables:
|
||||
st.ensureDecompiled()
|
||||
|
||||
@ -241,7 +241,7 @@ class CmapSubtable(object):
|
||||
self.platEncID = None #: The encoding ID of this subtable (interpretation depends on ``platformID``)
|
||||
self.language = None #: The language ID of this subtable (Macintosh platform only)
|
||||
|
||||
def ensureDecompiled(self):
|
||||
def ensureDecompiled(self, recurse=None):
|
||||
if self.data is None:
|
||||
return
|
||||
self.decompile(None, None) # use saved data.
|
||||
|
@ -112,7 +112,7 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
|
||||
if ttFont.lazy is False: # Be lazy for None and True
|
||||
self.ensureDecompiled()
|
||||
|
||||
def ensureDecompiled(self):
|
||||
def ensureDecompiled(self, recurse=None):
|
||||
for glyph in self.glyphs.values():
|
||||
glyph.expand(self)
|
||||
|
||||
|
@ -388,7 +388,7 @@ class TTFont(object):
|
||||
if recurse is None:
|
||||
recurse = self.lazy is not False
|
||||
if recurse and hasattr(table, "ensureDecompiled"):
|
||||
table.ensureDecompiled()
|
||||
table.ensureDecompiled(recurse=recurse)
|
||||
self.lazy = False
|
||||
|
||||
def __len__(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user