iconic / illustrator-svg-exporter

A better way to generate SVGs from Illustrator.
603 stars 45 forks source link

width and height #8

Closed azisher closed 9 years ago

azisher commented 9 years ago

Is there any way to add auto size of SVG like iconic? for example: width="128" height="128" and also add auto viewbox to default width and height (viewBox="0 0 128 128")?

Duncid commented 9 years ago

I am having the same problem. I worked my icons on a squared grid and SVG export scales the visuals in a different way due to its rectangle shape. Is there any information somewhere on the grid / rules Iconic use to design its icons ? why the rectangular shape ?

somerandomdude commented 9 years ago

Hey ya'll, there are a couple fixes for this.

The first is a bit of a hack, but it will work right now: Add a transparent rectangle to the icon you want to export at the size you'd like it to be exported as. For instance, if you have a 13x17 icon that you'd like to be exported as 24x24, but a transparent 24x24 transparent rectangle behind the icon in the same layer you've targeted to export. That will do the trick.

The second solution is better but not ready yet. The next version of the exporter will allow you to name and export artboards. The exporter uses the artboard's dimensions as the basis for sizing the SVG. This will allow you to create an individual artboard for each icon at the exact size you'd like it to be exported.

Let me know if this makes sense.

somerandomdude commented 9 years ago

I just committed a version of the exporter that allows artboard exporting. Give that a try and let us know what you think.

somerandomdude commented 9 years ago

Closing for now. Let me know if you run into any issues.