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

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

From: Alan Stearns <stearns@adobe.com>
Date: Fri, 6 Feb 2015 04:38:44 +0000
To: Peter Moulder <pjrm@mail.internode.on.net>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <D0FA89E1.239AC%stearns@adobe.com>
On 2/6/15, 3:02 PM, "Peter Moulder" <pjrm@mail.internode.on.net> wrote:

>On Fri, Feb 06, 2015 at 01:10:14AM +0000, Alan Stearns wrote:
>> > On Feb 6, 2015, at 11:57 AM, Peter Moulder
>><pjrm@mail.internode.on.net> wrote:
>> > 
>> > I'll write more later, but can I ask that we not add "balance"
>> > without also adding at least "heading" ?
>> Do you mean make the value "balance-heading" to distinguish the case
>> last line length? Or something else?
>Ah, I see the ambiguity.  By "add 'balance' without adding 'heading'", I
>"that we not add a new value 'balance' without also adding at least a
>(Not that this feature needs to be implemented as new values to
> avoiding wrapping within a particular phrase is somewhat orthogonal to
> overall choice of line breaks between the words & phrases of a block.)
>Adding a bit more explanation now:

Thanks for the in-depth explanation. This is quite helpful.

>I mean that the way to choose line breaks for a heading differs
>from how one would choose line breaks for a caption, which differs (less
>substantially) from how one would choose line breaks for a pull quote.
>I've noticed that good line breaks for a heading are often very
>phrasing considerations are much more important in headings than in
>and pull quotes.

I am a little skeptical of a text-wrap value that will choose breaks using
some sort of phrase analysis. This seems highly language- and
context-dependent. It might be better to indicate phrasing in the markup
(since it’s semantic) then use text-wrap:avoid for the phrase elements.
That way the line break mechanism doesn’t have to guess at what is a
significant phrase, will attempt to avoid breaking within a phrase, but
breaks within a phrase will be allowed if absolutely necessary.

>Headings have an especially high preference for breaking at a colon, even
>the result is very unbalanced.  "From left to right:" would be a good
>to end a line in a heading, but rarely in a caption.

So perhaps in this case you’d have two spans in the heading, the first up
to and including the colon, the second containing everything after. Those
spans could have text-wrap:avoid to ensure the heading broke after the
colon in a two-line situation, and that the break after the colon was
preserved in cases where more line breaks were needed.

From Left to Right:
Moving Adroitly

From Left to
Moving Adroitly

>Line breaking for captions is closer to that of a normal paragraph than
>many of the other potential uses of balancing.

That depends, I think, on whether the caption is longer or shorter. If
it’s a paragraph-sized caption I agree, and I might not use
text-wrap:balance in that situation. If it’s a shorter caption
(particularly in video captioning) then it may look better with full
balancing. As you note with block quotes below, balancing works best with
a small number of lines (and as the number of lines grows, the actual
change in line breaks when balancing diminishes).

>  Phrasing is still important
>(you'd try not to break up a name in a caption of a photograph), but the
>line of a paragraph will still often be shorter than the others.  Captions
>have a bit more need to be a similar width as other captions on the page
>than for other potential uses of balancing.

I agree that it may be better not to use balancing if/when there is more
than one caption visible at the same time.

>Compare with a pull quote, where the last line can be as long or longer
>the others (though many pull quotes do have a shorter last line), and it's
>no problem for two pull quotes visible at the same time to have different

I’m not sure that’s the case - if the pull quotes are in the same column,
it can look strange to have different measures.

> (snip things I generally agree with where I don’t have a useful comment)

>I don't think we can say much about how a balancing feature should behave
>length similarity should trade off against other line-breaking
>without considering particular uses.  For the use cases mentioned above,
>I'd be more interested in one of the other mechanisms mentioned above.
>Most similar to a balancing declaration would be the "more free to reduce
>apparent measure than in other paragraphs" declaration.

I am definitely interested in eventually arriving at a place where we can
express “more free to do this” and “try to avoid this other thing when
possible” and have several inputs to line-breaking decisions be weighed
against each other. But I unfortunately think that will take some time.
Until then, I think a less-nuanced text-wrap:balance is still useful.



Received on Friday, 6 February 2015 04:39:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC