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

Re: [css-text-4] text-wrap:balance

From: Florian Rivoal <florian@rivoal.net>
Date: Mon, 26 Jan 2015 00:02:24 +0100
Cc: www-style@w3.org
Message-Id: <63438344-249E-4129-B3A2-5712C4BDEA04@rivoal.net>
To: fantasai <fantasai.lists@inkedblade.net>

> On 25 Jan 2015, at 22:50, fantasai <fantasai.lists@inkedblade.net> wrote:
> 
> On 01/20/2015 04:18 PM, Alan Stearns wrote:
>> 
>> I hemmed and hawed a bit about adding another stipulation - lines only
>> balance *if* doing so does not change the number of lines. So a single
>> paragraph of:
>> 
>> Foo foo foo
>> foo foo foo
>> foo foo.
>> 
>> Would not change to:
>> 
>> Foo foo
>> foo foo
>> foo foo
>> foo foo.
>> 
>> 
>> Even though that gets you the best balancing result. For headlines and
>> captions, I think this is what’s usually intended (balance the lines, but
>> not if that makes an additional line). But I’ve heard some pushback on
>> this idea.
> 
> I think we do need to require that. Otherwise
> 
> Foo foo
> fooo fooo
> foo foo.
> 
> would end up balancing as
> 
> Foo
> foo
> fooo
> fooo
> foo
> foo.
> 
> Which is clearly silly.

I am not necessarily opposed to a restriction forbidding changing the number of
lines (as it would solve the question I raised earlier), but it isn't necessary
to prevent what you showed above.

What "minimize the deviation from the average line length" means is a bit
ambiguous, and different interpretations lead to different results, especially 
if if the number of lines can change. Minimize the sum of the absolute value of
differences from the mean? Minimize the mean of the absolute value of the
differences from the mean? Minimize the (population) standard deviation? I'll
spare you more variations around this theme you could get at by interpreting
"average" as "median" instead of "mean", even though I don't know which leads
to better results.

Applying this to your example:

1st rendering:
 - the mean is 7
 - total of differences is 2
 - mean of differences is 0.67.
 - std dev is 0.82

2nd rendering
 - the mean is 3.5
 - total of differences is 3
 - mean of differences is 0.5
 - std dev is 0.5

If we go with total of differences, we'd keep the first rendering even without
requiring the number of lines to be constant. In some cases, this definition
together with permission to change the number of lines could be an improvement.
For example:

Fooo foo
fooooooo foo
fo fo fooooooo

becomes

Fooo foo
fooooooo
foo fo fo
fooooooo

which is better balanced and not silly. The stats here are:

mean: 11.33 / sum-diff: 6.67 / mean-diff: 2.22 / std-dev: 2.49
vs
mean: 8.25 / sum-diff: 1.5 / mean-diff: 0.38 / std-dev: 0.43

 - Florian
Received on Sunday, 25 January 2015 23:02:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:56 UTC