I think there are those on this list who can readily retrieve nice examples 
of doing this, but let me start with one strategic approach (which may not 
be optimal in all contexts). I think what I've got here works in IE/ASV, 
Firefox and Opera.

Use JavaScript rather than vanilla SVG. I don't think it can be done without 
scripting (though I'd love to find I'm wrong).

1. Render the text, but somewhere off-screen <text x="-1000" id="Q"...> or 
something
2. find the size of its bounding box: 
SVGDocument.getElementById("Q").getBBox
(Take a peek at 
http://srufaculty.sru.edu/david.dailey/svg/newstuff/text2.svg where this is 
done, though with a bit of extra nonsense which you will have to ignore 
judiciously)
3. Adjust either the font-size or the size of the rect to make them both 
happy.

hope this helps,
David

----- Original Message ----- 
From: "Nazar" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 29, 2006 11:00 AM
Subject: [svg-developers] rect with text incide


> Hello
> I need to display text which is contained incide a rect.
> How is it possible using dom.createTextElement make text
> wrap to occupy rect object space and not cross boundaries?
>
>
>
>
>
>
>
> -----
> 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 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/

<*> 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