How to automate letters icon creation

Post questions on how to use or achieve an effect in Inkscape.
umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

How to automate letters icon creation

Postby umen » Fri Sep 05, 2014 6:32 am

I must say im not designer im programmer im building simple game for my kids in this game i need to create many sets of english letters icons like this ones im attaching.
now im doing it using Inkscape . and its very hard work to create 26 letters each time .
is there any tool or way to design the first letter icon and then just create all the rest of the letters by this design ?
maybe using some other free tools ...
l_100_0.png
l_100_0.png (4.79 KiB) Viewed 3581 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to automate letters icon creation

Postby Lazur » Fri Sep 05, 2014 7:22 am

It depends on your needs.

If you want the final icons as rasters, you can like type in the whole alphabet in a text object, and use that to draw all the icons at once.
Preferably use a monospaced font for that.
Then, you can make tiled clones for the rectangles at the background, and export each of them to a png after the letters are right above.


Other possible solution, which is more coding based, is to use svg with css.

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Fri Sep 05, 2014 3:10 pm

good idea , you mean first type the ABC with spaces and then just copy the background for each font
and export it to png , right ?
what is good monospaced font ? can you give me example ?
the css and svg idea it to complex /

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: How to automate letters icon creation

Postby Xav » Fri Sep 05, 2014 7:47 pm

Elaborating on Lazur's suggestion, I would do the following (again, assuming you need PNGs for the final files):

1) Create the background.
2) Use Edit > Clone > Create Tiled Clones... to create 26 of them. (Use the reset button in the dialog, enter 1 row and 26 columns, then hit Create)
3) Select the last clone and move it to the right (use the arrow keys, or hold CTRL to constrain the mouse movement)
4) Select the first clone and delete it, leaving you with 1 original and 25 clones.
5) Select all of the objects and use the "Distribute" section of the Align and Distrubute dialog to space the centers evenly.
6) Select the Text tool and type in the whole alphabet, with no spaces. Set the font and size to something suitable - bearing in mind that if you use a proportional font that "m" and "w" are wider than "i" and "j".
7) Position the string so that the first letter is in the right place in the first background box.
8) With the text object selected, use the Extensions > Text > Split Text... command to split it into separate objects for each letter.
9) Move the last letter to the right until it's in the right place in the last box.
10) Select all the letters and use the "Distribute" section of the Align and Distrubute dialog to space the centers evenly.

If you want drop shadows, per your original image, there are a few ways to do it, but the quick-and-dirty approach is just to duplicate all the text, unlink the clones, set the colour and put it in place. If you're going to do that, I would probably do the shadows first, then the text on top, so you don't have to deal with sending the shadows behind the text objects.

Finally, to export to PNG, group each box with its letter and shadow (select all three then press CTRL-G). You'll need to do this 26 times, as I'm not aware of a shortcut that would help. Now select all 26 groups and in the File > Export Bitmap dialog, choose the Batch Export option near the bottom to create all 26 images at once.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Fri Sep 05, 2014 10:03 pm

Hey @Xav
You are genius! its worked very well , and i got the Principle!
one thing i missing , is there any way to control the output files name ,
now the output names are :
g4962.png for A
g4968.png for B
g4974.png for C
..
..
i dont see any logical order here , what i need is to be able to export and get file nams in some numbered logic
for example :
g1.png for A
g2.png for B
g3.png for C
...
...
and so on , is there any way to do it ?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to automate letters icon creation

Postby Lazur » Fri Sep 05, 2014 10:14 pm

These fonts would be a right choice even with licensing:
http://openfontlibrary.org/en/search?category=monospaced

Good luck!

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Sat Sep 06, 2014 12:00 am

Thanks for the fonts link!

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: How to automate letters icon creation

Postby tylerdurden » Sat Sep 06, 2014 12:23 am

umen wrote:i dont see any logical order here , what i need is to be able to export and get file nams in some numbered logic ...and so on , is there any way to do it ?


The excellent and free Irfanview can batch rename/copy/modify and much more.

http://www.irfanview.com/
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Sat Sep 06, 2014 1:34 am

what is the logic or the sorting in the inkscape batch export if there is any ?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to automate letters icon creation

Postby Lazur » Sat Sep 06, 2014 5:41 am

Haven't experienced with it so I'm just guessing it uses the z order of objects.
Objects appear in the codes in the z order, the first objects are rendered on top.
Thus it seems an obvious solution to me but I could be wrong.

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Sat Sep 06, 2014 6:09 am

The http://www.irfanview.com/ sulotion working great !

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: How to automate letters icon creation

Postby Xav » Mon Sep 08, 2014 9:06 pm

umen wrote:is there any way to control the output files name ,
now the output names are :
g4962.png for A
g4968.png for B
g4974.png for C


Possibly too late to help you now, but for future reference...

The file names are coming from the group IDs in the SVG file. You can change them in the XML (with a text editor, or using the XML editor in Inkscape), but a more straightforward approach is to just right-click on each group, select "Object Properties", change the ID and then click the "Set" button. Close the dialog and repeat 25 times ;)
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

umen
Posts: 14
Joined: Mon Oct 07, 2013 9:22 pm

Re: How to automate letters icon creation

Postby umen » Mon Sep 08, 2014 10:02 pm

Thanks !
You are genius x2


Return to “Help with using Inkscape”