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

SVG gradients don't render #1719

Closed
TadaCZE opened this issue Sep 15, 2022 · 2 comments · Fixed by #1771
Closed

SVG gradients don't render #1719

TadaCZE opened this issue Sep 15, 2022 · 2 comments · Fixed by #1771
Labels
feature New feature that should be supported

Comments

@TadaCZE
Copy link

TadaCZE commented Sep 15, 2022

I noticed when trying to add the following file into my document, that the gradient on the letter j does not render and the letter is not displayed. I do not know if this is a bug or unimplemented feature, but the support for gradients already is in weasyprint for normal html. If anyone knows what I need to achieve without svg gradients, tell me (a workaround).

stavjani

@liZe
Copy link
Member

liZe commented Sep 15, 2022

Hi!

The problem is that we don’t support (yet) the href attribute of gradients.

As a workaround, you can replace

      <linearGradient
          inkscape:collect="always"
          id="linearGradient885">
        <stop
            style="stop-color:#b388c5;stop-opacity:1;"
            offset="0"
            id="stop881" />
        <stop
            style="stop-color:#030422;stop-opacity:1;"
            offset="1"
            id="stop883" />
      </linearGradient>
      <linearGradient
          inkscape:collect="always"
          xlink:href="#linearGradient885"
          id="linearGradient887"
          x1="81.66954"
          y1="71.572083"
          x2="84.236176"
          y2="51.393879"
          gradientUnits="userSpaceOnUse" />

by

      <linearGradient
          inkscape:collect="always"
          id="linearGradient887"
          x1="81.66954"
          y1="71.572083"
          x2="84.236176"
          y2="51.393879"
          gradientUnits="userSpaceOnUse">
        <stop
            style="stop-color:#b388c5;stop-opacity:1;"
            offset="0"
            id="stop881" />
        <stop
            style="stop-color:#030422;stop-opacity:1;"
            offset="1"
            id="stop883" />
      </linearGradient>

I’ve seen (too?) many SVG documents in my life, I’ve spent weeks reading the documentation, and it’s the first time I meet this feature. This format is full of beautiful features that we should consider as presents given to the people spending their sleepless nights implementing renderers, what an incredible time to be alive…

@liZe liZe added the feature New feature that should be supported label Sep 15, 2022
@TadaCZE
Copy link
Author

TadaCZE commented Sep 15, 2022

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants