You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Vincent Hennebert <vi...@enseeiht.fr> on 2005/12/13 10:49:20 UTC

Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Don't know it this bug should be closed?

Vincent

bugzilla@apache.org a écrit :
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://issues.apache.org/bugzilla/show_bug.cgi?id=37879>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
> INSERTED IN THE BUG DATABASE.
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=37879
> 
> 
> 
> 
> 
> ------- Additional Comments From vincent.hennebert@enseeiht.fr  2005-12-13 10:52 -------
> This is broken in fop-0.90 with the provided Batik jar. It should work with the
> svn versions of /both/ Fop and Batik. You may look at [1] and [2] for details. I
> think this is the only solution for now if you need this functionality.
> 
> Regarding the strokeText option, it has not been implemented in the Trunk
> because its usefulness is doubtful (see [2]). Text will be rendered as text
> whenever possible, strokes will only be used as fallbacks.
> 
> HTH
> 
> [1] http://marc.theaimsgroup.com/?l=fop-dev&m=113293237123386&w=2
> [2] http://marc.theaimsgroup.com/?l=fop-dev&m=113301057529277&w=2
> 


Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Posted by Adam Strzelecki <on...@java.pl>.
Once again me,

Seems all fonts are embedded nicely now with the patch but styles
related to text object stroke such as:
stroke:#6e6e6e;stroke-width:4.10672631;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;

..are ignored with that implementation. I believe that it's possible to
make it also work (XEP does that).

Just wanted let you know.

Regards,
-- 
Adam Strzelecki |: nanoant.com :|

Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Posted by Adam Strzelecki <on...@java.pl>.
Hi once more,

>>> I believe that with FOP 0.20.5 tspans were handled too (however I might
>>> be wrong), because PDF generated with old version were OK.
>>     I believe the old version ignored all the problems that 
>> sub-tspans with x & y cause and just rendered them as normal
>> text.  This might have 'worked' for your case but is why there
>> was a 'stroke text' option as it would get many cases wrong.
> I see, then maybe you can point out how to simply patch the TRUNK code
> to work like 0.20.5 for 'tspans' even it is wrong ?? Of course I wish to
> use it internally for myself as I'm generating lot of docbook documents
> with SVG drawings with text.

Okay ... I was very anxious and did patch for the code by myself. Seems
to work fine with my SVGs... I just took the PDFTextPainter code from
0.20.5 which was doing some counting for TSPANs.

Attached patch... might be useful.

Anyway... I have a now PERFECT FOP for my documents :)))

Regards,
-- 
Adam Strzelecki |: nanoant.com :|

Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Posted by Adam Strzelecki <on...@java.pl>.
Hi,

>> Is there any change to handle them also like simple text ?
>     Assuming you mean chance?  Yes it is possible but
> it is _far_ from trivial.  A 'tspan' is quite a bit
> different from 'text' in particular a tspan inherits it's
> position from previous tspans/text so placement is complex.
> 
>     There are essentially two paths to go down.
>         1) rewrite the existing SVG text support for PDF,
>            implementing what pieces can be implemented as
>            a series of 'drawString' calls.
>         2) Rework the PDFGraphics2D to enable proper output
>            from a GlyphVector - or more correctly a custom
>            version of a GlyphVector as the JDK version does
>          not (I think) provide enough information for transcoding.
Alright.... I'll try to fix my SVG files to use simple text though.
Nevertheless I'll look forward implementation 'tspans' for text
rendering you describe.

> 
>> I believe that with FOP 0.20.5 tspans were handled too (however I might
>> be wrong), because PDF generated with old version were OK.
> 
>     I believe the old version ignored all the problems that 
> sub-tspans with x & y cause and just rendered them as normal
> text.  This might have 'worked' for your case but is why there
> was a 'stroke text' option as it would get many cases wrong.
I see, then maybe you can point out how to simply patch the TRUNK code
to work like 0.20.5 for 'tspans' even it is wrong ?? Of course I wish to
use it internally for myself as I'm generating lot of docbook documents
with SVG drawings with text.

Best regards,
-- 
Adam Strzelecki |: nanoant.com :|

Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

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

Adam Strzelecki <on...@java.pl> wrote on 12/13/2005 08:17:38 AM:

> >    None of your content uses 'simple' text.  All of your
> > text uses child tspan's with 'x' & 'y' attributes.  This falls into
> > the case of complex text so we stroke the text.
> Booo... so we need to stroke tspans ? 

   Tspans with 'x' & 'y' attrs yes.

