#! /bin/sh
# 
#  fixfontlist
#
#  Copyright (c) 1993 Frame Technology Corp. All rights reserved.
#  $Id: fixfontlist,v 1.1 1993/02/28 20:38:20 adl Exp $

myname=`expr //$0 : '.*/\(.*\)'`
usage="Usage: $myname fontdir"

if [ $# -ne 1 ]; then
	echo "$usage"
	exit 1
fi

fontdir=$1
[ -d "$fontdir" ] || {
	echo "$usage"
	echo "Error: $fontdir is not a directory."
	exit 1
}

fontlist=$fontdir/fontlist
[ -f $fontlist -a -r $fontlist ] || {
	echo "$usage"
	echo "Error: fontlist file is missing or unreadable in $fontdir"
	exit 1
}

echo "Shortening Frame font file names in "
echo "    ${fontlist}..."
sed -f fl1.sed $fontlist | sed -f fl2.sed | sed -f fl3.sed > $fontlist.new

./addafmpsn $fontdir $fontlist

exit 0
