drop the 'X' from recalcAvgCharWidth method name
This commit is contained in:
parent
ee2d83d4b3
commit
bb1dbf4198
@ -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
|
||||
|
@ -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__ = [
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user