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

font-style for variable fonts with either Slant or Italic axes. #64

Closed
thlinard opened this issue Mar 4, 2022 · 15 comments
Closed

font-style for variable fonts with either Slant or Italic axes. #64

thlinard opened this issue Mar 4, 2022 · 15 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@thlinard
Copy link

thlinard commented Mar 4, 2022

Description
Implementation of CSS Spec for font-style for variable fonts with either Slant or Italic axes.

Specification
CSS Spec for font-style

Tests
Links to web-platform-tests (on https://wpt.fyi) for the feature (this can be all tests, not a curated list): none, but https://arrowtype.github.io/vf-slnt-test/ (three test fonts are provided)

Rationale

The only style that works with a variable font with slnt or ital axis is the low-level control font-variation-settings.

The following styles and elements are only correctly supported (minus one detail, see https://arrowtype.github.io/vf-slnt-test/) by Firefox:

  • <i> element
  • font-style: italic;
  • font-style: oblique;
  • font-style: oblique XXdeg;
  • font-style: oblique -XXdeg;

Due to poor support, Google Fonts chose to stop releasing fonts with ital or slnt axis:

Example of advice given by a site aimed at web developers:

Due to some inconsistencies with how browsers handle variable font files that contain both italic and upright variants (and also files that contain both italic and slant axes), in these scenarios it’s best to omit the font-style line completely.
https://variablefonts.io/implementing-variable-fonts/

Relevant browser issues:

Relevant specification issues:

Glossary:

Specifications:

italic
selects a font that is labeled as an italic face, or an oblique face if one is not
oblique
selects a font that is labeled as an oblique face, or an italic face if one is not

@foolip
Copy link
Member

foolip commented Sep 16, 2022

Hi @thlinard, thanks for filing a proposal! We just opened up for Interop 2023 proposals yesterday, see https://github.com/web-platform-tests/interop/blob/main/2023/README.md for the process and what to expect.

You have used the same sections as our Focus Area proposal template, so if you like I can change the label to make it such a proposal. Alternatively you could recreate it using https://github.com/web-platform-tests/interop/issues/new?assignees=&labels=focus-area-proposal&template=focus-area-proposal.yml. Which would you prefer?

If you could expand on the rationale that would be helpful, and we'll also need a list of tests in wpt.fyi.

@thlinard
Copy link
Author

thlinard commented Sep 16, 2022

Hi @foolip

Thanks, you can change the label, you sure know your processes better than me.

https://arrowtype.github.io/vf-slnt-test/ has recently been updated, with WOFF2 files for testing and CSS code (I'm not the author of this site, @thundernixon is). Is it enough for you?

Also, for the rationale, the same page compares the (very different) renderings of three browsers.

@gsnedders gsnedders added focus-area-proposal Focus Area Proposal and removed proposal labels Sep 16, 2022
@gsnedders
Copy link
Member

Also, for the rationale, the same page compares the (very different) renderings of three browsers.

While this is true, why do web developers care about this feature? Do we have any evidence that they care about this feature?

That's what the rationale section is trying to answer, not whether there's any incompatibility between browsers.

@gsnedders gsnedders added this to the Interop 2023 milestone Sep 16, 2022
@thlinard
Copy link
Author

thlinard commented Sep 19, 2022

While this is true, why do web developers care about this feature? Do we have any evidence that they care about this feature?

That's what the rationale section is trying to answer, not whether there's any incompatibility between browsers.

Well, we've got a chicken and egg problem, then. Web developers aren't interested in a feature that doesn't work (or that only works on Firefox), and browser developers don't fix a feature that isn't used. Wasn't the present initiative precisely intended to go beyond that?

@jensimmons
Copy link
Contributor

jensimmons commented Sep 19, 2022

@thlinard I think you are misunderstanding what's going on.

Interop 2023 is accepting new proposals from Sept 15 - October 15. After that, the team involved with the project will take all the proposals under consideration and choose which to include.

You've started such a proposal. But you need to make your case why this should be included. You need to show, with evidence, that this is something that fits the criteria.

Sam and Philip aren't arguing against this technology. They are attempting to let you know what's missing from your proposal. They are trying to help you. Every proposal needs to include certain information. Just like any proposal — applying for a job, admission to college, or for a grant — you have to pitch your case. And your's simply isn't complete yet. And because of that, it's likely to not make it.

So make your case!

Don't assume everyone reading this already knows all about font-style for variable fonts with either Slant or Italic axes. Read the README for details about what's expected. Explain: what is the current state? Is the web standard done? Who's implemented so far? What's missing for interoperability? How will including this in Interop 2023 help the web?

There won't be time for everyone involved to go individually do this research. We need you to gather all the information and present it for us, so we can take this under consideration.

@thlinard
Copy link
Author

@thlinard I think you are misunderstanding what's going on.

Interop 2023 is accepting new proposals from Sept 15 - October 15. After that, the team involved with the project will take all the proposals under consideration and choose which to include.

You've started such a proposal. But you need to make your case why this should be included. You need to show, with evidence, that this is something that fits the criteria.

Sam and Philip aren't arguing against this technology. They are attempting to let you know what's missing from your proposal. They are trying to help you. Every proposal needs to include certain information. Just like any proposal — applying for a job, admission to college, or for a grant — you have to pitch your case. And your's simply isn't complete yet. And because of that, it's likely to not make it.

So make your case!

Don't assume everyone reading this already knows all font-style for variable fonts with either Slant or Italic axes. Read the README for details about what's expected. Explain: what is the current state? Is the web standard done? Who's implemented so far? What's missing for interoperability? How will including this in Interop 2023 help the web?

There won't be time for everyone involved to go individually do this research. We need you to gather all the information and present it for us, so we can take this under consideration.

I understand that you're trying to help me and I thank you for that, but please also consider that I'm trying to put forward an idea which is not without merit: when a feature is not already supported by Chrome or Safari, there is little chance that this will interest any developer. So if the criterion is "prove that it interests lots of developers", it's lost in advance.

I think I can show how the lack of support beyond Firefox creates a crippling "chicken and egg" situation: how it prevents Google, or anyone, from releasing variable fonts with an italic axis (which would not work for the vast majority of users) and therefore why interest cannot emerge because there are no fonts available. But if I have to prove an interest in something that only works with Firefox, and therefore isn't used by anyone, I don't know how to do that.

But certainly I can better explain the current situation, and I'll do that.

@jgraham
Copy link
Contributor

jgraham commented Sep 19, 2022

when a feature is not already supported by Chrome or Safari, there is little chance that this will interest any developer

That's not really the case; developers expressing an interest in using features that aren't yet widely implemented is common where those features are addressing unmet needs. For example container queries and subgrid both showed up as prominent requests in developer feedback surveys before they were implemented across browsers (or at all).

@foolip
Copy link
Member

foolip commented Sep 20, 2022

@thlinard in addition to making the rationale as strong as you can, it would be great to ensure the spec is in order and the tests match it.

Does w3c/csswg-drafts#3125 need to be resolved before the spec is clear on what should be implemented?

And can the tests in https://arrowtype.github.io/vf-slnt-test/ be turned into tests in web-platform-tests? In particular, is a special test font needed for this? The tests as now structured require a human to look for pink, and that's not easily done in WPT. The easiest is if it's possible to write reftests, which compare two pages pixel-by-pixel, optionally with some fuzziness allowed.

@thlinard
Copy link
Author

Does w3c/csswg-drafts#3125 need to be resolved before the spec is clear on what should be implemented?

In my opinion this is a minor point. The main thing that things as old as <i> and font-style: italic; work (by the way, maybe that's a source of the problem: nobody asks because everyone expects it works, and if not, they blame the font, not the browser). Resolve a lack of clarification in the CSS specs on what to do with font-style: oblique XXdeg; and a font that has only an ital axis would be a plus, for sure: in https://arrowtype.github.io/vf-slnt-test/, the expected result for Firefox is 🤷).

And can the tests in https://arrowtype.github.io/vf-slnt-test/ be turned into tests in web-platform-tests? In particular, is a special test font needed for this? The tests as now structured require a human to look for pink, and that's not easily done in WPT. The easiest is if it's possible to write reftests, which compare two pages pixel-by-pixel, optionally with some fuzziness allowed.

I just tried to draw attention to an issue, unfortunately I'm not the author of https://arrowtype.github.io/vf-slnt-test, @thundernixon is. @arrowtype or Stephen Nixon is much better qualified than me for such tests.

@drott
Copy link

drott commented Oct 6, 2022

FWIW I filed crbug.com/1371880 for what looks like redundant synthesis in the slnt cases of the test page.

Regarding this proposal:

  • I am tentatively in favor of fixing the slnt cases and having this be part of this proposal.

@foolip wrote:

And can the tests in https://arrowtype.github.io/vf-slnt-test/ be turned into tests in web-platform-tests?

  • Yes, it looks like https://arrowtype.github.io/vf-slnt-test/ is based on the open source Recursive font. Modifying the font and subsetting and building it into some static reference fonts makes it possible to build reftests. (There might be some clarification in the CSS spec needed of what a standard italic and oblique should map to in terms of slnt angle values applied to the font (can't tell off-hand)).

  • For the ital axis, I would like to see a stronger rationale. IMO (open to be convinced otherwise) the ital axis is more of a backwards compatibility concept in variable fonts and its mostly binary 0,1 representation is a bit add odds with variations, even if it's possible to map something like oblique 20deg to somewhere between that 0,1. For the latter case, ital usage is underspec'ed, hence [css-fonts-4] Behavior for variable fonts with 'ital' axis ambiguous / underspec'ed w3c/csswg-drafts#3125 is relevant.

Questions:

  • Can we agree on Interop targets without a set of tests? Where would the tests come from? @jfkthame, does Firefox use a set of tests to test italic & oblique with slnt fonts, which are non WPT tests?

@foolip
Copy link
Member

foolip commented Oct 6, 2022

Can we agree on Interop targets without a set of tests? Where would the tests come from? @jfkthame, does Firefox use a set of tests to test italic & oblique with slnt fonts, which are non WPT tests?

We'll need to have some tests to complete the proposal, since reviewing the tests is part of everyone deciding if they'd like to include this in Interop 2023 or not.

@jfkthame
Copy link

jfkthame commented Oct 6, 2022

Where would the tests come from? @jfkthame, does Firefox use a set of tests to test italic & oblique with slnt fonts, which are non WPT tests?

No, I don't recall that we have tests covering that.

As suggested above, creating a set of static reference fonts is probably the way forward for more extensive slnt tests.

(And as for the ital axis, I think it was a mistaken idea and just shouldn't exist....)

@thlinard
Copy link
Author

thlinard commented Oct 6, 2022

(And as for the ital axis, I think it was a mistaken idea and just shouldn't exist....)

Support for the slant axis would already be great, if you want I can limit the issue (in its title and its description) to that.

@drott
Copy link

drott commented Nov 4, 2022

FWIW I filed crbug.com/1371880 for what looks like redundant synthesis in the slnt cases of the test page.

This is now fixed in Canary.

webkit-early-warning-system pushed a commit to Ahmad-S792/WebKit that referenced this issue Jan 10, 2023
Change the default oblique angle from 20deg to 14deg
https://bugs.webkit.org/show_bug.cgi?id=248258

Reviewed by Myles C. Maxfield.

This patch is to align Webkit with Blink / Chromium, Gecko / Firefox and Web-Specification. This is also part of Interop 2023 proposal [1].

[1] web-platform-tests/interop#64

Merge - https://chromium.googlesource.com/chromium/src/+/8bfd7d5770ec70f47e84b5cf33961b437a87c5a7

Web-Specification - http://w3c.github.io/csswg-drafts/css-fonts-4/#valdef-font-style-oblique-angle-90deg-90deg

The specs refer to have default angle as 14deg - "The lack of an <angle> represents 14deg.".

The imported test cases are leveraging font from Stephen Nixon using the Open Font License [2].

[2] https://github.com/arrowtype/vf-slnt-test/blob/main/fonts/license-recursive-OFL.txt#L3

* Source/WebCore/platform/graphics/FontSelectionAlgorithm.h: Update "italicThreshold" and "normalItalicValue" from 20deg to 14deg
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable.html: Added Test Case
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable-ref.html: Added Test Case Reference
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-variable-expected.html: Added Test Case Expectations
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable.html: Added Test Case
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable-ref.html: Added Test Case Reference
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/slnt-backslant-variable-expected.html: Added Test Case Expectations
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-matching-expected.txt: Updated Test Expectations
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/resources/FontStyleTest-slnt_backslant-VF.woff2 Added Test Font
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/resources/FontStyleTest-slnt-VF.woff2: Added Test Font
* LayoutTests/fast/text/font-style-parse.html: Rebaselined
* LayoutTests/fast/text/font-style-parse-expected.txt: Rebaselined
* LayoutTests/platform/glib/TestExpectations: Add "Failure" Expectation with reference bug
* LayoutTests/platform/ios/TestExpectations: Add "Failure" Expectation with reference bug
* LayoutTests/platform/mac/TestExpectations: Add "Failure" Expectation with reference bug

Canonical link: https://commits.webkit.org/258722@main
@nairnandu
Copy link
Contributor

Thank you for proposing font-style for Variable Fonts with either slant or italic axes for inclusion in Interop 2023.

We wanted to let you know that this proposal was not selected to be part of Interop†int this year. For the ital axis there is an unresolved spec issue preventing interoperable implementations. For the slnt axis tests were added to WPT thanks to your report and this proposal. Nevertheless, we had many strong proposals, and could not accept them all.

For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

8 participants