From f37f2e4a03779a96dcca8d14a45722bc55f5d945 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 17 Dec 2023 00:09:10 -0700 Subject: [PATCH] [subset] Close over MATH before GSUB I *think* that's the correct way. --- Lib/fontTools/subset/__init__.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py index c48edeeca..909ba7d80 100644 --- a/Lib/fontTools/subset/__init__.py +++ b/Lib/fontTools/subset/__init__.py @@ -3318,20 +3318,6 @@ class Subsetter(object): self.glyphs.add(font.getGlyphName(i)) log.info("Added first four glyphs to subset") - if self.options.layout_closure and "GSUB" in font: - with timer("close glyph list over 'GSUB'"): - log.info( - "Closing glyph list over 'GSUB': %d glyphs before", len(self.glyphs) - ) - log.glyphs(self.glyphs, font=font) - font["GSUB"].closure_glyphs(self) - self.glyphs.intersection_update(realGlyphs) - log.info( - "Closed glyph list over 'GSUB': %d glyphs after", len(self.glyphs) - ) - log.glyphs(self.glyphs, font=font) - self.glyphs_gsubed = frozenset(self.glyphs) - if "MATH" in font: with timer("close glyph list over 'MATH'"): log.info( @@ -3346,6 +3332,20 @@ class Subsetter(object): log.glyphs(self.glyphs, font=font) self.glyphs_mathed = frozenset(self.glyphs) + if self.options.layout_closure and "GSUB" in font: + with timer("close glyph list over 'GSUB'"): + log.info( + "Closing glyph list over 'GSUB': %d glyphs before", len(self.glyphs) + ) + log.glyphs(self.glyphs, font=font) + font["GSUB"].closure_glyphs(self) + self.glyphs.intersection_update(realGlyphs) + log.info( + "Closed glyph list over 'GSUB': %d glyphs after", len(self.glyphs) + ) + log.glyphs(self.glyphs, font=font) + self.glyphs_gsubed = frozenset(self.glyphs) + for table in ("COLR", "bsln"): if table in font: with timer("close glyph list over '%s'" % table):