#!/bin/sh # This assumes you have Python, the ImageMagick binaries in your path, # and the chosen fonts in their respective locations. This also takes # a blank image final.jpg and writes the characters to it. FONTWIDTH=8 FONTPATH="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf" # Print only printable ASCII chars for ((i = 32; i < 127; i++)) do # for some reason ImageMagick has problems printing '%' s=`python -c "print chr($i)" | sed "s/%/?/"` # catch non-printable characters if [ `echo -n "$s" | wc -c` != 1 ] then s=" " fi echo "Writing char $i -- \"$s\"..." convert -font ${FONTPATH} -pointsize ${FONTWIDTH} -annotate +`expr $i \* ${FONTWIDTH}`+6 "$s" final.png tmp.png # qiv tmp.png mv tmp.png final.png done