csswg-drafts icon indicating copy to clipboard operation
csswg-drafts copied to clipboard

[css-fonts] Support avar2 within tech() to support using the next generation of variable fonts tech

Open davelab6 opened this issue 1 year ago • 12 comments

https://web.dev/articles/variable-fonts#loading_variable_font_files gives this CSS example for loading Roboto Flex, an advanced variable font:

@font-face {
    font-family: 'Roboto Flex';
    src: url('RobotoFlex-VF.woff2') format('woff2-variations');
    src: url('RobotoFlex-VF.woff2') format('woff2') tech('variations');
    font-weight: 100 1000;
    font-stretch: 25% 151%;
}

However, a new version is under development, https://github.com/googlefonts/roboto-flex-avar2 , and this uses the new avar v2 table instead of the current v1 one, as pioneered in https://github.com/harfbuzz/boring-expansion-spec and can be inspected and authored with https://lorp.github.io/fencer/src/fencer.html

Therefore I would like to be able to do this in my CSS

@font-face {
    font-family: 'Roboto Flex';
    src: url('RobotoFlex-VF-avar2.woff2') format('woff2-variations-avar2');
    src: url('RobotoFlex-VF-avar2.woff2') format('woff2') tech('variations-avar2');
    src: url('RobotoFlex-VF.woff2') format('woff2-variations');
    src: url('RobotoFlex-VF.woff2') format('woff2') tech('variations');
    font-weight: 100 1000;
    font-stretch: 25% 151%;
}

@lorp @simoncozens @twardoch

davelab6 avatar Jul 19 '24 16:07 davelab6

@jfkthame @drott

svgeesus avatar Jul 19 '24 17:07 svgeesus

Yes please

Lorp avatar Jul 20 '24 01:07 Lorp

I would be in favor of adding avar2 to the <font-tech> production in https://drafts.csswg.org/css-fonts/#font-face-src-parsing

Then the example would work with src: url('RobotoFlex-VF-avar2.woff2') format(woff2) tech(avar2) or src: url('RobotoFlex-VF-avar2.woff2') format(woff2) tech(variations,avar2)

drott avatar Aug 02 '24 12:08 drott

What is needed to make this happen? :)

davelab6 avatar Sep 25 '24 07:09 davelab6

https://github.com/w3c/csswg-drafts/labels/Agenda%2B to get resolution on this.

I am in favor.

svgeesus avatar Sep 25 '24 17:09 svgeesus

Thanks @svgeesus :) When might we here hear any news? :D

davelab6 avatar Oct 16 '24 06:10 davelab6

When might we here hear any news?

When the agenda item gets discussed, it will be reported here.

svgeesus avatar Oct 16 '24 13:10 svgeesus

For a specification link, OT 1.9.1 still says:

Major version number of the axis variations table — set to 1.

Which OT version will define v2 of avar?

svgeesus avatar Oct 16 '24 19:10 svgeesus

I see avar v2 in the Committee Draft of the 5th edition ISO/IEC 14496-22/CD "Open Font Format" which went for ballot in August this year.

@vlevantovsky is there an estimated timeline for this to make IS?

svgeesus avatar Oct 16 '24 20:10 svgeesus

is there an estimated timeline for this to make IS?

The progression of the document depends on the ballot responses. If this CD is approved with no major changes, then the document will likely be finalized / published by the end of 2025. If, however, the CD comments will warrant substantial technical changes, then the second CD ballot may be issued, and the overall progression of the document will be delayed until mid-2026.

vlevantovsky avatar Oct 16 '24 21:10 vlevantovsky

The question then is whether to add this to CSS Fonts now (with a temporary pointer to the avar v2 proposal on GitHub) or whether to wait until it is ratified. It seems there is implementer interest, so it would be better to add it now.

svgeesus avatar Oct 17 '24 15:10 svgeesus

I'm seeing only positive feedback to adding tech(avar2). Is anyone opposed?

If there is no negative feedback then I will add it so that the spec doesn't lag behind active implementations (with a temporary reference, for now).

svgeesus avatar Oct 24 '24 18:10 svgeesus

Another question is whether to add it to CSS Fonts 4 Font Technologies and Formats or to a new, Font Technologies and Formats section in CSS Fonts 5. Given the level of spec maturity, my feeling is to add it to Fonts 5.

svgeesus avatar Oct 29 '24 13:10 svgeesus

@svgeesus could this be an async resolution?

astearns avatar Dec 03 '24 01:12 astearns

@svgeesus could this be an async resolution?

@astearns yes, certainly

svgeesus avatar Dec 03 '24 23:12 svgeesus

The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment.

Proposed Resolution: Add avar2 to the <font-tech> production

astearns avatar Dec 04 '24 01:12 astearns

RESOLVED: Add avar2 to the <font-tech> production

astearns avatar Dec 12 '24 17:12 astearns

@davelab6 @Lorp now in the CSS Fonts 5 spec:

7. Font Technologies and Formats

svgeesus avatar Dec 18 '24 19:12 svgeesus

Great to hear

Lorp avatar Dec 18 '24 22:12 Lorp