[merge] use recalcXAvgCharWidth method on merged font
Fixes #2538, supersedes #2590
This commit is contained in:
parent
12942feb6b
commit
ee2d83d4b3
@ -155,6 +155,11 @@ class Merger(object):
|
|||||||
def _postMerge(self, font):
|
def _postMerge(self, font):
|
||||||
layoutPostMerge(font)
|
layoutPostMerge(font)
|
||||||
|
|
||||||
|
if "OS/2" in font:
|
||||||
|
# https://github.com/fonttools/fonttools/issues/2538
|
||||||
|
# TODO: Add an option to disable this?
|
||||||
|
font["OS/2"].recalcXAvgCharWidth(font)
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'Options',
|
'Options',
|
||||||
|
@ -132,7 +132,7 @@ ttLib.getTableClass('OS/2').mergeMap = {
|
|||||||
'*': first,
|
'*': first,
|
||||||
'tableTag': equal,
|
'tableTag': equal,
|
||||||
'version': max,
|
'version': max,
|
||||||
'xAvgCharWidth': avg_int, # Apparently fontTools doesn't recalc this
|
'xAvgCharWidth': first, # Will be recalculated at the end on the merged font
|
||||||
'fsType': mergeOs2FsType, # Will be overwritten
|
'fsType': mergeOs2FsType, # Will be overwritten
|
||||||
'panose': first, # FIXME: should really be the first Latin font
|
'panose': first, # FIXME: should really be the first Latin font
|
||||||
'ulUnicodeRange1': bitwise_or,
|
'ulUnicodeRange1': bitwise_or,
|
||||||
|
@ -834,7 +834,7 @@
|
|||||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||||
will be recalculated by the compiler -->
|
will be recalculated by the compiler -->
|
||||||
<version value="4"/>
|
<version value="4"/>
|
||||||
<xAvgCharWidth value="505"/>
|
<xAvgCharWidth value="501"/>
|
||||||
<usWeightClass value="400"/>
|
<usWeightClass value="400"/>
|
||||||
<usWidthClass value="5"/>
|
<usWidthClass value="5"/>
|
||||||
<fsType value="00000000 00000000"/>
|
<fsType value="00000000 00000000"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user