linebender / resvg

An SVG rendering library.
Apache License 2.0
2.84k stars 229 forks source link

Gradient issue #756

Closed IskandarAlex2 closed 6 months ago

IskandarAlex2 commented 6 months ago

I am making a media server with an SVG to PNG on-the-fly renderer. The issue is that it doesn't work right when the SVG contains a gradient. The images explain the problem.

what it should have been what it rendered

As additional information, the SVG was exported from Penpot with a linear gradient as the canvas background color. I should also note that the Rust server runs inside a Docker Container. I do this because resvg fail to run inside my Windows machine and let's just say I want to make sure it works inside the environment it is supposed to run in.

LaurenzV commented 6 months ago

Can you provide the original SVG as well? Otherwise it's hard to debug...

IskandarAlex2 commented 6 months ago

Here, the font is Audiowide which you may have to download and install into your system font so that resvg recognize it

Somethings3

IskandarAlex2 commented 6 months ago

okay for some reason the svg broke after uploading to GitHub so here a zip file Somethings3.zip

RazrFalcon commented 6 months ago

Can confirm:

Warning (in usvg::parser::style:141): Failed to parse fill value: 'url("#fill-color-gradient-render-1-0")'. Fallback to black.

This is because of quoted urls. That's a relatively new feature and we do not support it well.

RazrFalcon commented 6 months ago

We allow only single quotes in svgtypes...