#!/bin/sh
# Make a font sample of the given GF file.  Remove any PK file with the
# same root, to avoid confusion.

if test $# -ne 1
then
  echo "Usage: $0 <GF file>[gf]."
  exit 1
fi


gf_name=`echo $1 | sed 's/gf$//'`gf

if test ! -r $gf_name
then
  echo $gf_name: No such file.
  exit 1
fi

pk_name=`echo $gf_name | sed 's/gf$/pk/'`
if test -r $pk_name
then mv -v $pk_name /tmp
fi

root=`echo $gf_name | sed 's/\.[0-9]*gf$//'`
tfm_name=$root.tfm

if test -r $tfm_name
then mv -v $tfm_name /tmp
fi
fontconvert -tfm $gf_name

echo $root | tex table

resolution=`echo $gf_name | sed 's/.*\.\([0-9]*\)gf$/\1/'`
shrink=`expr $resolution / 100`
xdvi -p $resolution -s $shrink table
