Hi Cameron, Thomas,

Thomas Palfray <[EMAIL PROTECTED]> wrote on 10/30/2008 05:45:15 AM:

> Hi Cameron, thanks for your reply.
> 
> Cameron McCormack a écrit : 

> However, it seems that spaces at the start and end of the element don?t
> contribute to the bounding box, even if xml:space="preserve".  That
> seems to be a bug, so I?ve filed this:
> 
>   https://issues.apache.org/bugzilla/show_bug.cgi?id=46127

   Do you have a section in the spec that says that unrendered
text content must contribute to the BBox of a text element?
There is an obvious conflict here between the bbox be some
sort of 'logical bounds' vs the 'rendered content bounds'.
So for example for putting a graphical element next to the
text you probably wouldn't want to consider the space.

> So it's a bug of Batik ... So bad. I need this feature because i use
> BBox for doing diplomatic text rendering.
> Maybe i can substitute the blankspace caracter with another one 
> which have the same size. Any idea of which caracter could be use for 
that ?

   If you want to know actual text content positions I would suggest
that the text content SVG DOM Api's would be a better choice than
getBBox:

        http://www.w3.org/TR/SVG/text.html#DOMInterfaces

  Take a look at 'samples/tests/spec/scripting/text_content.svg'
in the distribution for an example of using these API's. 
In particular you can call 'getEndPositionOfChar(index)' for the 
trailing space to get the location of the end of the space. 

Reply via email to