by pcwalton · 7y ago · 0 comments
It might be possible to use Knuth line breaking in specific circumstances, such as when paragraphs have no floats. But not in general.
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.
Filed https://github.com/w3c/csswg-drafts/issues/3756 for this.
Regardless, if it is the case the web relies on this, we should just make it explicitly required to do greedy line breaking. Relying on an implication from here isn't great.
> It might be possible to use Knuth line breaking in specific circumstances, such as when paragraphs have no floats. But not in general.
If the CSS specification was updated to add vastly improved line-breaking to all text, would it really be that big a deal to add a few new exceptions to go with it? E.g. make floats behave differently when different line-breaking is used.
There's already plenty of cases in CSS of "oh, that doesn't work there because you're using inline/absolute/float/overflow". It's not like the rules are particular minimal or intuitive right now.
2. One could just determine the height of the float ceiling with the greedy algorithm and run the optimization algorithm with that constraint