> Is there any change to handle them also like simple text ?
    Assuming you mean chance?  Yes it is possible but
it is _far_ from trivial.  A 'tspan' is quite a bit
different from 'text' in particular a tspan inherits it's
position from previous tspans/text so placement is complex.

    There are essentially two paths to go down.
        1) rewrite the existing SVG text support for PDF,
           implementing what pieces can be implemented as
           a series of 'drawString' calls.
        2) Rework the PDFGraphics2D to enable proper output
           from a GlyphVector - or more correctly a custom
           version of a GlyphVector as the JDK version does
         not (I think) provide enough information for transcoding.

> I believe that with FOP 0.20.5 tspans were handled too (however I might
> be wrong), because PDF generated with old version were OK.

    I believe the old version ignored all the problems that 
sub-tspans with x & y cause and just rendered them as normal
text.  This might have 'worked' for your case but is why there
was a 'stroke text' option as it would get many cases wrong.


Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Posted by Adam Strzelecki <on...@java.pl>.
Hi Thomas,

Many thanks for instant reply,

>    None of your content uses 'simple' text.  All of your
> text uses child tspan's with 'x' & 'y' attributes.  This falls into
> the case of complex text so we stroke the text.
Booo... so we need to stroke tspans ? Is there any change to handle them
also like simple text ?
I believe that with FOP 0.20.5 tspans were handled too (however I might
be wrong), because PDF generated with old version were OK.

Regards,
-- 
Adam Strzelecki |: nanoant.com :|

Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

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

Adam Strzelecki <on...@java.pl> wrote on 12/13/2005 07:54:13 AM:

>>> It should work with the svn versions of /both/ Fop and Batik. You 
>>> may look at [1] and [2] for details.

> Alright but I'm using FOP SVN trunk & I was trying with both
> batik-1.6.jar from TRUNK (SVN) and some nigtly of Batik (26.11) and both
> of the producing stroked fonts for my SVG files.

> Have a look at:
> http://pingu.ii.uj.edu.pl/~ono/download/fop-0.90-trunk-svg-bug/

   None of your content uses 'simple' text.  All of your
text uses child tspan's with 'x' & 'y' attributes.  This falls into
the case of complex text so we stroke the text.

> Consider that I'm not using standard PDF fonts but Garamond TT font
> embedded (set in fop.xconf). If you are running WinXP you should have 
them.

   I don't think it has anything to do with fonts...

> >> Regarding the strokeText option, it has not been implemented in the 
Trunk
> >> because its usefulness is doubtful (see [2]). Text will be rendered 
as
> >> text whenever possible, strokes will only be used as fallbacks.
> Yea this is for sure. I don't see why somebody would like to force
> stroking... ;)


Re: DO NOT REPLY [Bug 37879] - PDF SVG rendering forces stroking text (config setting broken)

Posted by Adam Strzelecki <on...@java.pl>.
Hi.

>> This is broken in fop-0.90 with the provided Batik jar. It should work
>> with the
>> svn versions of /both/ Fop and Batik. You may look at [1] and [2] for
>> details. I
>> think this is the only solution for now if you need this functionality.
Alright but I'm using FOP SVN trunk & I was trying with both
batik-1.6.jar from TRUNK (SVN) and some nigtly of Batik (26.11) and both
of the producing stroked fonts for my SVG files.

Consider that I'm not using standard PDF fonts but Garamond TT font
embedded (set in fop.xconf). If you are running WinXP you should have them.

Have a look at:
http://pingu.ii.uj.edu.pl/~ono/download/fop-0.90-trunk-svg-bug/

Look at setupfonts.bat script which is preparing XMLs for FOP config.
Look at my config fop.xconf.

>> Regarding the strokeText option, it has not been implemented in the Trunk
>> because its usefulness is doubtful (see [2]). Text will be rendered as
>> text
>> whenever possible, strokes will only be used as fallbacks.
Yea this is for sure. I don't see why somebody would like to force
stroking... ;)

>> [1] http://marc.theaimsgroup.com/?l=fop-dev&m=113293237123386&w=2
>> [2] http://marc.theaimsgroup.com/?l=fop-dev&m=113301057529277&w=2
Still didn't manage to NO stroke fonts in my embedded SVG files :(

Regards,
-- 
Adam Strzelecki |: nanoant.com :|