#!/bin/sh
# $Id: mktype0,v 1.2 1997/06/25 05:15:37 d791013 Exp $

Usage () {
  cat << EOU
  Usage: $program [-m font-for-ascii] fontname

    e.g. "$program KaiSu" will create KaiSu.ps and Fontmap.KaiSu. KaiSu.ps
         should be installed where GS can find and Fontmap.KaiSu should be
         appended to the official Fontmap file.
  To use the generated Type 0 font, use the /KaiSu-Regular as the Fontname.
EOU
  exit 2
}

program=`basename $0`
asciifont='Times-Roman'

[ -z "$1" ] && Usage
if [ "$1" = "-m" ]; then
  asciifont="$2"
  shift 2
fi

sed "s/@@TYPE0FONT@@/$1/g" Type0-Regular.ps | \
  sed "s/@@ASCIIFONT@@/$asciifont/g" > $1-Regular.ps
sed "s/@@TYPE0FONT@@/$1/g" Type0.ps > $1.ps
sed "s/@@TYPE0FONT@@/$1/g" t0header.ps > t0header.$1
echo "/$1-Regular ($1-Regular.ps) ;" > Fontmap.$1
echo "/$1 ($1.ps) ;" >> Fontmap.$1

exit 0
