Re: text-justify:distribute behavior

Adding www-style.

On 12/14/2010 07:30 AM, Koji Ishii wrote:
> fantasai wrote:
>> Koji Ishii wrote:
>>>            <dt>distribute</dt>
>>>            <dd>Justification primarily changes spacing both at word separators
>>>              and at grapheme cluster boundaries in all scripts except those in
>>>              the connected and cursive groups.
>>> +          If there are no word separators nor grapheme cluster boundaries,
>>> +          the inline contents are centered within the line box.
>>
>> The behavior when there are no expansion opportunities in a line is to fall back
>> to the value given in text-align-last. I don't think it makes sense to have
>> 'distribute' be an exception here.
>>
>> What we might want to do, though, is have the 'justify' value of 'text-align-last'
>> fall back to 'center' instead of to 'start'.
>> And/or allow 'text-align-last' to combine 'justify' with another value.
>
> I saw minutes from your meeting with JLTF in 2009[1]. There must have been
> more discussion than written there, but I'd like to add a couple of items.
>
> First, when you use "distribute", it's not only about the last line. In most
> cases, nobody thinks about wrapping, so the style should be something like this:
>    text-wrap:none;
>    text-align-last:justify;
>    text-justify:distribute;

If nobody thinks about wrapping, then probably text-wrap won't be set. :P

> If you allow wrapping, although probably normal Japanese had never thought
> about that because we usually don't see such usage in the printed materials,
> it should be:
>    text-align:justify;
>    text-align-last:justify;
>    text-justify:distribute;

Note that text-align-last doesn't take effect unless text-align is 'justify'.
So both examples need to set text-align: justify.

> With this styles, if the first line doesn't have expand opportunities, it
> should be centered. I have attached a sample from Word's distribute
> implementation. The text is "A wwwww" and the line is wrapped. The 2nd
> word "wwwww" is wrapped to the next line, and "A" at the first line is
> centered. InDesign behaves the same way.

+-------------+
|      A      |
| w w w w w w |
+-------------+

> Second. Centering when no expand opportunity is not an option for "distribute";
> lines without expand opportunities are always centered. So making it an optional
> keyword only adds unnecessary test cases where there're no demands on.
>
>> From these two, I think it should be the default behavior of "distribute" value
> rather than an optional keyword. Do you have any scenarios in your mind to make
> it optional? Maybe you've got some requests from other scripts?

Actually, I was thinking something like this:

  | text-align-last: [ start | end | left | right | center ] || justify
  |
  | If 'justify' is combined with an alignment keyword, then that alignment
  | is used as the fallback alignment when all expansion opportunities in
  | the line are exhausted. If no alignment keyword is given, the fallback
  | alignment is 'center' when 'text-justify' is 'distribute' and 'start'
  | otherwise.

We could also add an 'auto' value as the default
   auto
     If 'text-justify' is 'distribute', then the used value is 'justify center'.
     Otherwise the used value is 'start'.
This means that "text-justify: distribute; text-align: justify" is enough to
trigger full distribution. It might be more confusing though, since no other
text-justify methods trigger last-line justification.

Unbaked thought: maybe we need a shorthand for text-align+text-justify+text-align-last.

> [1] http://lists.w3.org/Archives/Public/www-style/2009Mar/0064.html

~fantasai

Received on Tuesday, 14 December 2010 20:39:53 UTC