[subset] Remove no-op Lookup.prune_pre_subset() and deps
This commit is contained in:
parent
80966aa7e3
commit
8cc69ab2ed
@ -695,24 +695,6 @@ def subset_lookups(self, lookup_indices):
|
||||
def collect_lookups(self):
|
||||
return []
|
||||
|
||||
@_add_method(otTables.SingleSubst,
|
||||
otTables.MultipleSubst,
|
||||
otTables.AlternateSubst,
|
||||
otTables.LigatureSubst,
|
||||
otTables.ContextSubst,
|
||||
otTables.ChainContextSubst,
|
||||
otTables.ReverseChainSingleSubst,
|
||||
otTables.SinglePos,
|
||||
otTables.PairPos,
|
||||
otTables.CursivePos,
|
||||
otTables.MarkBasePos,
|
||||
otTables.MarkLigPos,
|
||||
otTables.MarkMarkPos,
|
||||
otTables.ContextPos,
|
||||
otTables.ChainContextPos)
|
||||
def prune_pre_subset(self, options):
|
||||
return True
|
||||
|
||||
@_add_method(otTables.SingleSubst,
|
||||
otTables.MultipleSubst,
|
||||
otTables.AlternateSubst,
|
||||
@ -1064,14 +1046,6 @@ def may_have_non_1to1(self):
|
||||
else:
|
||||
assert 0, "unknown format: %s" % self.Format
|
||||
|
||||
@_add_method(otTables.ExtensionSubst,
|
||||
otTables.ExtensionPos)
|
||||
def prune_pre_subset(self, options):
|
||||
if self.Format == 1:
|
||||
return self.ExtSubTable.prune_pre_subset(options)
|
||||
else:
|
||||
assert 0, "unknown format: %s" % self.Format
|
||||
|
||||
@_add_method(otTables.ExtensionSubst,
|
||||
otTables.ExtensionPos)
|
||||
def subset_glyphs(self, s):
|
||||
@ -1123,14 +1097,6 @@ def closure_glyphs(self, s, cur_glyphs=None):
|
||||
assert(s._activeLookups[-1] == self)
|
||||
del s._activeLookups[-1]
|
||||
|
||||
@_add_method(otTables.Lookup)
|
||||
def prune_pre_subset(self, options):
|
||||
ret = False
|
||||
for st in self.SubTable:
|
||||
if not st: continue
|
||||
if st.prune_pre_subset(options): ret = True
|
||||
return ret
|
||||
|
||||
@_add_method(otTables.Lookup)
|
||||
def subset_glyphs(self, s):
|
||||
self.SubTable = [st for st in self.SubTable if st and st.subset_glyphs(s)]
|
||||
@ -1159,14 +1125,6 @@ def collect_lookups(self):
|
||||
def may_have_non_1to1(self):
|
||||
return any(st.may_have_non_1to1() for st in self.SubTable if st)
|
||||
|
||||
@_add_method(otTables.LookupList)
|
||||
def prune_pre_subset(self, options):
|
||||
ret = False
|
||||
for l in self.Lookup:
|
||||
if not l: continue
|
||||
if l.prune_pre_subset(options): ret = True
|
||||
return ret
|
||||
|
||||
@_add_method(otTables.LookupList)
|
||||
def subset_glyphs(self, s):
|
||||
"""Returns the indices of nonempty lookups."""
|
||||
@ -1398,9 +1356,6 @@ def prune_pre_subset(self, options):
|
||||
self.subset_feature_tags(options.layout_features)
|
||||
# Drop unreferenced lookups
|
||||
self.prune_lookups()
|
||||
# Prune lookups themselves
|
||||
if self.table.LookupList:
|
||||
self.table.LookupList.prune_pre_subset(options)
|
||||
return True
|
||||
|
||||
@_add_method(ttLib.getTableClass('GSUB'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user