Closed reureu closed 2 years ago
There is no code in this library generating the Swiss cross in SVG directly. Instead, there is general code drawing the Swiss cross and multiple backends for generating SVG, PDF (with multiple PDF libraries), PNG, EMF etc. The common interface is ICanvas
.
ICanvas
is defined such that AddRectangle
doesn't draw an independent rectangle but instead adds a rectangle to a path, which is then stroked or filled. So I'm afraid I can't change it without breaking all the backend implementations.
What's the exact limitation in Apache FOP? Is it the winding direction or the fact that the two rectangles within the same path overlap?
We could possibly change it into a single subpath with 8 explicit points (instead of 2 overlapping subpaths).
Hi @manuelbl ,
Thanks for your reply and your short reaction time!
Yes, the problem is the overlap of the 2 rectangles within the same path.
In other words, the AFP-renderer in FOP does not honour the fill-rule. It seems to assume a fill-rule of kind "evenodd". See here to understand the difference. https://www.w3.org/TR/SVG/painting.html#WindingRule
So, yes, a single subpath with 8 explicit points would probably work. Or perhaps 2 separate paths for the rectangles making up the cross.
Kind regards, Reureu
I would be happy to submit a PR if you're interested.
I'm happy to accept a PR.
Is this repo open for pushes?
Yes, it is
Resolved with version 3.0.3.
Hi there,
Apache FOP is unable to properly render the QR-code that SwissQRBill generates as SVG file. This is due to a bug in the AFP renderer of Apache FOP: https://issues.apache.org/jira/browse/FOP-3058
The problem is related to the path of the Swiss cross that SwissQRBill generates.
The cross is described as
Unfortunately, FOP doesn't interpret this white cross correctly when generating an AFP file, and adds a black square in the middle of the Swiss cross.
Would it be okay to change the way the cross is added to the QR code?
I am fully aware that this would only be a workaround for a bug in a different software library, but it would certainly be much simpler and quicker to implement this workaround in SwissQRBill.
What do you reckon?
Kind regards, Reureu