#!/bin/sh
#/*c
# *	JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II
# *
# *			    COPYRIGHT NOTICE
# *
# *	Copyright (c) 1988,1989 PC Research, Inc.  All Rights Reserved.
# *
# *	Unpublished - rights reserved under the Copyright laws of
# *	the United States.
# *
# *			LICENSED SOFTWARE NOTICE
# *
# *	This source code is supplied to you under the terms of the
# *	contents of the "License" agreement found with this source
# *	distribution.  You must read the "License" before you use
# *	this source code in any way.
# *
# *			RESTRICTED RIGHTS LEGEND
# *
# *	Use, duplication, or disclosure by the Government is subject
# *	to restrictions set forth in sub-paragraph (c)(1)(ii) of the
# *	Rights in Technical Data and Computer Software clause of
# *	DFARS 52.227-7013.
# *
# *	PC Research, Inc. 94 Apple Orchard Dr., Tinton Falls, NJ 07724
# *
#c*/

#
#	Create *.out files from "fontlist" and fonts which
#	are located in the "pk" directory.
#
#	fontcfg [makeDESC options]
#
#	WARNING: some troff's choke if there are more than 256 special
#	characters (total) found in the union of the fonts
#

#
# $Id: fontcfg.sh,v 1.9 89/07/08 21:23:45 rick Exp $
#
# $Log:	fontcfg.sh,v $
# Revision 1.9  89/07/08  21:23:45  rick
# More tuning for combo chars
# 
# Revision 1.8  89/07/08  18:13:32  rick
# Changes for combo character support
# 
# Revision 1.7  89/05/08  22:05:32  rick
# Awk stopped working in 3.2, changed to get around bug
# 
# Revision 1.6  89/03/11  23:41:34  rick
# Added Restrictive Rights Legend
# 
# Revision 1.5  89/02/01  08:22:43  rick
# Added bin/sh comment for BSD
# 
# Revision 1.4  89/01/02  18:07:39  rick
# Run mkfont in compat mode
# 
# Revision 1.3  88/11/19  09:12:19  rick
# Botched last fix
# 
# Revision 1.2  88/11/19  00:38:11  rick
# Add remove of old .out files
# 
# Revision 1.1  88/08/27  00:00:02  rick
# Initial revision
# 
#

DESCFLAGS="-c -p"	# AT&T Compat, padding
EXTRAFLAGS="-c"		# AT&T Compat, no padding

fontlist=fontlist
if [ -f ../mkfont/mkfont ]
then
	MAKEDEV="../mkfont/mkfont"
elif [ -f mkfont ]
then
	MAKEDEV="./mkfont"
elif [ -f makedev ]
then
	MAKEDEV="../makedev"
	DESCFLAGS=
	EXTRAFLAGS=
else
	echo "Couldn't find mkfont"
	exit 1
fi
#
allfonts=`awk '/^[A-Za-z].*/ {printf "%s ",$1;}' $fontlist`
stdfonts=`awk '/^-/{ exit;}
/^[A-Za-z].*/ {printf "%s ",$1;}' $fontlist`
addfonts=`awk '/^-/{ f=1;}
/^[A-Za-z].*/ {if (f) printf "%s ",$1;}' $fontlist`
for i in DESC $allfonts
do
	if [ -f "$i.out" ]
	then
		rm $i.out
	fi
done
./makeDESC $*
echo "Making standard fonts:  \c"
echo "$stdfonts"
echo "	$MAKEDEV DESC"
$MAKEDEV $DESCFLAGS DESC
#
echo
echo "Making additional fonts:  \c"
echo "$addfonts"
if [ "Q$addfonts" != Q ]
then
	for i in $addfonts
	do
		echo "	$MAKEDEV DESC $i"
		$MAKEDEV $EXTRAFLAGS DESC $i
	done
fi
echo
echo "*.{out,SZ} files have been built for $allfonts."
