Skip to content

[css-fonts-4] Make behaviour of new auto values on @font-face properties clearer #9485

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

Open
wezm opened this issue Oct 18, 2023 · 4 comments
Assignees
Labels
css-fonts-4 Current Work

Comments

@wezm
Copy link

wezm commented Oct 18, 2023

CSS Fonts Level 4 adds an auto value to font-weight, font-style, and font-stretch in @font-face rules and uses it as the initial value of these properties. The spec does not provide much detail on how this auto value works. This is the only note I could find:

The auto values for these three descriptors have the following effects:

  • For font selection purposes, the font is selected as if the appropriate initial value is chosen
  • For variation axis clamping, clamping does not occur

I think that this needs to be expanded and that "appropriate initial value" defined.

Looking over #2485 clarified some things for me that I think should be added to the spec. Specifically taking font-weight as an example it seems that auto acts as an alias for normal for fonts without a wght axis, matching the behaviour of CSS Fonts Level 3. For fonts with a wght axis it seems that it acts as a sort of wildcard equivalent to 1 1000.

@fantasai fantasai added the css-fonts-4 Current Work label Jan 9, 2024
@svgeesus svgeesus self-assigned this Jan 23, 2024
@svgeesus
Copy link
Contributor

I think that this needs to be expanded and that "appropriate initial value" defined.

Ah, I see. In 9a6e704 the initial value was "normal" for all three font-weight, font-style and font-width and that would be used for font selection purposes. So "appropriate initial value" made sense. But in 36f80a0 that was changed to auto because of #2485 (comment) so now it needs to explicitly say 'normal`, for font selection.

And for variation handling, it means no clamping is applied.

svgeesus added a commit that referenced this issue Jan 24, 2024
@svgeesus
Copy link
Contributor

@wezm do the changes in 02251ac cover it?

@wezm
Copy link
Author

wezm commented Jan 24, 2024

@svgeesus hmm are the changes right? E.g. for font-weight normal means 400 and if that was used with a variable font with a wght axis ranging from 500 to 900 the new text suggests to me that that font would not be selected, whereas I think the intention of auto is that it would be selected?

@svgeesus
Copy link
Contributor

Good point, this interacts with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-fonts-4 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants