Though params refer to variable font grade, script changes font weight
See original GitHub issueJust noticed: the code that handles setting the variable grade in PR #25 uses the font-variation-settings with the "wght" flag:
This is based on the current 0.9.9 code:
I’m new to variable fonts, but based on MDN’s Variable Font Guide, it looks like font grade is specified not using the "wght" flag but rather the "GRAD" flag (capitalized because grade is a (less common) custom variation axis, unlike weight, which is a (more commonly used) registered axis).
The font used in demo.html, Source Sans Variable - Roman, contains only the weight variation axis. So perhaps the parameter names should be changed from min/maxWidthVariableGrade to min/maxWidthFontWeight? The Variable part could be dropped, since both variable and non-variable fonts’ weights can be set using just the font-weight CSS property (non-variable fonts will just round to the nearest available weight); the font-variation-settings property that only works with variable fonts wouldn’t need to be used.
The VariableGrade params could be retained in addition to FontWeight params, and the code could be updated accordingly, though a variable font with a grade axis should be used to demonstrate it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6

Top Related StackOverflow Question
Also note that grade axes aren’t consistent; eg Roboto Flex and San Francisco both have grade but with different axis details
Hey @tinymachine, I know you have this in https://github.com/glyphic-co/textblock/pull/36 but should we pull it out and apply it on its own?