Re: [csswg-drafts] [css-text] Line-end behavior of text-spacing-trim: space-first (#9736)

> The allow-end style
> is often preferred over the trim-end style
> because it has no extra spacing between letters, even if the line length is not so short.

I think that corresponds to figure 78 in JLREQ. But in that case, is it not simply a preference for start-alignment over justification? If we use start alignment, the result is exactly the same.


However, if we use justification, even the allow-end style doesn't guarantee no extra spacing between letters, even if the line length is an integer number of ems. Since `space-first` trims at the start of the line (except the first one), lines which begin with an opening parenthesis will have a non integer number worth of characters on the line, and will expand between the letters if you justify. The same is true for lines with adjacent punctuation getting trimmed in the middle of the line, or being off-grid for any other reason (`text-autospace` inserting some small gaps, some non CJK content with half-width or proportional characters, a different font size, some inline image…).So, if people don't want the line to expand between letters, they should not be using justification at all, in which case both approaches are equivalent.

But for people who are OK with space between letters being inserted by justification, the trim-end behavior gives more consistently flush edges.

Are there cases where people want justification, and are ok with space being inserted between letters, but only if the off-grid rhythm comes from trimming at the start of the line, or from trimming adjacent punctuation, or from non CJK content, or from using a different font size on part of the line, but not if it comes from trimming punctuation at the end of the line? That seems surprising to me.

>>     This half em spacing can be removed for line adjustment (for more about line adjustment, see § 3.8 Line Adjustment).

> This description seems to match the allow-end behavior.

It's not clear to me that it does. In my reading it (and 3.8) look like they're talking of the trim-end behavior: both trim-end and allow-end do remove the half em spacing for line end adjustment. But allow-end excludes a case (line end adjustment due to justification), and I don't see any part of the text discussing that exception. Did I miss something?

In https://github.com/w3c/csswg-drafts/issues/9511#issuecomment-1863918994, talking about space-first with allow-end you said:
> I think this setting is good enough for such Japanese contents.

I agree it is good enough: the difference is fairly small, and doesn't matter, so I will not object if that's the way we want to go. But it seems to me that the behavior with trim-end is the same if you don't want to justify, and a little bit better if you do, without any meaningful downside.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9736#issuecomment-1865827566 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 21 December 2023 08:07:56 UTC