Hi, If you use the GVT part from batik, you can get then bounding box by calling textNode.getBounds(), that textNode is not SVG TextNode element, but GVT TextNode
I think the SVGDOM doesn't define the bounding box for text element, but not so sure either. Regards Tonny Kohar http://www.kiyut.com On Wed, 2003-11-05 at 22:51, Tjorven Lauchardt wrote: > Hello, > > I am creating a application with Batik and I have the following problem. > I am buidling a DOM Tree and I want to know the bounding box of the > text-Elements while I am building the DOM. I need that information, > because I want to create a fitting rect as a background for every > Text-Element and for other layout-reasons. > > Can you help me? I already searched in the mail-archive, but didn't find > a solution for my problem. > Here is my code: > > DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); > String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI; > SVGOMDocument doc = (SVGOMDocument)impl.createDocument(svgNS, "svg", null); > > Element text = doc.createElementNS(svgNS,"text"); > Text textNode = doc.createTextNode("a text"); > text.appendChild(textNode); > > // here I want to know the bounding box > > Is it possible? > > Thank you, > > Tjorven Lauchardt > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]