Skip to content

[css-text-4] Text-spacing is too strict #3229

@litherum

Description

@litherum

https://drafts.csswg.org/css-text-4/#text-spacing-property

The spec states:

ideograph-alpha
Creates 1/4em extra spacing between runs of ideographs and non-ideographic letters.

... and includes definitions of "ideographs" and "non-ideographic letters."

Later, the spec also provides required collapsing rules:

Set fullwidth opening punctuation half-width if the previous character is a fullwidth opening punctuation, fullwidth middle dot punctuation, or ideographic space (U+3000), or if the previous character is a fullwidth closing punctuation of an equivalent or larger font-size. Else set it full-width.
Set fullwidth closing punctuation half-width if the next character is a fullwidth closing punctuation, fullwidth middle dot punctuation, or ideographic space (U+3000), or if the next character is a fullwidth opening punctuation of a larger font-size. Else set it full-width.

When discussing this with our team of designers at Apple, it turns out that we have our own similar behavior for native text. Our design team at Apple does increase spacing between script changes and decrease spacing between adjacent punctuation on a line, and the details of how we do it are similar but don't exactly match JLREQ or CSS. We used JLREQ as an input to the design, but there were other inputs too. From speaking to our designers, it turns out the specific rules for exactly how much space to expand or shrink can vary from one design house to the next.

Therefore, I'd like to propose the following changes to the spec:

  1. In the above description of ideographic-alpha and ideographic-numeric, change "Creates 1/4em extra spacing between" to "Creates extra spacing between."
  2. Provide some wiggle room around what the UA determines as "ideographs" and "non-ideographic characters" for the purpose of this property. The spec should continue to state that the desire is to add spacing between ideographs and non-ideographic letters, but the spec should let the classification be UA-dependent.
  3. Remove "(or the font has proportional fullwidth punctuation glyphs)." Fullwidth characters should be fullwidth; if they're not, the font is broken.
  4. In the Fullwidth Punctuation Collapsing section, change "Set fullwidth ... punctuation half-width if the" to "Set fullwidth ... punctuation narrower". Similarly to above, allow some wiggle room around exactly which characters this rule applies to.
  5. Also, modify the Fullwidth Punctuation Collapsing section to allow for extra UA-dependent or platform-dependent rules that are not present in the spec. These other rules should be allowed to affect non-punctuation characters.
  6. All of these text-spacing rules should be locale-sensitive. When a UA sees lang="ja" on content, it should be free to modify the spacing differently than when it sees lang="zh-Hans".
  7. Once the text-spacing rules are locale-sensitive, delete the punctuation value. Make the mechanism for opting-out of fullwidth punctuation collapsing also opt out of the French narrow no-break space thing.
  8. Values ideographic-alpha and ideographic-numeric improve typography, and should be in the initial value of the property. (We realize this may not be possible given web compat, but we'd like to at least try.)

The goal of these modifications is not to wreck the intention of the property, but just to allow for more flexibility for different publishing houses to match their own internal style guide. For all of these relaxations, we can certainly add in some explanation about what good choices would be for a new implementation.

P.S. "Unless text-spacing is set to space-adjacent or none" is perhaps not what is meant, since this property includes a bunch of other values in addition to those. Perhaps it should be "Unless text-spacing includes space-adjacent or none?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Editscss-text-4i18n-clreqChinese language enablementi18n-jlreqJapanese language enablementi18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions