Re: [CSS21] Spaces, non-breaking spaces, ideographic spaces and the word-spacing property

Bert Bos wrote:
> About http://wiki.csswg.org/spec/css2.1#issue-84
> 
> As already stated in the partial resolution, the principle 
> of 'word-spacing' (the issue text says 'white-space' but I think that's 
> a typo) is that it affects the width of the empty space between "words" 
> on a line iff the size of that white space is by nature flexible.
> 
> There are several ways to create inline white space. I think we can make 
> an explicit list of cases that are affected or not affected:
> 
> Not affected by 'word-spacing' are inline spaces that consist solely of 
> one or more of the following:
> 
>   - 'margin'
>   - 'padding'
>   - 'border-spacing'

These are all excluded by saying that word-spacing affects certain characters.
(CSS3 Text is even clearer on this point.)

>   - the space created by a Unicode character between U+2000 and U+200A,
>     inclusive (i.e., EN QUAD, EM QUAD, etc.)

These are now explicitly excluded in 2.1, and have been excluded from
CSS3 Text for awhile.

>   - the space created by SPACE or TAB (in the source or in 'content')
>     when 'white-space' is 'pre' or 'pre-wrap'

TAB is not affected. But any uncollapsed SPACEs are.

>   - space created by OGHAM SPACE in the source or in 'content' (note
>     that in some fonts it's actually a line, not a space)

This hasn't been called out explicitly. Probably it should not be
spaced unless the UA knows how to stretch it.

>   - space created by MEDIUM MATHEMATICAL SPACE in the source or
>     in 'content'

Isn't this a fixed-width space?

>   - space created by MONGOLIAN VOWEL SEPARATOR in the source or
>     in 'content'

This should probably not be spaced. It's not called out as a word
separation character.

>   - NARROW NO-BREAK SPACE in the source or in 'content'
>   - ZERO-WIDTH SPACE in the source or in 'content'
> 
> (ZERO-WIDTH SPACE, as the name indicates, generates no space, but it may 
> be useful to include it here anyway, because it has "space" in the name 
> and because when one reads the Unicode spec a bit too quickly it 
> appears to say (chapters 11.1 and 16.2) that this space can become 
> visible because of justification. On closer reading, that refers only 
> to justification by means of letter spacing.)

Hm, I'm not sure it should be justified by letter-spacing either.
It seems to me it should be effectively invisible.

> Affected by 'word-spacing' are all inline spaces that are created by one 
> or more of the following:
> 
>   - SPACE, TAB, CR or LF in the source or in 'content' that
>     are collapsed to a single space because of the setting
>     of 'white-space' (i.e., 'normal', 'nowrap' or 'pre-line')

Word-spacing happens after white space collapsing, this is explicitly
called out in both CSS2.1 and CSS3 Text.

>   - NO-BREAK SPACE in the source or in 'content'
>   - IDEOGRAPHIC SPACE in the source or in 'content'
> 
> 'Word-spacing' affects each such inline space only once, even if that 
> space is (partially) generated by several of the above.
> 
> Not 100% sure about IDEOGRAPHIC SPACE U+3000. Unicode says in one place 
> (TR #14) that it can be compressed or expanded, just like SPACE; and in 
> another (chapter 6.2) that people use it because it has the same width 
> as an ideograph. I'm assuming the latter remarks refers to cases where 
> text is displayed as-is, without any formatting.

We had already a discussion (and a WG resolution) about IDEOGRAPHIC SPACE
U+3000. We got feedback that it should not be compressed or expanded. And
that is what CSS2.1 and CSS3 Text now say.

~fantasai

Received on Wednesday, 11 February 2009 21:39:34 UTC