News for hackers. Stuff that matters.
Re:Knuth and Plass line breaking algorithm in JavaScript by bzbarsky on Monday December 06, 2010 @05:38PM (#1977119)
One other thing. This algorithm, unless I'm missing something, doesn't handle situations in which the available widths are different for different lines in the paragraph, and in particular in which they available width for a line depends on the precise break positions and vertical alignment results of all the earlier lines in the paragraph. Handling this is required to correctly handle CSS floats. Greedy line-breaking does this by the simple expedient of fully laying out all previous lines in the paragraph before considering the next line.

There are no comments on this comment yet.