> My question is do I use createElementNS to create an SVG text > element, or is > that what createTextNode is for?
You have to use both. createElementNS to create the <text> element createTextNode to create the content of the text node (the real text) you have to add the TextNode as a child of the <text> Element. Just use the DOM as you write your XML <text>bla</text> means bla is a TextNode that is a child of the <text> element. > However, neither Element nor Text has the > crucial method > getComputedTextLength(), which I believe I need to get the width of the > string in pixels. Hence in my code below you will see a "dummy" > cast of Text I understand the need but it's really tricky to answer that question. First, you will find no method on DOM Core to get that information - you will have to use the SVG DOM. The idea is to cast your <text> Element to an SVGTextContentElement and will get the getComputedTextLength() method. The problem is that: 1. it's not supported in batik yet 2. that's not so easy to implement (we have to nearly render the text element to give you access to that information. That means that all the font family per character, glyph, ligatures... must be resolved at build time !) -- As a workaround, you can try to build the <text> element, using the bridge module (see GVTBuilder and the ImageTranscoder for example to see how it works) - then get the gvt.TextNode (the graphic representation of your <text> node) and you will have access to its bounds... I will try to implement getComputedTextLength ASAP when we will work on the SVG DOM. Thierry. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
