moo...@google.com, dr...@google.com
https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-position
https://drafts.csswg.org/css-fonts-4/#propdef-font-variant-position
The font-variant-position CSS property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript.
Font-variant-position property allows users to control usage of typographic superscript and subscript glyphs.
Currently font-variant-position is implemented without synthesis functionality and affects only fonts that have superscript or subscript glyphs (“sups”/”subs” opentype feature); i.e. if the font doesn’t have superscript/subscript then setting font-variant-position to “super”/“sub” won’t synthesize superscript and subscript glyphs, therefore won’t change anything.
Subscript and superscript glyphs can be also activated using the font-feature-settings property, however using font-variant-position property might be more reasonable since it cascades like a regular CSS property and with the font-feature-settings, if the element inherits the “sups” or “subs” value, users need to activate/deactivate other features that were also defined in font-feature-settings of the parent element.
Implementing the synthesis part would be complex and it is questionable if it is worth the cost since synthesized glyphs may look unnatural and synthesis of the font-variant-position property is at risk in the spec. Also Safari supports font-variant-position property without synthesis functionality as well.
This feature is implemented behind the ‘experimental’ flag and is part of Interop 2022. Shipping this feature will provide a higher stable score for Interop and will decrease the stable vs. experimental score difference.Since Chrome is the last browser to ship this, this will enable broader usage of the feature on the web.
font-variant-position, subscript glyphs, superscript glyphs, sub, super
Already shipped in other browsers, see below, no TAG review required.
Not applicable, existing standard, shipped in other UAs
Gecko: Shipped/Shipping
https://bugzilla.mozilla.org/show_bug.cgi?id=1024804 Gecko has implemented the feature with the synthesis functionality.
WebKit: Shipped/Shipping
https://bugs.webkit.org/show_bug.cgi?id=148413 WebKit has implemented the feature without the synthesis functionality.
Web developers: No signals
Other signals: -
None expected; Feature already implemented in other browsers.
Same as any other CSS property, css_properties.json will be rolled to DevTools during development.
Yes
Yes, following tests are testing property implementation:
https://wpt.fyi/results/css/css-fonts/font-variant-position.html
https://wpt.fyi/results/css/css-fonts/font-variant-position-01.html
https://wpt.fyi/results/css/css-fonts/font-variant-position-02.html
https://wpt.fyi/results/css/css-fonts/font-variant-position-03.html
https://wpt.fyi/results/css/css-fonts/parsing/font-variant-position-valid.html
https://wpt.fyi/results/css/css-fonts/parsing/font-variant-position-computed.html
https://wpt.fyi/results/css/css-fonts/parsing/font-variant-valid.html
FontVariantPosition
False
https://bugs.chromium.org/p/chromium/issues/detail?id=1212668
No milestones specified
None expected
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAO7W_C-aHBXYr1mp%3DiJkTQEPgP-isxxv-u-Uv%3DyO4Mp9b_j5Q%40mail.gmail.com.
One of the ways to detect whether a font has super/subscript glyphs is to check whether the font with the feature has loaded (using document.fonts for instance) and if it did then we won’t synthesise.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/eba52bce-1e12-48af-a867-bea424f7a1a2n%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfX3ZjLqXXO3XZWpLebMSFAaA15m6gvi0BA%3DfC1xU4KrXw%40mail.gmail.com.
On Fri, Feb 24, 2023 at 11:27 AM Manuel Rego Casasnovas <re...@igalia.com> wrote:There's a CSSWG issue about this topic in particular:
https://github.com/w3c/csswg-drafts/issues/7441Is this something that can be put on the agenda for the CSSWG to discuss?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAG0MU3ht%3DrZwCtQoUWJXR4avCaY2TvAa9NMiYAfMsdan94wzVw%40mail.gmail.com.
It's a shame to me to be holding back interop on the case of fonts having the superscript or subscript glyphs out of fear for the case where they don't. Perhaps we can treat the case of font-variant-position being used with fonts that lack the glyphs as a site bug that we can work to address independently? Personally, as long as Safari and Chrome behave the same here, I'm skeptical that the lack of synthesis would turn into a non-trivial problem in practice.
If we were to ship without synthesis, would it be practical to have a UseCounter which measures how often we see font-variant-position used with a font that lacks the glyphs? This would tell us how important the bug is. If it remains really rare, then IMHO we've probably already wasted more energy worrying about it than it's worth. If it becomes more common over time then I think we have a variety of options, chiefly implementing synthesis, but also raising awareness with devtools features, UKM-based site-specific outreach, and possibly even interventions of some form (like using a fallback font?).
So if it makes sense to add use counters to understand the compatibility implications here, I think it may be worth adding what we would need to understand the breakdown of how many sites are using this in a way that (a) is interoperable across browsers/machines versus (b) is broken in some browsers and working on others versus (c) is broken on some machines and working on other machines, even using the same browser. I suspect this would mean something like measuring how often we see font-variant-position used with a system font versus a downloadable font. (This might also need to be recorded along with the data on whether the font has or lacks the superscript/subscript glyphs, because the intersection of the two might be interesting.)
As is, this measurement may read too high (see above: initial shaping with fallback font), but potentially we can filter that measurement and only report selection of the feature vs. support in a successfully loaded web-font. Development of such a measurement takes from 2 days to 9 days, depending on complexity (very basic, no distinction of font-feature-settings and font-variant-position, no distinction of system fonts to complex: distinguish font-feature-settings from font-variant-position, distinguish system fonts, web fonts).
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY9fMAG16L3_KweN4FnnSnVsfevxHyH2qfdN1B42ef1Xmg%40mail.gmail.com.
LGTM2
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY-SQGewKUSrL0MGTXh_L3DU_RSfah2t8SrS8K3FPaeR2g%40mail.gmail.com.
LGTM3
/Daniel