You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def fix_weight_class_var(font_obj):
if 'fvar' not in font_obj:
# not a variable font
return
fvar = font_obj['fvar']
default_axis_values = {a.axisTag: a.defaultValue for a in fvar.axes}
print('default_axis_values: ', default_axis_values)
v = default_axis_values.get('wght', None)
if isinstance(v, int) or isinstance(v, float):
font_obj["OS/2"].usWeightClass = int(v)
print('Changed usWeightClass tom match fvar default value.')
The text was updated successfully, but these errors were encountered:
According to Microsoft's OT spec the usWeightClass should match the fvar default value.
In most of the cases this might be 400, but in some it's not.
fix_weight_class does not take care of that:
gftools/Lib/gftools/fix.py
Line 184 in f0d02b3
The OT Spec says:
In a variable font that implements 'wght' variations, the value in the usWeightClass field of the OS/2 table must match the default 'wght' value specified in the 'fvar' table.
https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_wght#additional-information
That do you think about something like that:
The text was updated successfully, but these errors were encountered: