From bb1dbf41987ea1de283a3bef88179938e2afdf41 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 21 Apr 2022 19:02:15 +0100 Subject: [PATCH] drop the 'X' from recalcAvgCharWidth method name --- Lib/fontTools/fontBuilder.py | 2 +- Lib/fontTools/merge/__init__.py | 2 +- Lib/fontTools/subset/__init__.py | 2 +- Lib/fontTools/ttLib/tables/O_S_2f_2.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/fontTools/fontBuilder.py b/Lib/fontTools/fontBuilder.py index 1eb640ee1..ad7180cb8 100644 --- a/Lib/fontTools/fontBuilder.py +++ b/Lib/fontTools/fontBuilder.py @@ -491,7 +491,7 @@ class FontBuilder(object): assert ( "hmtx" in self.font ), "the 'hmtx' table must be setup before the 'OS/2' table" - self.font["OS/2"].recalcXAvgCharWidth(self.font) + self.font["OS/2"].recalcAvgCharWidth(self.font) if not ( "ulUnicodeRange1" in values or "ulUnicodeRange2" in values diff --git a/Lib/fontTools/merge/__init__.py b/Lib/fontTools/merge/__init__.py index 3ae2d3836..971064891 100644 --- a/Lib/fontTools/merge/__init__.py +++ b/Lib/fontTools/merge/__init__.py @@ -158,7 +158,7 @@ class Merger(object): if "OS/2" in font: # https://github.com/fonttools/fonttools/issues/2538 # TODO: Add an option to disable this? - font["OS/2"].recalcXAvgCharWidth(font) + font["OS/2"].recalcAvgCharWidth(font) __all__ = [ diff --git a/Lib/fontTools/subset/__init__.py b/Lib/fontTools/subset/__init__.py index 5cb1ddd38..56d9c0ef5 100644 --- a/Lib/fontTools/subset/__init__.py +++ b/Lib/fontTools/subset/__init__.py @@ -2977,7 +2977,7 @@ class Subsetter(object): log.info("%s Unicode ranges pruned: %s", tag, sorted(new_uniranges)) if self.options.recalc_average_width: old_avg_width = font[tag].xAvgCharWidth - new_avg_width = font[tag].recalcXAvgCharWidth(font) + new_avg_width = font[tag].recalcAvgCharWidth(font) if old_avg_width != new_avg_width: log.info("%s xAvgCharWidth updated: %d", tag, new_avg_width) if self.options.recalc_max_context: diff --git a/Lib/fontTools/ttLib/tables/O_S_2f_2.py b/Lib/fontTools/ttLib/tables/O_S_2f_2.py index 8de984214..ba2e39616 100644 --- a/Lib/fontTools/ttLib/tables/O_S_2f_2.py +++ b/Lib/fontTools/ttLib/tables/O_S_2f_2.py @@ -300,7 +300,7 @@ class table_O_S_2f_2(DefaultTable.DefaultTable): self.setUnicodeRanges(bits) return bits - def recalcXAvgCharWidth(self, ttFont): + def recalcAvgCharWidth(self, ttFont): """Recalculate xAvgCharWidth using metrics from ttFont's 'hmtx' table. Set it to 0 if the unlikely event 'hmtx' table is not found.