Loading ...
Sorry, an error occurred while loading the content.

Re: strange position of tspans

Expand Messages
  • Holger Jeromin
    ... yes, but i position the tspan element absolute, which do not contain a white space itself. Why is the space sucked in and why not in the last tspan? --
    Message 1 of 5 , Jul 7 1:19 AM
    • 0 Attachment
      Robert Longson schrieb am 06.07.2009 23:27:
      > --- In svg-developers@yahoogroups.com, Holger Jeromin <mailgmane@...>
      > wrote:
      >> i found a strange positioning of tspans in a text element.
      >>
      >> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"> <svg:text
      >> style="text-anchor:middle;" font-size="35"> <svg:tspan x="100"
      >> y="140">PositionBug</svg:tspan> <svg:tspan x="100"
      >> y="155">PositionBug</svg:tspan> <svg:tspan x="100"
      >> y="170">PositionBug</svg:tspan> </svg:text> <svg:text
      >> style="text-anchor:middle;" font-size="35"> <svg:tspan x="350"
      >> y="140">no PositionBug</svg:tspan><svg:tspan x="350" y="155">no
      >> PositionBug</svg:tspan><svg:tspan x="350" y="170">no
      >> PositionBug</svg:tspan> </svg:text> </svg:svg>
      >>
      >> can you tell me, why all tspan (but not the last one) in a text
      >> element is shifted a few pixel to the left if they are followed by
      >> a whitespace? If there are no whitespace the positioning is done as
      >> expected.
      >>
      >> Be aware that IE (adobe svg) and webkit consider a line break not
      >> as a white-space in XML, but Opera and Firefox do.
      > The whitespace is within the text element so it is just that i.e a
      > space. You are using text-anchor middle so all the text is stuck
      > together including the spaces, then the middle is calculated.

      yes, but i position the tspan element absolute, which do not contain a
      white space itself. Why is the space "sucked in" and why not in the last
      tspan?

      --
      best regards
      Holger Jeromin
    Your message has been successfully submitted and would be delivered to recipients shortly.