Hi,

On Wed, Feb 20, 2008 at 9:02 PM, Rob Davis <[EMAIL PROTECTED]> wrote:
> How can batik be used to work out the bounds of a text element in an SVG doc?
>
>  For example return a Rectangle2D object? Or the width and height of
>  the element (a corner x,y co-ordinates are already defined in the
>  element, once I have the width and height to then I know the bounds)

Did you try elt.getBBox(); // check the API, the syntax is from my memory

>
>  I found the SVGTextElementBridge class which does have a getTextBounds
>  method that returns a Rectangle2D. This is exactly what I'm looking
>  for. HOWEVER, how do I initialise an instance of this class properly?
>  and for it to operate on the SVG text element I'm interested in?

Those classes are already initialized by Batik when you enabling the
boot css stuff. In Batik wiki / website there should be a
documentation regarding SVG boot css (forget the url), from there you
can get access to the bridge and bridgeContext class.

Note: those Bridge/BridgeContext and GVT is low level Batik graphics
rendering, normally people does not go into that deep, people are
usually at the SVG DOM API level.

Cheers
Tonny Kohar
-- 
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to