#! /bin/sh

if [ ! -w . ]; then
	echo "
You don't have write permission in the FrameMaker installation directory.
Therefore, you can't configure the LaserWriter fonts used by FrameMaker.
Please see your system administrator or the individual who installed the
FrameMaker software.
"
	exit 1
fi
cd fontdir
if [ -f fontlist.lw -a -f fontlist.lwp ]; then
	echo "
Both sets of fonts (LaserWriter and LaserWriter Plus) are installed"
	if [ -f fontlist.dec ]; then
		echo "DEC alternate fontlist is also installed
	"
	else 
		echo "
	"
	fi
# link fontlist to the appropriate file
	echo
	echo "Type the number of the font set you want:"
	echo
	[ -f fontlist.lw ] &&  echo "	1. LaserWriter fonts"
	[ -f fontlist.lwp ] && echo "	2. LaserWriter Plus fonts"
	[ -f fontlist.dec ]    && echo "	3. DEC PS20 or PS40 fonts"
	
	echo "
Use option 1 ONLY IF you have a LaserWriter (or equivalent printer with
only Times, Helvetica, Courier, and Symbol fonts) OR you wish to prohibit
access to the LaserWriter PLUS fonts (Avant Garde, Bookman, New Century
Schoolbook, Palatino, Zapf Chancery, and Zapf Dingbats)."
if [ -f fontlist.dec ]; then 
	echo "Use option 3 if you have a DEC LPS40 or LPS20 laser printer.
"
else
	echo "
"
fi
	echo -n "Type the number of your choice [1]: "
	read answer
	file=fontlist.lw
	[ "$answer" = "2" ] && file=fontlist.lwp
	[ "$answer" = "3" -a -f fontlist.dec ] && file=fontlist.dec
	rm fontlist
	ln -s $file fontlist
	echo "Linked fontlist to $file."
	echo
else
	echo "
Since no fonts are installed, there is no font configuration to be done.
"
fi
