mapbox / spritezero-cli

A command-line interface to spritezero.
Other
166 stars 64 forks source link

Fails to convert svg (which contains <use> tags) #26

Open jliebrand opened 6 years ago

jliebrand commented 6 years ago

The attached svg does not seem to get converted in to the png sprite (nor does it throw an error btw).

I suspect the tags to cause the problem a- is there a way to ensure it does convert? and if not b- do you have any recommendation on any tools that can replace tags with the referenced tags? preferably a commandline tool rather than some gui

Star.svg.zip

samanpwbb commented 6 years ago

I had a quick look at your SVG. I think you're running into an upstream issue (https://github.com/mapnik/mapnik/issues/2968) with xlink:href properties in Mapnik's SVG renderer – which is what spritezero uses under the hood. As a workaround, consider applying the fill and stroke properties directly to your path.

jliebrand commented 6 years ago

Thanks - that mapnik bug was raised three years ago with the last update one year ago... doesn't sound like that'll get fixed any time soon?

Unfortunately the svgs I have (lots of them) are produced via figma.com where I do not have control over the export properties. And I've yet to find a tool that can (mass)update them either :-/

dieterdreist commented 6 years ago

maybe you can do it with inkscape, which is scriptable.