#! /bin/sh
#
#  addframepsn
#
#  Add PSName statements to fontlist file for Frame fonts.
#  Copyright (c) 1993 Frame Technology Corp. All rights reserved.
#  $Id: addframepsn,v 1.1 1993/02/28 20:38:18 adl Exp $

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

if [ $# -eq 1 ]; then
	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
	}
	cp $fontlist $fontlist.new
elif [ $# -eq 2 ]; then
	fontdir=$1
	fontlist=$2
else
	echo "$usage"
	exit 1
fi

echo "Adding PSName statements for Frame fonts..."
egrep 'Folio' $fontlist | sed -f fl4.sed >> $fontlist.new

[ $# -eq 1 ] && echo "Done. Updated fontlist is in $fontlist.new"
exit 0
