You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Joel Uckelman <uc...@nomic.net> on 2007/01/04 12:27:56 UTC

Re: tspans fail to line up

Thus spake thomas.deweese@kodak.com:
> 
> Hi All,
> 
> archie.cobbs@gmail.com wrote on 01/03/2007 04:51:26 PM:
> 
> > I've seen this before. It's because of the whitespace in between your
> > tags. 
> 
>    Correct.
> 
> > Try putting all your XML tags together and/or adding xml:space
> > attributes.
> 
>    The only other value for xml:space is preserve which would probably
> make his problem worse.

I looked up xml:space, and saw that the only values are 'default' and
'preserve'. But if the default *is* preserve, what's the point? This
isn't your fault, but why didn't they also define an 'ignore' value
in the standard?

[snip]
 
>    The rendering is I believe correct (or _very_ nearly so).
> The problem is caused by the spaces (select all the text to see
> what I mean).  The last tspan doesn't have trailing spaces
> because of white space collapsing.  The reason the 1 is shifted
> but the eight isn't shifted much is due to the way text-align="end"
> is handled, we alight the right edge of the glyph geometry with the
> specified x coordinate.  The eight's geometry is almost as wide as
> glyphs advance so it moves only slightly relative to the upper 8,
> the 1 is much narrower than the glyphs advance.

So, to summarize, the only way to get this to render as I want is to
have the SVG be formated badly?

-- 
J.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: tspans fail to line up

Posted by th...@kodak.com.
Hi Joel,

uckelman@ellipsis.cx wrote on 01/04/2007 06:27:56 AM:

> Thus spake thomas.deweese@kodak.com:
> >    The only other value for xml:space is preserve which would probably
> > make his problem worse.
> 
> I looked up xml:space, and saw that the only values are 'default' and
> 'preserve'. But if the default *is* preserve, what's the point?

   Default collapses white space between non-whitespace chars but
keeps at least one.  Except at the beginning and end of text where
it eliminates all whitespace.

> This isn't your fault, but why didn't they also define an 'ignore' value
> in the standard?

   Because this is text and in text you almost never want to really
ignore all spaces.

> >    The rendering is I believe correct (or _very_ nearly so).
> 
> So, to summarize, the only way to get this to render as I want is to
> have the SVG be formated badly?

   There are alternate ways to format your SVG that won't
have this problem (For what it's worth HTML has the same problem):

  <text style="font-size:14px;text-anchor:end;fill:black;fill-opacity:1" 
    ><tspan x="100" y="15">*</tspan
    ><tspan x="100" y="30">1</tspan
    ><tspan x="100" y="45">1</tspan
 ></text>