fontBuilder: pass glyphMap to buildCOLR to sort base records by GID

COLR Base glyph records must be sorted by glyph index. The buildCOLR
function has an optional glyphMap parameter that maps from glyph names
to glyph indices (as returned from TTFont.getReversedGlyphMap()).
FontBuilder knows all that so it should pass it on to colorLib.
This commit is contained in:
Cosimo Lupo 2021-02-01 11:51:39 +00:00
parent 822d3bf261
commit 85c450b565
No known key found for this signature in database
GPG Key ID: 179A8F0895A02F4F

View File

@ -777,7 +777,8 @@ class FontBuilder(object):
"""
from fontTools.colorLib.builder import buildCOLR
self.font["COLR"] = buildCOLR(colorLayers)
glyphMap = self.font.getReverseGlyphMap()
self.font["COLR"] = buildCOLR(colorLayers, glyphMap=glyphMap)
def setupCPAL(
self,