JYR created FOP-3058: ------------------------ Summary: AFP-Renderer does not honour fill-rule 'nonzero' of SVG path. Key: FOP-3058 URL: https://issues.apache.org/jira/browse/FOP-3058 Project: FOP Issue Type: Bug Components: image/svg, renderer/afp Affects Versions: 2.7 Reporter: JYR Attachments: GreenCrossAsAFP.png, GreenCrossAsPDF.png, TestWithSVGPath-1.7z
Hi there, We have just isolated an interesting bug in the AFP renderer. We are embedding some SVG graphics in a FO file and the AFP renderer does not seem to take the "fill-rule" attribute into account. It seems to ignore the fill-rule 'nonzero' of our path and defaults to 'evenodd'. The PDF renderer does honour this fill-rule, but not the AFP renderer. We have isolated this issue in a test project. Just deflate [^TestWithSVGPath-1.7z]. All the necessary files are provided. This is the correct output of the PDF renderer !GreenCrossAsPDF.png! This is the output of the AFP renderer. !GreenCrossAsAFP.png! FOP integration: * We are calling FOP via java.exe. * FOP is configured with an xconf file. Extract of FO-File {code:xml} <fo:instream-foreign-object> <svg width="46mm" height="46mm" version="1.1" viewBox="0 0 130.394 130.394" xmlns="http://www.w3.org/2000/svg"> <g font-family="Helvetica,Arial,"Liberation Sans"" transform="translate(0 130.394)"> <!-- Red background --> <path fill="red" shape-rendering="crispEdges" d=" M56.693,-73.701 h17.008 v17.008h -17.008 z"/> <!-- Green cross, vertical block first, then horizontal --> <path fill="green" fill-rule="nonzero" shape-rendering="crispEdges" d=" M63.543,-70.709 h 3.307 v 11.024 h -3.307 z m-3.858,3.858 h11.024 v3.307 h-11.024 z "/> <!-- 2 Rectangles as workaround for Bug in AFP-Renderer --> <!-- <rect x="59.685" y="-66.85" width="11.024" height="3.307" fill="powderblue"/> --> <!-- <rect x="63.543" y="-70.709" height="11.024" width="3.307" fill="powderblue"/> --> </g> </svg> </fo:instream-foreign-object> {code} We spotted this bug with FOP version 0.95, but it still occurs with FOP 2.7. -- This message was sent by Atlassian Jira (v8.20.1#820001)