The WMF test case I've just uploaded into Trunk will help you reproduce the problem. It's the same as with MathML. http://svn.apache.org/viewvc?rev=708838&view=rev
On 29.10.2008 10:38:14 Jeremias Maerki wrote: > Adrian, > > this change (r706226) introduced a problem with image handling in AFP. > AFPImageGraphics2DFactory assumes that all Graphics2DImagePainters > passed in are "GenericGraphics2DImagePainters" (the subclass you made > top-level from ImageConverterSVG2G2D, strange naming, BTW, because > there's nothing generic about this, it's very Batik/SVG-specific). If a > normal Graphics2DImagePainter is passed in, you get a ClassCastException. > That happens, for example, when you have a MathML document that is > handled through our example MathML extension. Please note that > ImageConverterSVG2G2D is supposed to be a generic SVG handler/converter > for output targets that don't have any special handling of SVG for > improved painting (custom bridges for text etc.). Now I finally > understand why you added a setGraphics2DImagePainter() method to > ImageGraphics2D. I assume you did this because of the following: > > Max changed the image flavor reported for SVG images: > http://svn.apache.org/viewvc?rev=695776&view=rev > That triggered a bug (uhm, missing feature) in the image loader > framework which resulted in SVG being returned as ImageGraphics2D > instead of ImageXMLDOM. I fixed this in: > http://svn.apache.org/viewvc?rev=706270&view=rev > So now, SVG images once again run through the AFPSVGHandler but in the > meantime you moved the bridge setup into the code that should actually > handle generic Graphic2D images. You might want to revisit that change. > > HTH > > On 20.10.2008 12:57:30 acumiskey wrote: > > Author: acumiskey > > Date: Mon Oct 20 03:57:29 2008 > > New Revision: 706226 > > > > URL: http://svn.apache.org/viewvc?rev=706226&view=rev > > Log: > > * SVG circle drawing improvements in AFPGraphics2D. > > * GenericGraphics2DImagePainter becomes a top level class. > > * AFPGraphics2DImagePainter implementation to correctly adjust y-axis for > > AFP. > > > > Added: > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/GenericGraphics2DImagePainter.java > > (with props) > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPImageConverterSVG2G2D.java > > (with props) > > Modified: > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPDataObjectFactory.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextHandler.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/goca/GraphicsSetProcessColor.java > > > > xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/goca/GraphicsString.java > <snip/> > > Jeremias Maerki Jeremias Maerki
