remove redundant CPAL name removal code

This commit is contained in:
Marc Foley 2023-06-28 17:18:12 +01:00
parent 0a6e8bf1c3
commit b5639410ab

View File

@ -2586,25 +2586,10 @@ def prune_post_subset(self, font, options):
if self.version == 1:
kept_labels = []
dropped_labels = []
for i, label in enumerate(self.paletteEntryLabels):
if i in retained_palette_indices:
kept_labels.append(label)
else:
dropped_labels.append(label)
self.paletteEntryLabels = kept_labels
# Remove dropped labels from the name table.
name_table = font["name"]
name_table.names = [
n
for n in name_table.names
if (
n.nameID not in dropped_labels
# Only remove nameIDs in the user range and if they're not explicitly kept
or n.nameID < 256
or n.nameID in options.name_IDs
)
]
return bool(self.numPaletteEntries)