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 John Hinke <jo...@gmail.com> on 2007/06/18 16:24:07 UTC

flowRoot text-decoration bug

Hey Folks,

I've run across what I think is a bug in the flowRoot rendering code:
text-decoration styles don't show up.  Here's the example SVG:

<?xml version="1.0" standalone="no"?>
<svg version="1.2"
    xmlns="http://www.w3.org/2000/svg"
    id="body" width="792" height="612" viewBox="0 0 792 612">
  <title>Text-decoration bug in flowRoot tag.</title>
  <g>
    <flowRoot xml:space='preserve'>
      <flowRegion>
        <rect visibility="hidden" x='48' y='396' width='146' height='119'/>
      </flowRegion>
      <flowDiv>
        <flowPara text-decoration="underline" font-family="Arial"
font-size="22.5" fill="#000000"><![CDATA[This should be
underlined!]]></flowPara>
      </flowDiv>
    </flowRoot>
  </g>
</svg>

Thoughts?

I'd be more than willing to try to fix this if somebody could point me
in the right direction in the code.  Or even better, if there's
something I'm doing wrong and can easily fix the above, that would be
great.

Thanks,

John Hinke

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


RE: flowRoot text-decoration bug

Posted by MaGaM <m....@rug.nl>.
Hi,

As posted before and since there was no response I checked out the latest
Batik sources and had a go at fixing this bug myself. With success! A bug
report was already filed for this bug and I added a patch to fix it, see:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51765
Simple changes solved this bug. Did not need to change the usage of LineInfo
objects as suggested above (although that hint pointed me in the right
direction!).
For further details on my fix see the above bug report. So how does this
continue? Will Batik devs check and test the patch and perhaps incorporate
it in the repository sources?

Cheers,
Mario



--
View this message in context: http://batik.2283329.n4.nabble.com/flowRoot-text-decoration-bug-tp2975724p4655219.html
Sent from the Batik - Users mailing list archive at Nabble.com.

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


RE: flowRoot text-decoration bug

Posted by MaGaM <m....@rug.nl>.
Hi John, Thomas,

Although it has been quite a while since the last post in this thread, did
you manage to solve the underline, overline and line through bug? Or perhaps
found a solution to get around it?

I'm running into the same problem now after having added flowing text
support to an editor I'm working on, primarily for academics. I assumed that
these trivial things would work, but after implementing flowing text support
in the editor I found out it is a Batik thing. Waiting on the W3C to decide
on the SVG 1.2 Full is taking too long.

I'm going to try and look at the source code with the hints Thomas provided.
Maybe it can simply be implemented for my purposes.

Any further hints, workarounds or solutions to this problem would be greatly
appreciated!

Thanks for your replies.

Mario



--
View this message in context: http://batik.2283329.n4.nabble.com/flowRoot-text-decoration-bug-tp2975724p4655185.html
Sent from the Batik - Users mailing list archive at Nabble.com.

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


RE: flowRoot text-decoration bug

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

"John Hinke" <hi...@ashlandhome.net> wrote on 06/19/2007 11:15:08 AM:

> I'll file a bug (it's always good to remember them anyway). But I'd be 
more
> interested in trying to fix this myself.  Would you be willing to give 
me a
> few pointers on where to start looking?  I just need something fairly
> short-term right now.

      The decorations are drawn by the class 
batik.gvt.renderer.StrokingTextPainter, in the method 'paintDecorations'.
This code assumes a decoration is a single 'line'.  It also depends on
batik.gvt.text.GlyphLayout to provide raw geometry, this class also 
assumes
decorations are a single line.

> For my application I take another XML model and translate that into SVG 
for
> output to PDF or JPG.  One solution I've considered is to find some 
Batik
> API that would let me extract out the lines of text that the flowRoot 
code
> generates and then re-generate the SVG document using plain <text> 
elements.
> I'm not thrilled by this approach but it would work for me in the short
> term.

   The code that does the wrapping is batik.gvt.flow.FlowTextPainter.
It collects the lines in a list, lineInfos but currently that is dropped
at the end of the 'textWrap' method.

