fontmake: Instantiation from Glyphs source: usWeightClass is set wrong

When creating static instances from a Glyphs source, the instance’s interpolation space weight value is used for usWeightClass as opposed to the appropriate weight class value.

I had actually added a weightClass custom parameter to each instance using the simple script below, so the custom parameter should be used for usWeightClass when present, or otherwise calculated in fontmake on the fly as below:

from GlyphsApp import *
f = Glyphs.font

weights = {
'Thin': 100,
'ExtraLight': 200,
'UltraLight': 100,
'Light': 300,
'Normal': 400,
'Regular': 400,
'Medium': 500,
'DemiBold': 600,
'SemiBold': 600,
'Bold': 700,
'UltraBold': 800,
'ExtraBold': 800,
'Black': 900,
'Heavy': 100,
}

for i in f.instances:
	i.customParameters['weightClass'] = weights[i.weight]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (15 by maintainers)

Most upvoted comments

Oh, you’re right. But I took the values from Glyphs UI, and there it says 900, not 1000. But 100 is wrong anyway. Thanks.