Skip to content

Typography bucket #13

Closed
Closed

Description

@jensimmons

Description
After web fonts were defined, and before variable fonts were invented, the CSS Font specification added powerful tooling for web designers & developers to use to create refined typography.

font-feature-settings is a CSS property that addresses the low-level plumbing for these ability. It has broad support across almost all browsers.
However, Authors are encouraged to never use font-feature-settings, and instead use font-variant-*.

This [font-feature-settings] property is a low-level feature designed to handle special cases where no other way to enable or access an OpenType font feature exists. Whenever possible, font-variant shorthand property or an associated longhand property, font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position should be used.

Authors cannot currently follow this advice, because not all browser have implemented all of the font-variant-* properties. This is holding back typography on the web.

Specifically, these two need to be implemented in Chromium:

Specification
CSS Fonts Module Level 4

Tests
font-variant-* tests

Rationale
State of CSS Survey 2021 reveals requests for typography improvements.

Activity

  1. changed the title [-]Font features & variations[/-] [+]font-variant-*[/+] on Nov 10, 2021
  2. changed the title [-]font-variant-*[/-] [+]font-variant-alternates + font-variant-position [/+] on Nov 10, 2021
  3. changed the title [-]font-variant-alternates + font-variant-position [/-] [+]Typography: font-variant-alternates + font-variant-position [/+] on Nov 10, 2021
  4. jensimmons commented on Nov 10, 2021

    @jensimmons
    ContributorAuthor

    If we want to add more typography things to this, we could add support for the IC unit. It's a unit important for typesetting CJK scripts. 1ic is the full width glyph in the element’s font, as represented by the “水”.

  5. jensimmons commented on Nov 10, 2021

    @jensimmons
    Author
  6. jfkthame commented on Nov 11, 2021

    @jfkthame

    If you're thinking of improving support (and interop) for text in CJK scripts, can I propose supporting the Segment Break Transformation rules, which have the potential to make CJK authors' lives considerably better:
    https://drafts.csswg.org/css-text-3/#line-break-transform

  7. jgraham commented on Nov 11, 2021

    @jgraham
    Contributor

    I think it would be useful to decide which are the highest priority areas in this proposal. Including all the specs/properties mentioned seems like it would end up with something that's too broad, and runs the risk of different implementations picking different subsets to prioritise, so not improving the actual interop. Is there data we can use to help narrow the scope to the features with highest impact?

  8. jensimmons commented on Nov 15, 2021

    @jensimmons
    ContributorAuthor
  9. foolip commented on Nov 22, 2021

    @foolip
    Member

    The Chromium bugs for font-variant-alternates and font-variant-position are here:
    https://bugs.chromium.org/p/chromium/issues/detail?id=716567
    https://bugs.chromium.org/p/chromium/issues/detail?id=1212668

    @jensimmons regarding the advice to use font-variant-alternates and font-variant-position instead of font-feature-settings, do you know if it's currently possible to use font-feature-settings to achieve the desired effect?

    If so, I see that usage of font-feature-settings is quite high, and I wonder if some of that is really working around lack of support for font-variant-*. That would be compelling evidence of a need. If someone can suggest things to search for in httparchive, I could give that a try.

  10. 13 remaining items

  11. added
    accepted
    on Dec 14, 2021
  12. changed the title [-]Typography: font-variant-alternates + font-variant-position [/-] [+]Typography bucket[/+] on Dec 16, 2021
  13. foolip commented on Dec 16, 2021

    @foolip
    Member

    @gsnedders said on the Matrix channel:

    https://wpt.fyi/results/?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&q=legacy-mb%20or%20iso-2022-jp-%20or%20ic-unit%20or%20font-variant is in principle vaguely what we want for what the typography issue became, but also calling that all "typography" seems a bit questionable.

    I agree. Does anyone have suggestions for another name for this bucket? Or could it make sense to slot encodings under the webcompat bucket, if it has caused any broken sites? @achristensen07 WDYT?

  14. karlcow commented on Dec 17, 2021

    @karlcow

    What about "Font Parametrization bucket"?

  15. foolip commented on Dec 20, 2021

    @foolip
    Member

    @karlcow https://encoding.spec.whatwg.org/ doesn't really fit well under that banner either. But @annevk suggested just "text" which I think would work.

  16. gsnedders commented on Dec 20, 2021

    @gsnedders
    Member

    I've labelled them as interop-2022-text based on @annevk's suggestion, but I'm by no means wedded to that name.

  17. foolip commented on Jan 10, 2022

    @foolip
    Member

    Thanks @gsnedders! It would be great if someone from each browser engine team can look over interop-2022-text and comment if there are any issues.

  18. jfkthame commented on Jan 10, 2022

    @jfkthame

    The font-variant descriptor (as distinct from the font-variant property) was dropped from CSS Fonts (as noted at https://drafts.csswg.org/css-fonts-4/#changes-2018-09-20), which means a few of the tests currently listed are not valid. At first glance, this affects font-variant-05.xht, font-variant-06.xht, and font-variant-descriptor-01.html.

  19. gsnedders commented on Jan 13, 2022

    @gsnedders
    Member

    From the discussion earlier, @foolip was going to remove many of the tests in encoding, given most already pass. I'd added everything that followed from "including CJK text encoding", not limiting it to the parts particularly mentioned.

    These are the tests which don't pass everywhere, which is 8 tests rather than 1209 tests. However, even among those 8 many of those are any.js tests, and it's unclear there's any value to running those in different environments. Do we just want to go down to these five tests?

  20. gsnedders commented on Jan 13, 2022

    @gsnedders
    Member

    web-platform-tests/wpt-metadata#2388 does duly remove the vast majority of the tests (down to six, keeping decode & encode tests for each of three encodings, despite gb18030 encode being interop already).

  21. jensimmons commented on Feb 17, 2022

    @jensimmons
    ContributorAuthor

    For reference, this is what we debated and decided.

    Technology Considered Decision
    font-variant-alternates + font-variant-position Include
    IC unit (CJK focused) Include
    hanging punctuation (JP focused) Exclude
    Initial Letter Exclude
    Color fonts Exclude
    Segment Break Transformation rules Exclude
    CJK text encoding Include
  22. added
    focus-area-proposal
    and removed on Sep 16, 2022
  23. added this to the Interop 2022 milestone on Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfocus-area-proposal

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions