W3C home > Mailing lists > Public > www-svg@w3.org > April 2001

textLength and text-anchor question...

From: Peter <peter@strings.net>
Date: Sun, 29 Apr 2001 16:07:59 -0700
To: <www-svg@w3.org>
Message-ID: <FJEHKEIFNGBPKLPPHMGPCEBHCIAA.peter@strings.net>
Hello,

I have 2 questions regarding proper text and tspan implementations.
Question 1:
	How is "textLength" supposed to be calculated (w3c specs dont show
any formula) e.g. are character widths multiplied by font size when added
together with kerning and other spacing attributes?

Question 2:
	What is the right implementation of "text-anchor" within "tspan"?
According to W3C specs:
"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."

Thus the svg below should render text "Text2" over "Text1", however
according to Adobe SVG viewer 2.0 (build 55) which supposedly has all
text-anchor features implemented, it renders "Text2" right after "Text1"
(effectively ingoring text-anchor attrib).  Am I missing something?

  <text  x="200" y="50">Text1
  <tspan text-anchor="end">Text2</tspan></text>


Thanks for your help.
-peter
Received on Sunday, 29 April 2001 19:10:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 23:52:49 GMT