[css3-text] Balance Text proposal

Hi www-style,

I would like to propose a new value for the text-wrap property: 'text-wrap:balance'

The basic algorithm for rendering text is simple: put as much text as will fit on each line, with the remainder on the last line. This results in the fewest possible lines of text being used, but when a short run text (such as in a title) breaks across two lines the result can sometimes be visually undesirable.

When rendering text that spans multiple lines, this feature provides the option to automatically balance text across the same number of lines.

The intended usage for balance text algorithm is for short text elements such as headings, blockquotes, labels, and captions. When the algorithm is applied to large paragraphs of text, the effort increases and the benefit diminishes, so there may need to be a way to specify a maximum length of text.

As an example, take a title that's a little too wide to fit on one line:

Take a Look at this Balanced
Text

with 'text-wrap:balance' specified, the title would be rendered as:

Take a Look at
this Balanced Text


There's a JavaScript polyfill for this: https://github.com/adobe-webplatform/balance-text

I also describe an algorithm for implementing this : http://adobe-webplatform.github.com/balance-text/proposal/index.html


Regards,

Randy Edmunds
redmunds@adobe.com<mailto:redmunds@adobe.com>

Received on Wednesday, 30 January 2013 21:54:23 UTC