drop the 'X' from recalcAvgCharWidth method name

This commit is contained in:
Cosimo Lupo 2022-04-21 19:02:15 +01:00
parent ee2d83d4b3
commit bb1dbf4198
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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__ = [

View File

@ -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:

View File

@ -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.