-
Notifications
You must be signed in to change notification settings - Fork 686
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
[css-fonts-4] [varfont] Values in font-variation-settings should be normalized 0.0 - 1.0 #573
Comments
That seems to assume that each font covers the same range, though. If font A covers 0.6 to 1.3 and font B covers 0.5 to 0.8 then it would be weird to have both of those normalized to a 0 to 1 range which means different things for the two fonts. I agree about clipping rather than ignoring out of range values. |
True, but at the end they all act like a 'slider' going from one end to the other. The test app FontView does it nicely. How would the value behave when its set as a percentage? (seems like that is not yet implemented in the nightly build) |
There is no proposal to set it as a percentage. |
Font features (font-feature-settings) has this same problem. See also: #520 |
It seems like it's best to treat the number range as analogous to 'thinnest to thickest' or 'narrowest to widest'; i.e. if we used a 1-999 range (or whatever it is we choose), the midpoint should be whatever is the 'reference' shape of the glyph. That way the 'default' value would be 500, and 1 would correspond to the thinnest/narrowest/shortest/etc, 999 being the opposite end of the spectrum. I'm curious if there's a notion of 'named deltas' to be able to call the 'Black' weight in the spec, and if so could we expose that and/or associate it in our css? Thinking of something like: font-family: variablefontname; [just saw that @litherum just opened up #574 related to this] |
Are we talking about font-variation-settings here? Or the higher-level properties? The policy will likely be different for each of them. font-variation-settings shouldn't scale or bias its arguments because it is meant to be an escape hatch for web authors who know exactly what they are doing. For everyone else, they should be using the high-level properties instead. Ultimately, the usage of font-variation-settings should be extremely small. (I only implemented it in WebKit because it's simple to implement and it has relatively few dependencies on the rest of the engine.) |
I think that understanding now how the higher-level properties will 'clamp' (or have the ability to supply a value like '999' instead of 'heavy'), then with proper explanation I think it matters less in font-variation-settings. But it does raise the point about how anyone would know what the possible value ranges are short of opening up the font file. Would it always be some number between 0 and 2, with 1 being the 'norm'? |
The higher level properties have only support for the predefined axes and named instances. There is no support for any other axis, so If so, I guess web designers will build javascripts to normalise those range values, maybe this is a missed opportunity. Features and axis could be promoted by type foundries, but the axis ranges are something different. |
|
Variation fonts already have a way of "assign[ing] custom (hopefully semantic) keywords to opaque numbers," which is being discussed in #539. Because This discussion has now veered off of the original topic of |
As the draft is setup now the number value in
font-variation-settings
for each axis has to refer to the ranges declared in the font.Somehow this feels contra productive. fe: Did some tests today with the Webkit nightly build and ended up with opening Skia with fontTools to know the range (the wdth axis has a range from 0.61998 to 1.2999). Web designers should not know about those values. Font foundries should not bother explaining those values to web designers, so they can set them correctly. The number value could represent a normalised value going from 0 to 1.
The draft also declares that the number values outside a range should be ignored. It seems better to declare extrapolations as an endless fixed value by limiting the value to the boundaries of a range. Similarly as what MutatorMath and fontTools.varLib does.
The text was updated successfully, but these errors were encountered: