W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: [css3-text] Balance Text proposal

From: Scott Johnson <sjohnson@mozilla.com>
Date: Wed, 30 Jan 2013 17:55:38 -0600
Message-ID: <5109B2FA.3090300@mozilla.com>
To: Randy Edmunds <redmunds@adobe.com>
CC: "www-style@w3.org" <www-style@w3.org>
Hi Randy:

I'm wondering whether your proposal will affect pagination of text.

Specifically, I'm thinking of a case where we had two pages (or perhaps
columns, if that's easier to think about), such that the text-wrap would
make one column more narrow, does this affect balancing of columns?

~Scott

Thus Spoke Randy Edmunds:
>
> 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 23:56:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT