--- In [email protected], "drthmlyons" <[EMAIL PROTECTED]> wrote: > > I'm attempting to create an SVG document where the text in the > document defines the documents size, rather than a declaration like > <svg width="450" height="500"... > > So that just by changing the text, I get documents of different size. > Is such a thing possible? > > Thanks, > Tristan >
Hi Tristan, Yes, there are several ways, depending on the kind of formatting you're using. One of the simplest can be: myWidth = Math.max(getComputedTextLength() of <text> element's children array) myHeigth = <text> element's children.length * dy (if consistent) + someExtraRoom setAttribute on the svg element To be more accurate you would probably take into account other parameters. Domenico ----- 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/

