mutator: also clamp usWeightClass between valid 1...1000
This commit is contained in:
parent
8fcbf78d8b
commit
0234b9dbd5
@ -137,7 +137,9 @@ def instantiateVariableFont(varfont, location, inplace=False):
|
|||||||
]
|
]
|
||||||
|
|
||||||
if "wght" in location and "OS/2" in varfont:
|
if "wght" in location and "OS/2" in varfont:
|
||||||
varfont["OS/2"].usWeightClass = otRound(location["wght"])
|
varfont["OS/2"].usWeightClass = otRound(
|
||||||
|
max(1, min(location["wght"], 1000))
|
||||||
|
)
|
||||||
if "wdth" in location:
|
if "wdth" in location:
|
||||||
wdth = location["wdth"]
|
wdth = location["wdth"]
|
||||||
for percent, widthClass in sorted(OS2_WIDTH_CLASS_VALUES.items()):
|
for percent, widthClass in sorted(OS2_WIDTH_CLASS_VALUES.items()):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user