> Any idea what API I might want to use (or even locally hack up) that I 
could
> feed it a flowRoot element and get back a set of lines.  I'm more than
> willing to cut and extract code to get this working.

   I think if you had the List of LineInfo Objects you could do something.
It's worth noting that FlowTextPainter is a subclass of 
StrokingTextPainter,
so it could override 'paintDecorations' to draw decorations better.

> > -----Original Message-----
> > Hi John,
> >
> > "John Hinke" <jo...@gmail.com> wrote on 06/18/2007 10:24:07 AM:
> >
> > > I've run across what I think is a bug in the flowRoot rendering 
code:
> > > text-decoration styles don't show up.  Here's the example SVG:
> >
> >    Well, you are right.  Flow text ignores text-decoration (incomplete
> > implementation). However, since we still don't have an idea where the
> > SVG WG is going with wrapped text in SVG 1.2 Full it's not likely to
> > be fixed any time real soon.
> >
> >    You can file a bug report if you want, but I doubt much work will
> > be done on it until SVG 1.2 Full is fairly well settled.
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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


RE: flowRoot text-decoration bug

Posted by John Hinke <hi...@ashlandhome.net>.
Hi Thomas,

I'll file a bug (it's always good to remember them anyway). But I'd be more
interested in trying to fix this myself.  Would you be willing to give me a
few pointers on where to start looking?  I just need something fairly
short-term right now.

For my application I take another XML model and translate that into SVG for
output to PDF or JPG.  One solution I've considered is to find some Batik
API that would let me extract out the lines of text that the flowRoot code
generates and then re-generate the SVG document using plain <text> elements.
I'm not thrilled by this approach but it would work for me in the short
term.

Any idea what API I might want to use (or even locally hack up) that I could
feed it a flowRoot element and get back a set of lines.  I'm more than
willing to cut and extract code to get this working.

Ideas?

Thanks,

John


> -----Original Message-----
> Hi John,
>
> "John Hinke" <jo...@gmail.com> wrote on 06/18/2007 10:24:07 AM:
>
> > I've run across what I think is a bug in the flowRoot rendering code:
> > text-decoration styles don't show up.  Here's the example SVG:
>
>    Well, you are right.  Flow text ignores text-decoration (incomplete
> implementation). However, since we still don't have an idea where the
> SVG WG is going with wrapped text in SVG 1.2 Full it's not likely to
> be fixed any time real soon.
>
>    You can file a bug report if you want, but I doubt much work will
> be done on it until SVG 1.2 Full is fairly well settled.
>



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


Re: flowRoot text-decoration bug

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

"John Hinke" <jo...@gmail.com> wrote on 06/18/2007 10:24:07 AM:

> I've run across what I think is a bug in the flowRoot rendering code:
> text-decoration styles don't show up.  Here's the example SVG:

   Well, you are right.  Flow text ignores text-decoration (incomplete
implementation). However, since we still don't have an idea where the 
SVG WG is going with wrapped text in SVG 1.2 Full it's not likely to 
be fixed any time real soon.

   You can file a bug report if you want, but I doubt much work will
be done on it until SVG 1.2 Full is fairly well settled.

> <?xml version="1.0" standalone="no"?>
> <svg version="1.2"
>     xmlns="http://www.w3.org/2000/svg"
>     id="body" width="792" height="612" viewBox="0 0 792 612">
>   <title>Text-decoration bug in flowRoot tag.</title>
>   <g>
>     <flowRoot xml:space='preserve'>
>       <flowRegion>
>         <rect visibility="hidden" x='48' y='396' width='146' 
height='119'/>
>       </flowRegion>
>       <flowDiv>
>         <flowPara text-decoration="underline" font-family="Arial"
> font-size="22.5" fill="#000000"><![CDATA[This should be
> underlined!]]></flowPara>
>       </flowDiv>
>     </flowRoot>
>   </g>
> </svg>
> 
> Thoughts?
> 
> I'd be more than willing to try to fix this if somebody could point me
> in the right direction in the code.  Or even better, if there's
> something I'm doing wrong and can easily fix the above, that would be
> great.
> 
> Thanks,
> 
> John Hinke
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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