Hi !

Cameron McCormack a écrit :
Cameron McCormack:
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

Thomas DeWeese:
   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.

Ah I was following the SVG Tiny 1.2 definition, which says that the
bounding box of a <text> element is the union of the bounding boxes of
its glyph cells:

  http://dev.w3.org/SVG/profiles/1.2T/publish/coords.html#BoundingBox

The 1.1 definition just says geometry, so probably the current behaviour
is OK for 1.1.

   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.

Yes that should work. :)

I will look.
Thanks for your help !

Reply via email to