In the experiments I've done with making SVG objects act like HTML <textarea>s: 
listening for keystrokes, handling backspacing and word-wrap and so forth, I 
have generally used .getBBox() to determine how wide a rendered piece of text 
is. Once it gets to be too wide for its rectangle then I start a new line. I've 
noticed that other people, when approaching this task, tend to use 
.getComputedTextLength. 

If T is a variable refering to a <text>, then the values of

T.getComputedTextLength();
T.getBBox().width

tend to differ from each other by just a few pts., with T.getBBox().width 
actually being a bit smaller in the typical case. The W3C 1.1 reco for 
getComputedTextLength() reads as follows:

The total sum of all of the advance values from rendering all of the characters 
within this element, including the advance value on the glyphs (horizontal or 
vertical), the effect of properties 'kerning', 'letter-spacing' and 
'word-spacing' and adjustments due to attributes dx and dy on 'tspan' elements. 
For non-rendering environments, the user agent shall make reasonable 
assumptions about glyph metrics. 


but don't quite understand what it is doing that getBBox().width doesn't do. 
There are several of the special text handling functions whose raison d'etre I 
don't quite understand, but perhaps if I understand this one, the others will 
start to make sense. Might someone be able to remove my misunderstanding?

Thanks in advance,
David

[Non-text portions of this message have been removed]



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to