Revert "return self so one can do font=TTFont(file).ensureDecompiled()"
This reverts commit 61e7b294483cbe729b1437804406b4571ae57cfb.
This commit is contained in:
parent
61e7b29448
commit
43d2ee2822
@ -162,7 +162,6 @@ class table__c_m_a_p(DefaultTable.DefaultTable):
|
||||
def ensureDecompiled(self):
|
||||
for st in self.tables:
|
||||
st.ensureDecompiled()
|
||||
return self
|
||||
|
||||
def compile(self, ttFont):
|
||||
self.tables.sort() # sort according to the spec; see CmapSubtable.__lt__()
|
||||
@ -246,7 +245,6 @@ class CmapSubtable(object):
|
||||
self.data = None # Once this table has been decompiled, make sure we don't
|
||||
# just return the original data. Also avoids recursion when
|
||||
# called with an attribute that the cmap subtable doesn't have.
|
||||
return self
|
||||
|
||||
def __getattr__(self, attr):
|
||||
# allow lazy decompilation of subtables.
|
||||
|
@ -115,7 +115,6 @@ class table__g_l_y_f(DefaultTable.DefaultTable):
|
||||
def ensureDecompiled(self):
|
||||
for glyph in self.glyphs.values():
|
||||
glyph.expand(self)
|
||||
return self
|
||||
|
||||
def compile(self, ttFont):
|
||||
if not hasattr(self, "glyphOrder"):
|
||||
|
@ -110,7 +110,6 @@ class BaseTTXConverter(DefaultTable):
|
||||
|
||||
def ensureDecompiled(self):
|
||||
self.table.ensureDecompiled(recurse=True)
|
||||
return self
|
||||
|
||||
|
||||
# https://github.com/fonttools/fonttools/pull/2285#issuecomment-834652928
|
||||
@ -610,7 +609,6 @@ class BaseTable(object):
|
||||
if recurse:
|
||||
for subtable in self.iterSubTables():
|
||||
subtable.ensureDecompiled(recurse)
|
||||
return self
|
||||
|
||||
@classmethod
|
||||
def getRecordSize(cls, reader):
|
||||
|
@ -379,16 +379,12 @@ class TTFont(object):
|
||||
return ["GlyphOrder"] + keys
|
||||
|
||||
def ensureDecompiled(self):
|
||||
"""Decompile all the tables, even if a TTFont was opened in 'lazy' mode.
|
||||
|
||||
Returns the same TTFont instance, fully decompiled.
|
||||
"""
|
||||
"""Decompile all the tables, even if a TTFont was opened in 'lazy' mode."""
|
||||
for tag in self.keys():
|
||||
table = self[tag]
|
||||
if self.lazy is not False and hasattr(table, "ensureDecompiled"):
|
||||
table.ensureDecompiled()
|
||||
self.lazy = False
|
||||
return self
|
||||
|
||||
def __len__(self):
|
||||
return len(list(self.keys()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user