Safari shipped the first reasonable implementation of the CSS text-wrap: pretty property in 2025, which uses dynamic programming algorithms similar to those developed by Knuth and Plass for TeX to optimize line breaks for more balanced paragraphs. However, the feature produces excessive whitespace between words when combined with text-align: justify because the line-breaking algorithm targets a narrower width than the maximum, causing systematic overshoot when text is later justified to full width.
1 comment
Safari shipped the first reasonable implementation of the CSS
text-wrap: prettyproperty in 2025, which uses dynamic programming algorithms similar to those developed by Knuth and Plass for TeX to optimize line breaks for more balanced paragraphs. However, the feature produces excessive whitespace between words when combined withtext-align: justifybecause the line-breaking algorithm targets a narrower width than the maximum, causing systematic overshoot when text is later justified to full width.