W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2020

Re: [csswg-drafts] [css-text] letter-spacing should not apply to the end edge of a line/span? (#1518)

From: Koji Ishii via GitHub <sysbot+gh@w3.org>
Date: Sat, 25 Jul 2020 13:46:31 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-663857434-1595684790-sysbot+gh@w3.org>
From the discussions above, here's the proposal for the level 4 "switch":
letter-spacing-behavior: auto | between | right

The behavior is determined by the following conditions:
* If the resolved direction of the character or atomic inline is `rtl`, the behavior is undefined.
* For CSS, if the _`letter-spacing` run_ (see `between` below) includes the rightmost in-flow fragment of a wrapped line after the bidi reorder, the behavior is undefined.
* For SVG, if the _`letter-spacing` run_ is at the right edge of a SVG text after the bidi reorder, the used value is `between`.
* Otherwise the used value is `right`.

When computing line wrapping, this value is the same as `right`.

Compute _`letter-spacing` runs_ after lines are wrapped and the bidi reorder was applied, but before computing alignment and justifications. A _`letter-spacing` run_ is a sequence of inline fragments that have the same used value of the `letter-spacing` property. Then for each _`letter-spacing` run_, remove the rightmost spacing.
Add the spacing to the right of every character or atomic inline.

Note, this `between` behavior may make lines to underflow if positive `letter-spacing`, or overflow if negative `letter-spacing`. I think this is acceptable because when `letter-spacing` is negative, glyphs may look overflowing anyway. The `between` behavior only changes how much they overflow.

GitHub Notification of comment by kojiishi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1518#issuecomment-663857434 using your GitHub account
Received on Saturday, 25 July 2020 13:46:32 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:11 UTC