Re: [w3ctag/design-reviews] text-wrap: pretty (Issue #864)

@LeaVerou asked me to explain this feature and the potential compat impact etc.

> This feature adjusts line breaking to avoid a short single word on the last line (also known as typographic orphans.)

This is not an accurate description. The `text-wrap: pretty` value is defined to ask the UA to apply more resources into line-wrapping and justification in order to make the text look “prettier”. The concerns that this is expected to balance include

- reducing the raggediness of the lines (reducing variance in their lengths), which makes the end edge look more even when not justified, and reduces the variation in justification space adjustments between lines when fully justified, thus improving readability as well as aesthetics
- avoiding [rivers](https://en.wikipedia.org/wiki/River_(typography))
- applying smarter line-breaking prioritization, to avoid awkward breaks
- etc.

Avoiding too-short last lines is certainly one aspect that can be considered by a UA for `text-wrap: pretty`, but it's only one of the things we expect the UA to consider. So while an implementation that only adjusts the last line length in response to `text-wrap: pretty` would be conformant to the spec (which gives a lot of leeway on interpreting `pretty`), it's a limited interpretation.

This presents a risk that authors, who really really want last-line length adjustment, will interpret `text-wrap: pretty` as a “make the last line length less short” control rather than “do lots of different expensive things to make it prettier”. I'm not entirely sure of the compat impact of that going forward, but it's something to consider. I am fairly sure, however, that it will create some confused messaging when the feature is evangelized, though, as it will be taught as “use this weird hack to fix your too-short last lines”.

I'll note there's also been discussion over the years of having a specific control for last line length; there's no draft yet because implementations weren't interested until now. But we do have the possibility of providing a specific feature for this specific implementation feature, and that may be a better path forward for this feature request.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/864#issuecomment-1644155267
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/864/1644155267@github.com>

Received on Thursday, 20 July 2023 15:39:47 UTC