[merge] Move cmap computation closer to glyph-order computation

This commit is contained in:
Behdad Esfahbod 2021-12-16 10:31:56 -07:00
parent 8dc3d5b322
commit c0e61b729a

View File

@ -69,6 +69,8 @@ class Merger(object):
fonts = [ttLib.TTFont(fontfile) for fontfile in fontfiles]
glyphOrders = [font.getGlyphOrder() for font in fonts]
megaGlyphOrder = computeMegaGlyphOrder(self, glyphOrders)
self.duplicateGlyphsPerFont = [{} for _ in fonts]
computeMegaCmap(self, [font['cmap'] for font in fonts])
# Take first input file sfntVersion
sfntVersion = fonts[0].sfntVersion
@ -97,9 +99,6 @@ class Merger(object):
self._preMerge(font)
self.fonts = fonts
self.duplicateGlyphsPerFont = [{} for _ in fonts]
computeMegaCmap(self, [font['cmap'] for font in fonts])
allTags = reduce(set.union, (list(font.keys()) for font in fonts), set())
allTags.remove('GlyphOrder')