Skip to content
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] Angle for oblique->normal threshold should be lower end of common obliques not 20 #2539

Closed
fantasai opened this issue Apr 11, 2018 · 7 comments
Assignees
Labels
css-fonts-4 Current Work

Comments

@fantasai
Copy link
Collaborator

The font matching algorithm searches upward from the specified angle to more slanted fonts if the angle is > 20deg, and downward towards normal fonts if it is < 20deg. This threshold should not be the most common angle of obliques, but rather the lower end of that range, otherwise requests for an oblique angle which is reasonably oblique but not so much as the average will end up with a normal font.

@svgeesus
Copy link
Contributor

Sure - because of #2295 the 20deg in this algo should be 14deg, anyway.

@fantasai
Copy link
Collaborator Author

fantasai commented Jul 1, 2018

It should be lower than that, is my argument.

@css-meeting-bot
Copy link
Member

The Working Group just discussed Angle for oblique->normal threshold should be lower end of common obliques not 20, and agreed to the following:

  • RESOLVED: Start searching for obique starting from 11deg
The full IRC log of that discussion <fantasai> Topic: Angle for oblique->normal threshold should be lower end of common obliques not 20
<fantasai> https://github.com//issues/2539
<fantasai> github: https://github.com//issues/2539
<frremy> fantasai: in the font matching algorithm, we start searching from 20deg then go up from there
<frremy> fantasai: 20deg is an average
<frremy> fantasai: we should probably search from the minimum value
<frremy> chris_: if the mimimum is 14 we should start searching at 7
<fantasai> "If no match is found, oblique values greater than or equal to 20deg are checked in ascending order followed by oblique values below 20deg in descending order, until 0 is hit."
<frremy> fantasai: the spec says:
<frremy> fantasai: (see above comment)
<frremy> florian: 14 not 7?
<frremy> myles: if you have 13deg and 80deg you want 13deg
<frremy> fantasai: so we set 7deg
<frremy> myles: but what about 6deg and 80deg?
<frremy> florian: binary search, we look in both directions?
<frremy> myles: I don't want to change the algorithm
<frremy> myles: I think we should set the value as 11deg
<frremy> myles: because this seems better than 8deg
<frremy> fantasai: 11 is a lower-bound italic
<frremy> fantasai: 8 would be pushing it
<fantasai> s/italic/of typical italics/
<frremy> astearns: alright, any objection to start searching at 11 and see how it goes?
<frremy> myles: (disgression on the negative angle)
<chris_> It goes to 11!
<frremy> RESOLVED: Start searching for obique starting from 11deg
<florian> It goes to 11! -> it starts from 11!

@svgeesus
Copy link
Contributor

Hmm I see the spec still uses 20 deg in the font-style part of the font matching algorithm

@svgeesus svgeesus self-assigned this Jul 27, 2021
@svgeesus
Copy link
Contributor

svgeesus commented Jul 27, 2021

And just checking (since there are 8 occurrences of 20deg in the spec currently) this is just for oblique right, not for italic.

Edit: including the part where italic is not found so you fall back to oblique.

@svgeesus
Copy link
Contributor

Also does this common scale mapping need to be changed?

User agents are not required to distinguish between italic and oblique fonts. In such user agents, the font-style matching steps above are performed by mapping both italic values and oblique angles onto a common scale. The exact nature of this mapping is undefined, however, an italic value of 1 must map to the same value that an oblique angle of 20deg maps to.

@svgeesus
Copy link
Contributor

All occurrences of 20deg related to oblique, so in the end they were all changed to 11.

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

4 participants