Scott Moore wrote:
> 
> Okay, I might be still confused, so let me elaborate on what you said.
> 
> If I create a SVG DOM and add a <text> node to it, along with the text to be
> displayed.  I can then query the element I just added to the SVG DOM and
> there will be attributes on this node that describe the text that will be
> rendered, including it's size in pixels?

No. Not on that node. Thats why I said "if you use SVG fonts" because
these are XML. So if you know what SVG font you will use you can find
the total glyph width. But it does requires a little tree walking. Find
the roote element of the relevant font. For each character in your
string, iterate over the child elements of the font root node (the
'glyph' elements) looking at their 'unicode' attribute and matching it
to the character.

If you are handling more than short strings, then constructing an
ordered index would be worthwhile to speed procesing.

-- 
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to