Hi Ananth.
ananth balasubramanyam:
> I am new to batik and I have been struggling to get a grasp of the SVG DOM
> Implementation. I went through the batik website and looked at the
> examples of creating a Document from a SVG file. I am trying to parse the
> SVG DOM tree and identify all the text nodes.
>
> When i create an SVG from adobe illustrator and have a text that is
> aligned center, the resulting svg has the text with the x and y
> co-ordinates, but no information about the alignment. so if i replace this
> text programmatically in java, then the text is no longer aligned center
> if it is shorter than the original text. Can somebody please suggest a way
> i do this. please provide some example code if possible. Thanks in
> advance.
> Ananth
If you are just worried about horizontal centering, you can use the
text-anchor property to horizontally center it over the x coordinate you
specify.
<text x="100" y="100" text-anchor="middle">
Some text
</text>
Even if you change the text, it will still be centered over x="100".
There is no equivalent vertical centering, however.
Cameron
--
Cameron McCormack
| Web: http://mcc.id.au/
| ICQ: 26955922
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]