mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Font subsetting: Fix subsetting removing some needed ligatures when subsetting Arabic fonts
The GSUB table works by chaining substitution tables. That is later tables in a Lookup can refer to glyphs output by earlier tables. The old code did not take this behavior into account, fix that.
This commit is contained in:
parent
22b3586e70
commit
e612637282
@ -171,10 +171,11 @@ class GSUBTable(UnknownTable):
|
||||
self.lookuplist_offset)
|
||||
|
||||
def all_substitutions(self, glyph_ids):
|
||||
ans = set()
|
||||
glyph_ids = frozenset(glyph_ids)
|
||||
ans = set(glyph_ids)
|
||||
for lookup_table in self.lookup_list_table:
|
||||
for subtable in lookup_table:
|
||||
gids = subtable.all_substitutions(glyph_ids)
|
||||
ans |= gids
|
||||
return ans
|
||||
glyphs = subtable.all_substitutions(ans)
|
||||
if glyphs:
|
||||
ans |= glyphs
|
||||
return ans - {glyph_ids}
|
||||
|
Loading…
x
Reference in New Issue
Block a user