--- En date de : Lun 22.12.08, [email protected] <[email protected]> a écrit : De: [email protected] <[email protected]> Objet: Re: Bounding box and text element À: [email protected] Cc: [email protected] Date: Lundi 22 Décembre 2008, 14h49
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 >>I will check my code (I don't have it on this computer) but I think I do the >>same thing. > 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. >> It displays fine with Squiggle or Firefox. Should I look for someathing >> specific? Thanks
