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

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

From: Stephen Zilles <szilles@adobe.com>
Date: Tue, 2 Jul 2013 16:57:18 -0700
To: Alan Stearns <stearns@adobe.com>
CC: "www-style@w3.org list (www-style@w3.org)" <www-style@w3.org>
Message-ID: <CE2F61DA5FA23945A4EA99A212B15795720FD3C603@nambx03.corp.adobe.com>
With regard to the proposal documented below, I see several concerns.

First lets consider the use cases for 'letter-spacing'. There seem to be 2 major uses in Western typography:
Use Case 1. It is used in headlines to help justify a headline that would not otherwise fill out the column width, and
Use Case 2. It is used to improve the readability (and typographic rhythm) of text (often headlines) that is set in capital letters. Robert Bringhurst in The Elements of Typographic Style (p30) says, "2.1.6 Letter space all strings of capitals and small capitals, and all long strings of digits."

It is clear that using a fixed amount of letter spacing to do justivication (case 1) makes no sense in the dynamically sized environment of the web. The author does not know the column width unless he sets it to a fixed amount (bad practice on the Web). This would be one reason why turning on justification should allow the use of letter spacing in justification.

In the second use case, however, the author is trying to achieve a balance of the glyphs and spacing between them to improve readability. Here, changing the authors intent may decrease readability. Note that this kind of letter spacing may be used on relatively short runs of capitals such as occur in acronyms ("OMG") or number strings such as countryside street numbers ("14755 Country Road"). These are, in effect, words from a justification point of view.

In East Asian typography, there is another use case which appears to be letter spacing. This is the use case of fully justifying the "last" line of ideographic text by inserting spaces between all the characters on that line. As noted in the specification of 'text-justify', this is relatively straightforward for runs of East Asian characters and a bit tricky when other scripts are included in the mix to be justified. But, as the specification is written, the justification process includes adjusting 'letter-spacing' as part of the justification algorithm. 

Is this the only use case for "letter-spacing" in East Asian Text? Is it also used, as in the second use case for Western text, to put a desired amount of space between East Asian glyphs without necessarily justifying a line?

If not, might it not be possible to describe the values of justification as inserting "extra space between letters" rather than saying insert "letter-space". If that change were made, then "letter-space" could have it  Western Use Case 2 meaning without affecting justification. That is, an author could "letter-space" a segment of text and that segment would keep that spacing, but where justification requires it, additional justification space between letters might be inserted. That would keep the original rhythm of the glyphs, just spreading them further apart uniformly.

What about having a second argument of letter-spacing, "fixed" to handle the Western Use Case 2 usage. This has two problems. As just noted, it seems (to me, but perhaps not typographers) that the author would want to preserve the rhythm of his text even when extra space between letters is needed. In this case, the author would want both the letter-space and the extra space between letters needed for justification which is not, I believe, what "fixed" would do.

The second reason that fixed is not a particularly good solution is that the author may like to constrain, by providing Min and Max values for the extra letter spacing between glyphs. For example the author may not ever want to decrease the distance between glyphs and might not want the extra space between letter to approach the value of word spaces to avoid confusing the two types of spacing. Using "fixed" does not make it easy to add these parameters in the future. 

Steve Zilles

-----Original Message-----
From: Alan Stearns [mailto:stearns@adobe.com] 
Sent: Wednesday, June 26, 2013 9:57 AM
To: fantasai; www-style@w3.org
Subject: Re: [CSS21][css3-text] letter-spacing, word-spacing and justification

On 5/10/13 7:17 PM, "fantasai" <fantasai.lists@inkedblade.net> wrote:

>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

I am fine with this proposal, but I think we should take both parts I and II. And we should mention that setting letter-spacing defines a minimum letter spacing and justification can only increase the spacing.

Thanks,

Alan
Received on Tuesday, 2 July 2013 23:57:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 2 July 2013 23:57:46 UTC