4 ms·
There has to be some kind of method that does a better job balancing line widths than the naïve greedy version, and is compatible with whatever requirements bro
by jacobolus 8y ago
There has to be some kind of method that does a better job balancing line widths than the naïve greedy version, and is compatible with whatever requirements browsers are subject to.
Can someone hire some grad students to tackle this or something? We are talking about a significant proportion of all reading people do every day, all over the world.
A pocket computer that can do hundreds of billions of arithmetic operations per second should be able to make text as pretty as an apprentice typesetter from 1600.
- pcwalton 8y agoAs stated before, the only algorithm that satisfies the constraint that floats must be placed as high as possible is the greedy one (or, to be more precise, any such algorithm must match the output of the greedy one).
- sjwright 8y agoWhy not just make this algorithm a non-default option (like hyphenation) and accept that when it's enabled floats may not be optimal?
- pcwalton 8y agoSure, an opt-in may be possible. But it requires some spec work and isn't something browsers can just do right now. As gsnedders points out, we'd probably have to spec the entire algorithm to avoid causing compatibility problems in the future.
- galaxyLogic 8y agoAs you suggested if there are no floats there would be no reason to NOT use the better algorithm. I personally don't use floats often and definitely not inside paragraphs. As suggested by others bad line-breaking has a bad effect on the large reading population. Also I hope they can do the thing to adjust spaces on the line so all lines look about the same length.