-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svglib fails to render properly #380
Comments
Thank you for raising your first issue! Your help to improve svglib is much appreciated! |
Without running svglib on it, but looking only at this, likely more official, source... I see already some differences in the centre (British spelling, sic...). Have you tried that? https://en.wikipedia.org/wiki/File:Flag_of_the_United_Kingdom.svg |
In fact it seems easier to drop the monkeypatch cmpletely and change the rl name in the mapping for fill-rule from _fillRule to fillMode. It seems reportlab has supported fillMode for most things since 2017 so perhaps the _fillRule hacks can be dropped now. |
I'm fine with this proposal, would you mind suggesting a patch? |
Removing code, especially in form or ugly hacks, while not changing functionality is always a good idea. |
I will try and create a pull over the next few days. My git skills are lacking so it might be a learning exercise. For some reason I could not get the pytest(s) to run. Probably something wrong with the way I'm running it.. I did some testing and find that svg doesn't seem to mind at all when fill type attrubutes are used on non-fillables eg a line. In svglib these seem to end in a log message (because reportlab objects to say fillMode being set on a non SolidShape), but the conversion proceeds. I might add some more info into |
I have created a pull request #381 which I think worls, but github is objecting to something. |
We should fix #382 first, which will solve the test issue. |
I'll resubmit the pull when you want. |
I am amazed that [pre-commit.ci] has changed some of the python code and removed some white space. Why can't the robots actually fix the code logic? :) |
@MrBitBucket I was still able to produce the issue besides your monkeypatch_reportlab() Seems like its caused by missing arguments in convertPath
Path is being called but Path takes arguments which aren't filled in when using convertPath fillMode will default to FILL_EVEN_ODD
Maybe it's good to fix this. Im just new here but had a hell of a time today getting my broken signatures to fit in my pdf xD |
With svglib 1.5.1 I see that the pdf generated for https://flagicons.lipis.dev/flags/4x3/gb.svg is not as rendered in a browser. Something seems to be wrong with the middle of the union flag.
I tested with svglib 1.4.1 & 1.5.1 and reportlab 3.6.12 & 4.0.4.
I see a similar issue with this version https://freesvg.org/download/147712
but not with this one https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_United_Kingdom_(3-5).svg
Is there some common error in the failures that browsers fix easily?
The text was updated successfully, but these errors were encountered: