Kozea / CairoSVG

Convert your vector images
https://courtbouillon.org/cairosvg
GNU Lesser General Public License v3.0
773 stars 151 forks source link

Embedded SVG paths don't get scaled #327

Open sjml opened 3 years ago

sjml commented 3 years ago

I'm generating an SVG file that links to other SVG files using <image> tags. When I view the resulting parent SVG in a browser, things look fine, but when I use CairoSVG to convert it to PDF, the paths inside the child SVG don't get scaled.

Attached are some examples that illustrate the problem. If you look at japanese.svg, you see a series of paths (baked from text) on a blue background, filling the viewbox. If you open assembled.svg in Firefox or Chrome, you can see that image, referenced via an <image> tag, centered and resized.

However, you can see in assembled.pdf the result of running cairosvg ./assembled.svg -o ./assembled.pdf. The background rectangle is appropriately sized, but the paths are not. (Screenshot below.)

mis-sized paths in properly sized background

I have control over the generation of both the child and the parent files, so if there's some change to the markup I can make which would fix this, please let me know. Otherwise I think this might be a bug.

embedded-svg-bug.zip

grewn0uille commented 2 years ago

Hello!

As you may have noticed, CairoSVG isn’t a full-of-life project and it hasn’t seen much activity for a year…

For a long time, CairoSVG was used by WeasyPrint. To render SVG, PNG or PDF, CairoSVG depends on Cairo, which brought many bugs and limitations in WeasyPrint (and CairoSVG). This led us to remove the Cairo dependency from WeasyPrint, and so to remove the CairoSVG dependency.

Since then, we didn’t do really much on CairoSVG. And, to be honest, we’re not sure about what to do with this project 🤔.

A lot of questions have emerged in our heads. Can it still be a CourtBouillon project, shall we entrust it to someone else? Do people actually expect new features, or only bug fixes? Maybe people don’t expect anything?

And in fact, we can’t answer these questions all by ourselves because we’re not you, we’re not the people using CairoSVG.

So, to know you, your use of CairoSVG and your expectation about the project, we prepared a (short, don’t worry) survey.

Your answers to this survey will help us a lot to come up to a decision about CairoSVG.

The survey is open until the end of April!

The CourtBouillon Team 🍲

Edit: the survey is now closed. Results will be publish soon!

grewn0uille commented 2 years ago

Hello!

The results of the survey have been published! You can discover where CairoSVG is going in our latest blog article 📰.

The CourtBouillon Team 🍲