fontBuilder: allow to build v1 from setupCPAL method
This commit is contained in:
parent
a0a4901a5e
commit
d9250ddcf5
@ -777,14 +777,29 @@ class FontBuilder(object):
|
||||
|
||||
self.font["COLR"] = buildCOLR(colorLayers)
|
||||
|
||||
def setupCPAL(self, palettes):
|
||||
def setupCPAL(
|
||||
self,
|
||||
palettes,
|
||||
paletteTypes=None,
|
||||
paletteLabels=None,
|
||||
paletteEntryLabels=None,
|
||||
):
|
||||
"""Build new CPAL table using list of palettes.
|
||||
|
||||
Optionally build CPAL v1 table using paletteTypes, paletteLabels and
|
||||
paletteEntryLabels.
|
||||
|
||||
Cf. `fontTools.colorLib.builder.buildCPAL`.
|
||||
"""
|
||||
from fontTools.colorLib.builder import buildCPAL
|
||||
|
||||
self.font["CPAL"] = buildCPAL(palettes)
|
||||
self.font["CPAL"] = buildCPAL(
|
||||
palettes,
|
||||
paletteTypes=paletteTypes,
|
||||
paletteLabels=paletteLabels,
|
||||
paletteEntryLabels=paletteEntryLabels,
|
||||
nameTable=self.font.get("name")
|
||||
)
|
||||
|
||||
|
||||
def buildCmapSubTable(cmapping, format, platformID, platEncID):
|
||||
|
Loading…
x
Reference in New Issue
Block a user