#!/bin/sh -
# bigfig by Glenn Chappell <ggc@uiuc.edu>
# 26 Apr 1995
#
# Enlarges figlet output 3X (or more).
# Requires "bigfig.flf" (or some other mono-spaced figlet font).
#
# Usage:
# Use just like figlet, e.g., instead of "figlet -cf small", type
# "bigfig -cf small".
#
# Requires figlet 2.1 or later for -t & -w options.
# Uses 80 cols in figlet 2.0.
#
# Note: You can avoid this script completely if you want.  Just type
# figlet -w27 -f myfavoritefont | figlet -f bigfig

FONT="bigfig"
FACTOR=3

# In general, FONT should be the name of a *mono-spaced* figlet font,
# and FACTOR should be the width of its characters.  The usual settings
# are
#
# FONT="bigfig"
# FACTOR=3
#
# but any mono-spaced figlet font can be used.  For example, if you
# have the Kirk/Gras "3x5" font, you can achieve a very different
# effect by changing the above two lines to
#
# FONT="3x5"
# FACTOR=4
#
# Similarly, to use von Laudermann's "lcd" font, change the lines to
#
# FONT="lcd"
# FACTOR=6
#
# Both of these fonts (3x5.flf and lcd.flf) are available by anonymous
# FTP from "ftp.nicoh.com". Look in the directory "pub/figlet/fonts".

# Set up PATH so figlet can be found
DIRSAVE=`pwd`
cd `(dirname "$0") 2>/dev/null`
PATH="$PATH":`pwd`
cd "$DIRSAVE"

# Get figlet version
FIGLETVERSION=`figlet -I1 2>/dev/null`
if [ -z "$FIGLETVERSION" ]; then
  FIGLETVERSION=20000
fi

if [ $FIGLETVERSION -lt 20100 ]; then
  # figlet 2.0
  # WID below is the screen width (figlet 2.0 only).
  WID=80
  SWITCH=""
else
  # figlet 2.1 or later
  WID=`figlet $* -I4`
  SWITCH="-L"
fi

WID2=`expr \( $WID - 1 \) / $FACTOR + 1`
if [ $WID2 = 1 ]; then
  WID=1000
fi
figlet $* -w$WID2 | figlet -w$WID -f"$FONT" $SWITCH
