From 43d2ee28223d1e8e278f27addf5cf9150a731af0 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 17 Mar 2022 15:55:20 +0000 Subject: [PATCH] Revert "return self so one can do font=TTFont(file).ensureDecompiled()" This reverts commit 61e7b294483cbe729b1437804406b4571ae57cfb. --- Lib/fontTools/ttLib/tables/_c_m_a_p.py | 2 -- Lib/fontTools/ttLib/tables/_g_l_y_f.py | 1 - Lib/fontTools/ttLib/tables/otBase.py | 2 -- Lib/fontTools/ttLib/ttFont.py | 6 +----- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py index 92e1c17a0..a31b5059c 100644 --- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py +++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py @@ -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. diff --git a/Lib/fontTools/ttLib/tables/_g_l_y_f.py b/Lib/fontTools/ttLib/tables/_g_l_y_f.py index 3de9d28e3..14c4519db 100644 --- a/Lib/fontTools/ttLib/tables/_g_l_y_f.py +++ b/Lib/fontTools/ttLib/tables/_g_l_y_f.py @@ -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"): diff --git a/Lib/fontTools/ttLib/tables/otBase.py b/Lib/fontTools/ttLib/tables/otBase.py index 5bc4f0eed..c9c1d138d 100644 --- a/Lib/fontTools/ttLib/tables/otBase.py +++ b/Lib/fontTools/ttLib/tables/otBase.py @@ -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): diff --git a/Lib/fontTools/ttLib/ttFont.py b/Lib/fontTools/ttLib/ttFont.py index 8bf6614cc..3929e2f3e 100644 --- a/Lib/fontTools/ttLib/ttFont.py +++ b/Lib/fontTools/ttLib/ttFont.py @@ -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()))