Merge pull request #2166 from fonttools/fb-colr-glyphMap

fontBuilder: pass glyphMap to buildCOLR to sort base records by GID
This commit is contained in:
Cosimo Lupo 2021-02-01 12:52:24 +00:00 committed by GitHub
commit 728258d66f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -770,14 +770,17 @@ class FontBuilder(object):
self.font, conditionalSubstitutions, featureTag=featureTag
)
def setupCOLR(self, colorLayers):
def setupCOLR(self, colorLayers, version=None, varStore=None):
"""Build new COLR table using color layers dictionary.
Cf. `fontTools.colorLib.builder.buildCOLR`.
"""
from fontTools.colorLib.builder import buildCOLR
self.font["COLR"] = buildCOLR(colorLayers)
glyphMap = self.font.getReverseGlyphMap()
self.font["COLR"] = buildCOLR(
colorLayers, version=version, glyphMap=glyphMap, varStore=varStore
)
def setupCPAL(
self,