Re: [css3-text] wrapping text while keeping line lengths balanced

On Fri, Apr 20, 2012 at 6:09 PM, fantasai <fantasai.lists@inkedblade.net>wrote:

> IIRC there was previously a proposal for a 'last-line-length' or some
> such property, which would set a minimum length to fill for the last
> line. (Other lines are considered to be 100%.) This would handle your
> use case: you'd set it to 100%.
>
> The problem is this would require a line-breaking algorithm that does
> full-paragraph line balancing, and no one has stepped forward to say
> they want to implement that. And so I have not bothered to spec that.
>

FYI: the simpler approach I suggested on the WebVTT list is to find the
narrowest width that doesn't result in more lines than the ordinary
wrapping algorithm.  That can be done in linear time, and seems to give
decent results.  https://zewt.org/~glenn/balanced-wrapping.html shows the
idea.

-- 
Glenn Maynard

Received on Friday, 20 April 2012 23:50:38 UTC