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

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

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 10 May 2013 19:17:37 -0700
Message-ID: <518DAA41.3040408@inkedblade.net>
To: www-style@w3.org
On 01/16/2013 07:41 PM, MURAKAMI Shinyu wrote:
> I often see the following CSS code, I think this has a problem:
>
> p {
>    letter-spacing: 0pt;
>    word-spacing: 0pt;
>    text-align: justify;
> }
>
> In the CSS2.1 and CSS3 Text, the initial value of letter/word-spacing is
> 'normal', stretchable in justification, and different from the fixed
> value 0pt. [...]
>
> 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 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?)

Your understanding of the spec is correct, but Koji and I think that
the spec will need to be changed here.

Our proposal...

Part I: letter-spacing: <length> allows justification

   This solves backwards-compatibility with such style sheets as you mention,
   and is also consistent with implementations.

   It is also consistent with how 'word-spacing' behaves: <length> values
   there allow justification.

   (Note: This would be a change from CSS2.1, so will need to be backported.)

Part II: Add 'fixed' keyword to disallow justification

   We have a problem if we allow justification for letter-spacing always;
   German typesetting rules requires that it not be allowed! So here is
   a proposal --

     letter-spacing: normal | <length> || fixed

   If 'fixed' keyword is specified, then justification cannot alter
   letter-spacing, only word-spacing.

I think Part I is important to take. I am open to other suggestions to
solve the use case in Part II...

~fantasai
Received on Saturday, 11 May 2013 02:18:05 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 11 May 2013 02:18:06 UTC