Re: letter-spacing with text-anchor middle

On Thu, 2010-07-08 at 12:45 -0400, Doug Schepers wrote:
> Hi, Tav-
> 
> Tavmjong Bah wrote (on 7/8/10 11:34 AM):
> >
> >  I would just like to clarify that when using letter-spacing not equal
> > to zero, that there should not be space added/subtracted after the last
> > character in a line. This may affect the positioning of text when
> > text-anchor is set to middle. I note this as Batik 1.7 adds space after
> > the last letter and thus centering text does not work as expected.
> > (Opera/Firefox do not support letter-spacing. Chrome/Inkscape do not add
> > space after the last letter.)
> >
> >  I have created a test SVG:
> >
> > http://tavmjong.free.fr/INKSCAPE/SVG_TESTS/text_letter_spacing_alignment.svg
> 
> Good point.  Is this ambiguous in SVG 1.1 and SVGT 1.2?  If so, we 
> should raise an issue on it for SVG2, and maybe an errata for earlier 
> versions of SVG.

Yes. One is referred to the CSS2 spec for further information where one
finds under 'letter-spacing':

"Character spacing may also be influenced by justification (see the
'text-align' property)."

Under 'text-align' one finds:

"In the case of 'justify', the UA may stretch the inline boxes in
addition to adjusting their positions. (See also 'letter-spacing' and
'word-spacing'.)"

So it doesn't really cover this case.

Since the main stated purpose of 'letter-spacing' (and 'word-spacing')
is to justify text, it seems that adding space after the last letter is
incorrect. I think it would be helpful to explicitly state that space
should not be added after the last character (or before the first
character).

                                        Tav

Received on Friday, 9 July 2010 11:16:09 UTC