From 0a6e8bf1c308c843fbbf65e06e4eb5734aa941a2 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Wed, 28 Jun 2023 17:02:34 +0100 Subject: [PATCH] convert name table _prune_pre_subset to prune_post_subset --- Lib/fontTools/subset/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py index 23bb9a81b..bd56481c8 100644 --- a/Lib/fontTools/subset/__init__.py +++ b/Lib/fontTools/subset/__init__.py @@ -2916,7 +2916,7 @@ def prune_pre_subset(self, font, options): @_add_method(ttLib.getTableClass("name")) -def prune_pre_subset(self, font, options): +def prune_post_subset(self, font, options): visitor = NameRecordVisitor() visitor.visit(font) nameIDs = set(options.name_IDs) | visitor.seen @@ -3442,7 +3442,11 @@ class Subsetter(object): font.setGlyphOrder(self.new_glyph_order) def _prune_post_subset(self, font): - for tag in font.keys(): + tableTags = font.keys() + if "name" in tableTags: + tableTags.remove("name") + tableTags.append("name") + for tag in tableTags: if tag == "GlyphOrder": continue if tag == "OS/2":