-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-text-4] Suggest algorithm for multi-line #803
Comments
Agree 100% with doing this. Just need @liamquin to give me a reference I can point at... |
An algorithm i've used in the past is
The Knuth-Plass algorithm tends to have some nasty edge cases (e.g. when TeX says "overfull hbox" at you) making it less than ideal for formatting where the author isn't reviewing the results. E.g. sometimes it decides to put only two words or word fragments on a line, one at each end with a huge gap, rather than have several hyphens in a row. It's also NP-complete in performance (on the number of potential word fragements after hyphenation in th paragraph). where the "move lumps back" compromise is either linear or at worst n^2 if you do it recursively, with n being the number of lines. |
css-text-4 introduces
text-wrap: multi-line
As discussed in #672 (comment), It could be useful to give a suggestion as to one possible algorithm. This would not prevent implementors from trying to come up with something better, but for those who are willing to go ahead an implement this without themselves being experts at line breaking algos, giving a reasonably non controversial baseline approach would be useful.
The text was updated successfully, but these errors were encountered: