Skip to content

[css-text] text-spacing is very complicated #4246

Closed

Description

@litherum

text-spacing is getting very complicated now. By my count, the current grammar accepts 769 different combinations of values (770 if you count auto). It's probably worth an investigation to determine which of these combinations are actually useful.

Activity

  1. frivoal commented on Sep 10, 2019

    @frivoal
    Collaborator

    There probably are a number of unnecessary combinations in there indeed. We should get help from JLReq to figure which ones are essential.

    cc: @r12a @macnmm @fantasai @MurakamiShinyu

  2. changed the title [-]text-spacing is very complicated[/-] [+][css-text] text-spacing is very complicated[/+] on Sep 11, 2019
  3. MurakamiShinyu commented on Sep 15, 2019

    @MurakamiShinyu

    I think that the text-spacing property is like a short hand property such as font-variant whose total number of combinations is very large and hard to reduce.

  4. litherum commented on Sep 17, 2019

    @litherum
    ContributorAuthor

    @dauwhe mentioned that Prince has something similar (prince-text-replace?). Perhaps he has some insight into how to better design text-spacing.

  5. dauwhe commented on Sep 17, 2019

    @dauwhe
    Contributor

    Here's the PrinceXML property in action. It finds a period followed by a space, and replaces it with a period followed by an em-space (U+2003). PDF of the result attached.

    p.space {
      prince-text-replace: ". " ".\2003";
    }

    This has lots of problems, not least because you can't define under what context the replacements happen.

    prince-text-replace.pdf

  6. added
    i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.
    and removed on Dec 5, 2019
  7. kojiishi commented on Dec 8, 2022

    @kojiishi
    Contributor

    How about considering splitting into multiple longhands? I recall that was the original plan of @fantasai when this property gets more matured?

    As suggested in #4246 (comment), similar to font-variant, having multiple longhands allows authors to change one of them without changing other values, such as enabling/disabling just ideograph-numeric oly for some text, or disabling no-compress only for a span.

    Doing so might also address #7183, and it looks like there's a mild consensus on in at TPAC. /cc @r12a

    For implementers, testing the parser for the 770 combinations of values without errors is not an easy task. Splitting to multiple longhands and using the existing already-tested mechnism for shothand helps.

  8. macnmm commented on Jan 5, 2023

    @macnmm

    The JIS standard defines a set of character classes and their relationships in terms of a spacing range and compression/expansion priority, but there are problems with how these classes are defined (not differentiating between proportional/half-width/full-width for example) as well as no consideration of mixed script text. We need a modular approach that defines the character classes, the spacing ranges (with priority) of each class pairing, according to the needs of the UA and how fancy it wants to be when supporting complex layout. A reasonable default behavior could also be proposed as part of the jlreq, I would hope, so the spec could then be about a sparse override of the default.

  9. litherum commented on Jan 20, 2023

    @litherum
    ContributorAuthor

    Agenda+ to discuss the possibility of splitting up the property into longhands (just like how we did with text-decoration-skip)

    text-spacing is something we’d like to start implementing soon (weeks not months).

  10. 33 remaining items

  11. added a commit that references this issue on Feb 21, 2023
  12. fantasai commented on Feb 28, 2023

    @fantasai
    Collaborator

    OK, we've edited in the refactoring described in #4246 (comment) as resolved by the CSSWG, along with the suggestion to rename trim-all to trim-auto per @MurakamiShinyu's #4246 (comment).

    Follow-up issues filed:

    Please file additional follow-up issues if anything else needs fixing. Thanks!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions