Hi Bruno,
Bruno Marquiÿffffe9 <[email protected]> wrote on 12/22/2008 06:00:07 AM:
> I'm trying to get the bounding box of a text element using Batik and
> the method getBBox().
> The bounding box I get is not null (although I need to compute the
> rendering tree both for the whole document and then any individual
> text element, is it normal?)
You should not need to do it for the text element. If you
are that could well be your problem. Are you following the
code in Boot SVG & CSS DOM?
http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom
> but it's seems it doesn't take into account the font : the size
> of my bounding boxes are still the sames and sometime are too big
> or small depending on the font I choosen. Is it a batik bug or is
> it normal? How can I do to get the real bounding boxes?
It is not a known bug that Batik calculates the BBox of
text elements incorrectly. My two guesses are that you
aren't booting the SVG DOM correctly (see above) or that
Batik can't find the font that you are referencing (and so
substitutes a fall back font - per CSS rules). You might
check the second by trying to load the document in
Batik Squiggle.