You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Thierry Kormann <Th...@sophia.inria.fr> on 2000/11/06 13:20:43 UTC

Re: Clarification of spec: whitespace

> > > "Text includes tspan element." [leading and trailing whitespace stripped
> > > from tspan]
> > 
> > Agree with the result, not the explanation. Here is mine: [All the contents
> > are merged and then spaces are collapsed].
> 
> The trouble with this explanation is that it is ambiguous where
> attributes are concerned - for instance, if the tspan element is
> underlined, and the whitespace between tspan and the text is reduced
> to one space, whose attributes does that space have?

I agree with stephane but we need some additional informations from the SVG 
working group. I think the process is :

1 - collapse all contents (including tspan content)
2 - resolve spaces (as described in the spec - considering just one content)

Your issues :

> (1) Our strikethrough does not get stroked (limitation 
>    in TextLayout);

ok. we can improve that later.

> (2) we are introducing extra spaces in the concatenated
>    tspans (thus the previous email about "correct" behavior);

Stephane has a bug in the white spaces resolution. He will fix that (today I 
think). You can now consider that the ACI built in the bridge is correct and 
contains all the correct style attributes.

As far your example with two different underline on 2 white space characters 
(from different element), I don't have a correct answer. I think you should 
better ask to the SVG working group as it's a tricky question :)

We will keep (after stephane patch) the attributes of the first white space in 
Batik but this is our implementation.

Anyway, I hope you can consider that the ACI is correct and do not use some 
hack in your TextPainter. Otherwise, may be we have a design issue.

> >From an implementation point of view it is also very nasty to 
> concatenate the text, then collapse afterwards... then sort
> out the attributes.  Horrible!

I agree. I think we really need to send an email the the SVG WG.

Regards,
Thierry.

-- 
Thierry Kormann
email: Thierry.Kormann@sophia.inria.fr  http://www.inria.fr/koala/tkormann/
Koala/Dyade/Bull @ INRIA - Sophia Antipolis






Re: Clarification of spec: whitespace

Posted by Bill Haneman <bi...@ireland.sun.com>.
Thierry:  IMPORTANT NOTE BELOW!

Thierry Kormann wrote:

<...>
> I think the process is :
> 
> 1 - collapse all contents (including tspan content)
> 2 - resolve spaces (as described in the spec - considering just one content)
> 
> Your issues :
> 
> > (1) Our strikethrough does not get stroked (limitation
> >    in TextLayout);
> 
> ok. we can improve that later.

I can put a fix in for this in very little time.

> 
> > (2) we are introducing extra spaces in the concatenated
> >    tspans (thus the previous email about "correct" behavior);
> 
> Stephane has a bug in the white spaces resolution. He will fix that (today I
> think). You can now consider that the ACI built in the bridge is correct and
> contains all the correct style attributes.

I have made some changes to SVGTextElementBridge which are important.
I have also fixed a bug in SVGTextElementBridge.  The only 
outstanding issue has to do with whether tspan elements are stripped.
Correct handling of underlining styles also has required that I add
new ACI attributes UNDERLINE_STROKE, UNDERLINE_STROKE_PAINT,
UNDERLINE_PAINT.
Underlining is inherited rather strangely (SVG spec says "no: see
prose").
In short, whenever the text-decoration:underline is explicitly set, 
the current style's fill, stroke, and stroke-width are applied to the
underlining... when underlining is inherited (which it is to some
degree - see text-decoration-BE-12) the underlining characteristics are
inherited, not reset from the current style.

Stephane, please wait for my CVS commit before committing a new
SVGTextElementBridge,
I will email you separately about the change.

> As far your example with two different underline on 2 white space characters
> (from different element), I don't have a correct answer. I think you should
> better ask to the SVG working group as it's a tricky question :)

BE test text-decoration-BE-12, if it is correct ;-) constrains our
answer.  
 
> We will keep (after stephane patch) the attributes of the first white space in
> Batik but this is our implementation.

This will not agree with conformance test text-decoration-BE-12.
As I pointed out, we satisfy this conformance test if we strip tspan.
That doesn't mean that stripping tspan is correct, but it does suggest
that the proposed implementation (above) is incorrect.

> Anyway, I hope you can consider that the ACI is correct and do not use some
> hack in your TextPainter. Otherwise, may be we have a design issue.

No hack is required, I went straight to the SVGTextElementBridge for the
fix.  

-Bill