#!/bin/sh
#
# Version 1.0
#
# This script transforms Wadalab PFA and AFM files created by the
# wftodm program into PFB and TFM files.  All files in the current
# directory and its subdirectories are converted.
#
# Additionally, it normalizes the font matrix so that the subfonts work
# with pdfTeX; for convenience, it also inserts `closepath' commands to
# end subpaths in glyphs.
#
# Note that an older version of this script (without a version number) has
# some flaws; you should either regenerate all Wadalab subfonts or use the
# `fixwada' script to fix PFB fonts which has already been created with
# this older version.
#
# The programs t1asm, t1disasm, and afm2tfm must be in the path.

for f in `find . -name '*.pfa' -print`; do
  echo processing $f
  name=`basename $f .pfa`
  t1disasm < $name.pfa > $name.old

  cat $name.old | \
  av                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        