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

From the discussions above, here's the proposal for the level 4 "switch":
```css
letter-spacing-behavior: auto | between | right
```
<dl>
<dt>auto</dt>
<dd>

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`.
</dd>
<dt>between</dt>
<dd>

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.
</dd>
<dt>right</dt>
<dd>
Add the spacing to the right of every character or atomic inline.
</dd>
</dl>

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