#!/bin/sh font="Times Roman" grfont=TR size=48 tracking=0 wspacing=0 kerning=1 kflag= color="0 0 0" bg="1 1 1" text="Hello World" cls() { echo -n  } cleanup() { rm -rf $tmpfile exit } trap cleanup 2 3 15 if [ -f ~/.gftestrc ]; then oifs="$IFS"; IFS=":" read font grfont size tracking wspacing color bg text <~/.gftestrc IFS="$oifs" fi tmpfile=$(mktemp ~/.gftest.XXXXXX) || exit 1 while :; do cls cat <$tmpfile psview $tmpfile & ;; i) grtext -f$grfont -s$size -c"$color" -b"$bg" -t$tracking \ -w$wspacing $kflag -m -l "$text" | \ ps2ppm -r600 -_ | pnmcrop -white 2>/dev/null | \ pnmscale .141666 | pnmmargin -white 5 | pnmtopng >"$font.png" ;; w) echo "$font:$grfont:$size:$tracking:$wspacing:$color:$bg:$text" \ >~/.gftestrc;; q) cleanup;; esac done .