2 # showfigfonts by Glenn Chappell <ggc@uiuc.edu>
3 # figlet release 2.1.1 -- 25 Aug 1994
4 # Based on showfigfonts by Greg Galperin <grg@ai.mit.edu>, Nov 1993.
6 # Prints a list of available figlet fonts, along with a sample of each
7 # font. If directory is given, lists fonts in that directory; otherwise
8 # uses the default font directory. If word is given, prints that word
9 # in each font; otherwise prints the font name.
11 # Usage: showfigfonts [ -d directory ] [ word ]
17 FIGLETVERSION
=`$FIGLET -I1 2>/dev/null`
18 if [ -z "$FIGLETVERSION" ]; then
22 USAGE
="Usage: `basename $0` [ -d directory ] [ word ]"
24 if [ "$1" = '-d' ]; then
27 if [ $# -gt 3 ] ||
[ $# -lt 2 ]; then
37 if [ "$FIGLETVERSION" -lt 20100 ]; then
39 FONTDIR
="`$FIGLET -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`"
42 FONTDIR
="`$FIGLET -I2`"
46 FONTLIST
=`ls "$FONTDIR"/*.flf | sed 's!.*/\(.*\)\.flf$!\1!'`
47 for F
in $FONTLIST ; do
49 if [ -n "$WORD" ]; then
50 echo "$WORD" |
$FIGLET -d "$FONTDIR" -f "$F"
52 echo "$F" |
$FIGLET -d "$FONTDIR" -f "$F"