Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to just render some text with the given font? Expecting something like:

echo "The slow cyan snail creeps under the eager cat" | render_text --font ./qqq.ttf --scale=18 -o text.png

I expect this to be somewhere in ImageMagick/GraphicsMagick suite.

Example use case: render the same text with multitude of fonts (and don't want to install all fonts into the system).

share|improve this question
up vote 5 down vote accepted

You can use the convert command. If the font name has more than 1 word, separate them with a "-". Here are some examples using the Kid Kosmic font. Replace "YOURTEXT" with any phrase.

convert -pointsize 15 -font Kid-Kosmic label:"YOURTEXT" output.png

enter image description here

The caption: option enables text wrapping; but you need to specify the image size.

convert -pointsize 15 -font Kid-Kosmic -size 140x100 caption:"YOURTEXT" output.png

enter image description here

Another one with centered text:

convert -pointsize 15 -font Kid-Kosmic -size 140x100 -gravity center caption:"YOURTEXT" output.png

enter image description here

share|improve this answer
PANGRAM FAIL! – RedGrittyBrick Aug 11 '11 at 16:45
convert: unable to read font 'Kid-Kosmic' @ warning/annotate.c/RenderType/807... How to point it to the font file (without permanently installing it)? – Vi. Aug 12 '11 at 10:58
Replacing "Kid-Kosmic" with the absolute path to a True Type font works for me on Ubuntu 11.04. What OS are you using? – flashnode Aug 12 '11 at 19:13
@flashnode It works for me too, I'm on Win7 Ultimate. Though I had to make sure the path is enclosed in double quotes. – Kaze Aug 12 '11 at 19:23
For Mac OS, use the full font path as well.. Fonts location: – Rafael Oliveira Nov 28 '14 at 19:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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