andymeneely / squib

A Ruby DSL for prototyping card games.
http://squib.rocks
MIT License
915 stars 66 forks source link

Export SVG? #310

Closed undercoverdesigns closed 4 years ago

undercoverdesigns commented 4 years ago

Is there any way to add an option to export items as SVG, or at least the shapes and any SVG's imported into the design (i.e., excluding text and pngs)?

I know this is a VERY edge case, and fully expect that it's not worth the time, but I'm looking to export items for a laser cutter, and exporting as PNG and trying to convert just isn't cutting it. (That pun was WHOLLY unintended)

andymeneely commented 4 years ago

You can! See this: https://squib.readthedocs.io/en/v0.15.0/backends.html

It's not as simple as "save_svg" because Squib needs to know that you want SVG from the very beginning so that it can make a separate backend in Cairo. The "save" is kind of automatic at that point. There are some edge cases that have to rasterize things but most of the time it remains vector.

undercoverdesigns commented 4 years ago

Well, awesome! I should have paid better attention to that section of the docs!