-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
SVG rendering problem #2234
Comments
Hi! Thanks for the report. The bug happens because transforms are not applied to <svg height="100" width="100" xmlns="http://www.w3.org/2000/svg">
<symbol id="rect">
<rect x="0" y="0" width="25" height="25" />
</symbol>
<use x="0" y="0" transform="skewX(30)" href="#rect" />
</svg> |
I’ve actually fixed 3 (!!) different bugs thanks to your sample:
We can now correctly render symbols with visible overflow and no explicit size referenced by (Out of curiosity, which tool do you use to generate these SVG files?) The rendering is now close to what browsers draw: Looks like some black stroke is missing. Any idea about what could do this? |
That's crazy. Thanks! |
pardon my ignorance, but what's the easiest way of testing the last changes to the code if i've only been using windows executable / commandline so far? |
Yes, that’s what I thought. That’s a tool you’re developing?
Executable files are automatically generated for each commit, you can find them here: https://github.com/Kozea/WeasyPrint/actions/workflows/exe.yml |
Yep, it's a tool - product configurator for ordering various sun shading stuff. There's a part of it that generates an SVG drawing representing a simplified view of the product, with dimensions, colors etc according to choices made by the user. Most of it is flat (like roller blinds) but the pergola was a little challenging because it's not flat - that's how the fake 3d view was born. |
And first test done with the most recent Windows build https://github.com/Kozea/WeasyPrint/actions/runs/10498523124 Much better, but there's a bit missing in my result - the dimension numbers are not visible. But on your screenshot they're there. |
I think there's a problem with rendering 'monospace' font family specified in my style
if font-weight is bold then the text renders. If font-weight:normal, or not specified at all - doesn't render |
That’s strange, I didn’t have the problem. It’s probably caused by the fonts installed on your system, using a specific font family instead of Monospace will probably work too. The other difference I was talking about is the missing black lines around the slats at the top of the pergola (if it’s a pergola 😄). It can be fixed with |
I think that everything’s fixed now. The result is great, the only problem I have is with the text: there’s a small black stroke line on text, that’s too visible in some PDF readers at some zoom levels (and even in browsers, actually). That’s caused by the |
Beautiful. let's close it, i'll be doing more tests in next days so if there's anything else, i'll make a new task. |
Hi, attached test case shows some problems with svg graphics support
examples.zip
this is how the svg image looks rendered in the browser
and this is how it looks after converting to PDF with weasyprint:
I suppose there's some problem with svg transform() implementation.
test1.zip
using WeasyPrint version 62.3 on Windows (standalone executable)
The text was updated successfully, but these errors were encountered: