[subset] prevent CPAL nameIDs from being dropped
This commit is contained in:
parent
4901deab76
commit
70112b947d
@ -2553,6 +2553,10 @@ def prune_pre_subset(self, font, options):
|
||||
if stat.table.AxisValueArray:
|
||||
nameIDs.update([val_rec.ValueNameID for val_rec in stat.table.AxisValueArray.AxisValue])
|
||||
nameIDs.update([axis_rec.AxisNameID for axis_rec in stat.table.DesignAxisRecord.Axis])
|
||||
cpal = font.get('CPAL')
|
||||
if cpal and cpal.version == 1:
|
||||
nameIDs.update(cpal.paletteLabels)
|
||||
nameIDs.update(cpal.paletteEntryLabels)
|
||||
if '*' not in options.name_IDs:
|
||||
self.names = [n for n in self.names if n.nameID in nameIDs]
|
||||
if not options.name_legacy:
|
||||
|
@ -1359,8 +1359,6 @@ def test_subset_COLRv1_and_CPALv1(colrv1_cpalv1_path):
|
||||
assert "CPAL" in subset_font
|
||||
cpal = subset_font["CPAL"]
|
||||
name_table = subset_font["name"]
|
||||
import pdb
|
||||
pdb.set_trace()
|
||||
assert [name_table.getDebugName(name_id) for name_id in cpal.paletteEntryLabels] == [
|
||||
# "first color", # The first color was pruned
|
||||
"second color",
|
||||
|
Loading…
x
Reference in New Issue
Block a user