Improved one canvas workflow

Jimmac’s post got me thinking. His script did the job for a single icon. Why not improve upon it to allow multiple icons sharing a single SVG file? Immediately decided to give it a go and after a few iterations the result works as follows:

  1. You start by creating a template SVG.
  2. For each icon (not size) you create a layer and set its name to context/icon-name. You can use a different syntax but it has to contain at least one slash. The rest of the layers are treated as drawing aids.
  3. For each layer you create a sublayer and give it a name starting with plate. Inkscape requires you to have distinct layer labels so a simple plate won’t do for multiple icons but you are free to use names such as plate for foo.
  4. The plate consists of a set of rectangles. Each rectangle will result in a separate PNG and the size is taken verbatim from the rectangles (so make sure you don’t end up with ten decimal places in width or height).
  5. The plate also needs two text objects: one with label set to context and one with label set to icon-name. The text you put there is used to create the directory structure.
  6. Save your template to a directory called svg. Make sure you hide the plate layers before saving.
  7. Download the Split Icons script.
  8. Run the script. If you pass a path (or several paths), it will only process the files from the command line. If you don’t pass anything, it will process the whole svg directory.
  9. Draw art!

Here’s a template example.

PS: b.g.o upload sucks. It will only accept .gz files and then will strip the dot from the original extension.

Update: updated the script to handle the new format invented by jimmac. See the example above for details.

2 thoughts on “Improved one canvas workflow”

  1. Thanks for the suggestions. I fear the layer dock is not prominent enough and you have a disconnect between what’s on the canvas and what’s on the list, thus I am likely to screw up mispelling something.

    I ended up using your idea except putting the context/name editing directly on the canvas. It’s up my face, maybe the chance to screw up is smaller.

Leave a Reply

Your email address will not be published. Required fields are marked *

Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Poland
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Poland.