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.
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.
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.
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.
Created attachment 16962 [details] Update to tweak.patch that works. This fixes a stupid merge mistake. Sorry for the confusion.
(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?
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.
Got the little bugger. :-) No more clipped text when painted through the PDF text painter: http://svn.apache.org/viewcvs?rev=344148&view=rev
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed