Skip to content
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

converted characters flock #328

Open
retsyo opened this issue Apr 6, 2022 · 7 comments
Open

converted characters flock #328

retsyo opened this issue Apr 6, 2022 · 7 comments

Comments

@retsyo
Copy link

retsyo commented Apr 6, 2022

I installed latest svglib and reportlab-3.6.9-cp38-cp38-win_amd64.whl on python-3.8.1.amd64 on my windows 10 64 bits.

however the generated png and pdf is in a mess

the original svg and generated pdf/png is in the attached zip
tmp.zip

from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF, renderPM

drawing = svg2rlg("tmp.svg")
renderPDF.drawToFile(drawing, "file.pdf")
renderPM.drawToFile(drawing, "tmp.png", fmt="PNG")
@github-actions
Copy link

github-actions bot commented Apr 6, 2022

Thank you for raising your first issue! Your help to improve svglib is much appreciated!

@claudep
Copy link
Collaborator

claudep commented Apr 6, 2022

Your original svg looks weird, when opening it with inkscape, I'm only seeing a blank page.

@retsyo
Copy link
Author

retsyo commented Apr 7, 2022

but all of Edge/Chrome/FireFox/CairoSVG can render it correctly

@deeplook
Copy link
Owner

deeplook commented Apr 7, 2022

FWIW, it looks ok in https://www.svgviewer.dev.

claudep added a commit to claudep/svglib that referenced this issue Apr 8, 2022
@claudep
Copy link
Collaborator

claudep commented Apr 8, 2022

When debuging this issue, I find different issues. It looks like <symbol> handling is broken in several ways currently in svglib.
I'll see if I can do something. I started in #329 by only rendering <symbol> when referenced, as the specs says (A [‘symbol’] element itself is not rendered.) It is not fixing this issue yet, as after that patch, your document will be blank.

@claudep
Copy link
Collaborator

claudep commented Apr 8, 2022

#330 was another issue hit by your file.

@retsyo
Copy link
Author

retsyo commented Apr 13, 2022

no, if I use the lastet cloned svglib, my script in the beginning post can only produce blank PDF and PNG, in other words, there is no character in PDF and PNG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants