home *** CD-ROM | disk | FTP | other *** search
/ Cuteskunk BBS / cuteskunk.zip / cuteskunk / ascii / showfigf.ont < prev    next >
Text File  |  2003-06-29  |  1KB  |  43 lines

  1. #!/bin/sh -
  2. # showfigfonts by Glenn Chappell <ggc@uiuc.edu>
  3. # 17 Feb 1994
  4. # Based on showfigfonts by Greg Galperin <grg@ai.mit.edu>, Nov 1993.
  5. #
  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.
  10. #
  11. # Usage: showfigfonts [ -d directory ] [ word ]
  12.  
  13. # Set up PATH so figlet can be found
  14. PATH=$PATH:`dirname $0`
  15.  
  16. # Get figlet version
  17. FIGLETVERSION=`figlet -I1 2>/dev/null`
  18. if test -z "$FIGLETVERSION" ; then
  19.   FIGLETVERSION=20000
  20. fi
  21.  
  22. if test "$1" = '-d' ; then
  23.   FONTDIR="$2"
  24.   WORD="$3"
  25. else
  26.   WORD="$1"
  27.   if test $FIGLETVERSION -lt 20100 ; then
  28.     # figlet 2.0
  29.     FONTDIR=`figlet -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`
  30.   else
  31.     # figlet 2.1 or later
  32.     FONTDIR=`figlet -I2`
  33.   fi
  34. fi
  35.  
  36. cd $FONTDIR
  37. for F in `ls *.flf | sed s/\.flf$//` ; do
  38.   echo $F :
  39.   echo ${WORD:-$F} | figlet -f $F
  40.   echo "" ; echo ""
  41. done
  42.  
  43.