7

I'm looking for a tool that quickly extracts / converts all icons from a vector-based icon font (OpenType, TrueType, Type-1) to good old PNG files with given

  • dimensions (e.g. 48px x 48px)
  • foreground color (e.g. white)
  • background color (e.g. transparent)

I don't care much about the file name pattern.

Target OS: Windows or Linux CLI

  • 3
    Huh, I also have need for this exact product. (though I don't care what OS). I suspect I'll end up doing it with ImageMagic from the linux commandline – Lyndon White Mar 9 '14 at 8:58
  • Hey, I've got this crazy idea: I remove the OS requirement and you post a short how-to about ImageMagick? – Jens Piegsa Mar 12 '14 at 17:34
  • 1
    I haven't done it yet. But if I do, I will make a post saying how. (I'm not sure how, but I remember it is possible) – Lyndon White Mar 13 '14 at 5:52
  • What do you mean by "all icons"? What kind of icons where? It doesn't seem that you're talking about Windows desktop icons ... – hippietrail Mar 14 '14 at 3:14
  • @hippietrail: I'm asking about icons contained in a font file. – Jens Piegsa Mar 14 '14 at 8:22
3

Yes, as discussed in comments, ImageMagick will do your task quickly and a efficiently. To do what you want in windows you could use this (windows) batch file: (Just change the background colour (bg) - can be almost any color identifier - font path (f), font size (ps), extension/format (ext), size(s)). See the ImageMagick docs for more options you could do/details on valid values.

@ECHO OFF
set f=C:/Windows/Fonts/ITCEDSCR.TTF
set ps=44
set bg=white
set ext=png
set s=48x48
set alpha=A B C D E F G H I J K L M N O P Q R S T U V W Z Y Z
set num=0 1 2 3 4 5 6 7 8 9 
For %%X in (%alpha% %num%) do (
    convert -font %f% -pointsize %ps% -size %s% -background %bg% label:%%X %%X.%ext%)
pause
exit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.