Bug 37330 - [PATCH] FOP Bridges not properly registered with Batik
Summary: [PATCH] FOP Bridges not properly registered with Batik
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: svg (show other bugs)
Version: all
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 12:09 UTC by Thomas Deweese
Modified: 2012-04-01 06:25 UTC (History)
0 users



Attachments
Fix bridge registration (2.52 KB, patch)
2005-11-02 12:11 UTC, Thomas Deweese
Details | Diff
Few suggestions for improving current code for SVG bridges (1.47 KB, patch)
2005-11-13 05:30 UTC, Thomas Deweese
Details | Diff
Update to tweak.patch that works. (3.65 KB, patch)
2005-11-14 14:12 UTC, Thomas Deweese
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deweese 2005-11-02 12:09:10 UTC
Since ~Batik 1.6 the FOP bridges have not been properly
registered with Batik.  This prevents any text from
begin rendered as text as well as preventing JPEG's
from being embedded directly.

The problem was caused by Batik moving bridge 
registration until after the Document is available
so that it knows if it should register SVG 1.1 or
SVG 1.2 Bridges.
Comment 1 Thomas Deweese 2005-11-02 12:11:43 UTC
Created attachment 16851 [details]
Fix bridge registration

This patch fixes the bridge registration by 
creating a subclass of BridgeContext and
overriding registerBridges to replace the
standard SVG bridges after the baseclass
has done it's registration.
Comment 2 Jeremias Maerki 2005-11-09 16:47:38 UTC
Patch applied: http://svn.apache.org/viewcvs?rev=332070&view=rev

Thanks. That was really important. I knew about the problem but never found time
to track it down. I guess I'll need to do the same for EPS.

While testing I found that certain SVG files have a problem with text rendering,
for example in paths-data-03-f.svg from the W3C SVG 1.1 test suite. Most of the
text is either clipped or overpainted with white. I'll try to track down the cause.
Comment 3 Thomas Deweese 2005-11-13 05:30:32 UTC
Created attachment 16956 [details]
Few suggestions for improving current code for SVG bridges

This has two improvements to the current code in SVN.
1) The jpeg registration now includes the hashCode in addition
   to the jpegCount as this prevents images being rused when
   multiple SVG fragments are included in a single FO.

   The real fix would be for the pdfDocument to track this,
but the 'simple' ways of doing this looked really ugly.

2) Added a createBridgeContext to PDFBridgeContext so that 'sub contexts'
   (image element) inherit the new bridges.
Comment 4 Thomas Deweese 2005-11-14 14:12:58 UTC
Created attachment 16962 [details]
Update to tweak.patch that works.

This fixes a stupid merge mistake.  Sorry for the confusion.
Comment 5 Thomas Deweese 2005-11-14 14:20:47 UTC
(In reply to comment #2)
> Patch applied: http://svn.apache.org/viewcvs?rev=332070&view=rev
> 
> While testing I found that certain SVG files have a problem with text rendering,
> for example in paths-data-03-f.svg from the W3C SVG 1.1 test suite. Most of 
> the text is either clipped or overpainted with white. I'll try to track 
> down the cause.

   Hmm, this renders fine for me (at least with my patch, but I don't
think it would affect anything in that SVG file).  How are you
rendering the document?  Using the Batik svgrasterizer or are you
creating a skelton FO to reference it?
Comment 6 Jeremias Maerki 2005-11-14 15:44:58 UTC
Patch from comment #4 applied. Thanks, Thomas.

Revision: http://svn.apache.org/viewcvs?rev=344130&view=rev

To reproduce the problem I mentioned in #2, take
samples/tests/spec/text/textLayout.svg, for example. All the texts that are
painted with the text bridge are incomplete. This is reproducible with the
Transcoder and embedded in FO. I'm getting to debugging this just now.
Comment 7 Jeremias Maerki 2005-11-14 17:03:59 UTC
Got the little bugger. :-) No more clipped text when painted through the PDF
text painter:
http://svn.apache.org/viewcvs?rev=344148&view=rev
Comment 8 Glenn Adams 2012-04-01 06:25:02 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed