Anchoring of text chunks

Hello everybody,
I have a few questions about the alignment of text chunks. These
points are unclear to me in the specification:

1) The spec says:

"The ‘text-anchor’ property is applied to each individual text chunk
within a given ‘text’ element. Each text chunk has an initial
current text position, which represents the point in the user
coordinate system resulting from (depending on context) application
of the ‘x’ and ‘y’ attributes on the ‘text’ element, any ‘x’ or ‘y’
attribute values on a ‘tspan’, ‘tref’ or ‘altGlyph’ element assigned
explicitly to the first rendered character in a text chunk, or
determination of the initial current text position for a ‘textPath’
element."

This formulation seems to assume that the initial current text
position is specified in absolute values for each text
chunk. However, this is not necessarily the case. Consider the
example:

<text x="0" y="0 1 2">SVG</text>

The absolute values for y lead to three text chunks "S", "V", and
"G". What are the x coordinates for the initial current text
positions of "V" and "G", respectively? I assume that the advance
values of the previous characters are taken into account. Is that
correct? I cannot determine this from the spec.

2) The part of the spec quoted above says: "The ‘text-anchor’
property is applied to each individual text chunk within a given
‘text’ element." However, the text-anchor value is not necessarily
constant within a text chunk.

Example:
<text x="0">
  <tspan text-anchor="start">Hello</tspan>
  <tspan text-anchor="end">world</tspan>
</text>

According to the definition, only absolute position adjustments
define new text chunks. Therefore "Hello world" is one text
chunk. Where is the end of "world" anchored? At the current text
position after "Hello"? Or at 0? Or is this setting even ignored
because the whole chunk must be anchored as one piece?

3) The spec says about text-anchor 'end':

"The rendered characters are aligned such that the end of the text
string is at the initial current text position.For Latin in its
usual orientation this is equivalent to right alignment. For scripts
that are inherently right to left such as Hebrew and Arabic, this is
equivalent to left alignment."

What does that mean for bidirectional text? Assuming we have the
text "Hello world" and "world" consists of right-to-left
characters.

<text x="0" text-anchor="end">Hello world</text>

The rendered text would then look like "Hello dlrow". The logical
end of the string is after the "d". Does this mean that this point
should be anchored at 0? Or is it the end of the string after
bidirectional reordering, i.e. "w" (which is probably what a user
would expect)?

This also affects 'middle' anchoring.

Thank you very much for your help
Lutz

Received on Saturday, 7 May 2011 02:10:43 UTC