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

Re: [CSS21][css3-text] letter-spacing, word-spacing and justification

From: Alan Stearns <stearns@adobe.com>
Date: Mon, 21 Jan 2013 08:10:36 -0800
To: MURAKAMI Shinyu <murakami@antenna.co.jp>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <CD22A431.1A1CE%stearns@adobe.com>
On 1/21/13 5:44 AM, "MURAKAMI Shinyu" <murakami@antenna.co.jp> wrote:

>Alan Stearns <stearns@adobe.com> wrote on 2013/01/17 13:41:47
>> On 1/16/13 7:41 PM, "MURAKAMI Shinyu" <murakami@antenna.co.jp> wrote:
>> 
>>...
>> >My questions:
>> >- Is my understanding of the spec correct?--If the value of
>> >letter/word-spacing is '0pt', the <spacing-limits> is
>> >optimum=minimum=maximum=0pt and cannot be stretched in text
>>justification.
>> 
>> I can't speak to CSS2, but in CSS3 Text you have this sentence:
>> 
>> ---
>> The text justification process may alter the spacing from its optimum
>> (see the 'text-justify' property, above) but must not violate the
>>minimum
>> spacing limit and should also avoid exceeding the maximum.
>> 
>> 
>> ---
>> 
>> So with optimum=minimum=maximum=0pt in justified text the 'added'
>>spacing
>> must not go below 0pt, but it is allowed to go above 0pt when it's
>> impossible to justify the line without breaking the spacing constraints.
>
>Thanks for your comment.
>
>In my understanding, "should also avoid exceeding ..." in the spec
>means nearly "not allowed".

The use of "should" is technical - see the definition [1]. It's
recommended that the spacing constraints are not broken, but when they
have to be, it's the maximum limit that's exceeded. If this were not
allowed, the spec would say "must not violate the maximum"

>Please note that the spec also says:
>"If the inline contents of a line cannot be stretched to the full
>width of the line box, then they must be aligned as specified by the
>'text-align-last' property."

I see the problem with this now. I interpret this sentence to apply to
circumstances where there are no expansion opportunities in the line (for
example, a line that contains a single glyph or a single inline image). If
I'm correct, then this sentence should be re-worded to make this clear.

>
>The initial value 'auto' of text-align-last is same as 'start'
>when text-align is 'justify', and if all letter/word-spacing in
>the inline contents of a line has optimum=minimum=maximum=0pt,
>it cannot be stretched and the result will be same as text-align:start.
>
>So I raised the question:
>>> - I tested major browsers with the following samples and found
>>> that they stretch the fixed value spacing, the value '0pt' is
>>> treated like 'normal'. Is this behavior wrong and should be
>>> corrected? (or the CSS spec is wrong?)
>>> https://dl.dropbox.com/u/64715801/word-spacing-justify.html
>>> https://dl.dropbox.com/u/64715801/letter-spacing-justify.html

I think the behavior is correct (at least in the Roman case - there may be
subtleties in Japanese justification I'm missing). The spec should be
clear that the "cannot be stretched" sentence you quote above does not
apply to these test cases.

Thanks,

Alan

[1] http://www.ietf.org/rfc/rfc2119.txt
Received on Monday, 21 January 2013 16:11:08 GMT

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