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

Use rsvg instead of Chromium #8

Closed
drzraf opened this issue Jul 8, 2021 · 4 comments
Closed

Use rsvg instead of Chromium #8

drzraf opened this issue Jul 8, 2021 · 4 comments
Assignees

Comments

@drzraf
Copy link

drzraf commented Jul 8, 2021

Similar to #1
Eg: Use https://www.cairographics.org/cookbook/pyrsvg/ instead of a npm package that download pupeeter to control a 135MB Chrome binary...

@jkenlooper
Copy link
Owner

A previous version was using Cairo in order to render the SVG to PNG. The one feature that was different in how Cairo rendered SVG compared to Chromium was dealing with how the SVG Paths handled scaling the stroke-width. Specifically the vector-effect attribute and when it is set to non-scaling-stroke. If I use Cairo the stroke width doesn't correctly implement the non-scaling-stroke like Chromium does resulting in thicker lines. The thicker lines would then create larger gaps when pixsaw is used to create multiple pieces from that generated graphic.

Now it could be possible to improve pixsaw's algorithm when it is working with thicker lines to avoid creating gaps between the pieces. Then piecemaker could switch back to using Cairo.

I think it would be good to also better document why Chromium is being used here instead of the lighter weight library like Cairo. I'll keep this issue open until then.

@drzraf
Copy link
Author

drzraf commented Jul 9, 2021

Is there a public open issue/pr to track on Cairo bugtracker?

@jkenlooper
Copy link
Owner

https://gitlab.freedesktop.org/cairo/cairo/-/issues
I didn't see anything specific for this minor issue with vector-effect and non-scaling-stroke.

jkenlooper added a commit that referenced this issue Nov 16, 2021
Alternative work in progress to support #8 and get rid of the chrome
dependency.
@jkenlooper jkenlooper self-assigned this Nov 16, 2021
@jkenlooper
Copy link
Owner

Dropped the dependency on Chrome along with svgo in piecemaker version 0.4.3.

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

2 participants