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

Re: [css3-text] letter-spacing and degenerated grapheme clusters

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 17 Jan 2012 18:07:04 -0800
Message-ID: <4F162948.3060605@inkedblade.net>
To: www-style@w3.org
On 01/17/2012 04:37 AM, Jonathan Kew wrote:
> On 17 Jan 2012, at 11:58, Kang-Hao (Kenny) Lu wrote:
>> <div style="letter-spacing: 1em;">AB</div>
>> <div style="letter-spacing: 1em;">A&x200b;B</div>  <!-- U+200B ZERO WIDTH
>> SPACE -->
>>
>> IE, FF9 and Opera12alpha shows the above two lines differently (A--B and
>> A--|--B) while WebKit gives the same thing. Is WebKit allowed to exhibit
>> this behavior because the underlying font system doesn't provide a glyph?
>
> I don't think so; ZERO WIDTH SPACE is a separate grapheme cluster and therefore is affected by letter-spacing.

That's an error... adding zwsp shouldn't change the letter-spacing. I'll add
a statement about zero-width characters...

>> 2. The spec to define the what should happen for
>>
>> <a><b><c>TE</c>(no glyph)</b>ST</a>  for a { letter-spacing: 0.1em; } b {
>> letter-spacing: 0.2em; }
>>
>> TE[0.2em]ST or TE[0.1em]ST
>>
>> because there are two boundaries.
>
> Perhaps it should result in T[0.2em]E[0.15em]S[0.1em]T, because the right-hand sidebearing of E is increased by half the letter-spacing of element b, while the left-hand sidebearing of S is increased by half the letter-spacing of element a.

Spacing at element boundaries, the letter-spacing between two characters is given
by the element containing the boundary, so this would have the spacing of <a>.
See the equivalent example in
   http://www.w3.org/TR/css3-text/#letter-spacing
(between f and g).

>> 3. The spec to say, in Appendix G, that default spacing (or at least
>> letter-spacing) probably happens after font/glyph selection. I am not an
>> implementer so I have no idea if this is making sense or not.
>
> I don't think that's correct. Letter-spacing should apply between grapheme clusters,
> and grapheme cluster boundaries should depend only on the Unicode characters in the
> text, not on the particular fonts that happen to be used.

Agreed.

~fantasai
Received on Wednesday, 18 January 2012 02:07:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT