-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Though params refer to variable font grade, script changes font weight #29
Comments
Ah, I see now that the readme mentions simulating grades, so using the |
The issue is there aren't many variable fonts that actually have grades, yet. Maybe the answer is to support both, or maybe add in actual grade support as it becomes more prevalent? |
Since so few fonts include variable grades, maybe for the sake of keeping the script as small as possible it would make sense to only support variable weight for now? Even if you hold off on supporting grades, though, I think it would make sense to change the parameter names from (I would keep the reference in the readme about using weights to simulate grades, though, to keep the design intent behind supporting variable font-weights clear.) |
(The script could continue to support the legacy |
Hey @tinymachine, I know you have this in #36 but should we pull it out and apply it on its own? |
Also note that grade axes aren't consistent; eg Roboto Flex and San Francisco both have grade but with different axis details |
Just noticed: the code that handles setting the variable grade in PR #25 uses the
font-variation-settings
with the"wght"
flag:textblock/src/textblock.js
Lines 52 to 53 in 934cf16
This is based on the current 0.9.9 code:
textblock/src/textblock.js
Line 56 in 567a0e3
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
tomin/maxWidthFontWeight
? TheVariable
part could be dropped, since both variable and non-variable fonts' weights can be set using just thefont-weight
CSS property (non-variable fonts will just round to the nearest available weight); thefont-variation-settings
property that only works with variable fonts wouldn't need to be used.The
VariableGrade
params could be retained in addition toFontWeight
params, and the code could be updated accordingly, though a variable font with a grade axis should be used to demonstrate it.The text was updated successfully, but these errors were encountered: