Search code examples
linuxbitmaprenderingcommand-line-interfacetruetype

Convert TrueType glyphs to PNG image?


Is there a command line tool to convert glyphs from a TTF file, to PNG (or some other bitmap image format)?

If there is no ready command line tool for that, how would you go about doing it from one of C++, Perl, Python or Ruby or something easily found on an Ubuntu box?


Solution

  • probably partly duplicate of How can I convert TTF glyphs to .png files on the Mac for free?

    imagemagick can fulfill this kind of requests, should works fine on Mac/Linux/Windows. :-)

    convert -background none -fill black -font font.ttf -pointsize 300 label:"Z" z.png
    

    if a batch convert is needed, maybe you can consider use a little ruby script called ttf2png .