googlefonts / fontdiffenator

Font comparison tool
Apache License 2.0
79 stars 13 forks source link

set_variations_from_static: Improve instantiating Thin and ExtraLight instances #67

Closed m4rc1e closed 4 years ago

m4rc1e commented 4 years ago

When diffing a static font against a VF, we have to instantiate the VF so it matches the static font. For the weight axis value, we use the static font's OS/2.usWeightClass. This works well for weights Light to Black. It doesn't work well for the Thin and ExtraLight because our VF spec differs to our legacy static font spec. For static fonts we used to set the Thin OS/2.usWeightClass to 250 and the ExtraLight to 275. For VFs we set the fvar values to 100 and 200. This PR will override these legacy usWeightClass values.