#! /bin/sh

#  Make the required pfa files from the original
#  TeX fonts using mftrace
#  
#  Usage:  ./makePFA

echo "cmr10"
lib/mftrace-modified --magnification 1000 --simplify cmr10

echo "cmmi10"
lib/mftrace-modified --magnification 1000 --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/aae443f0.enc --simplify cmmi10

echo "cmsy10"
lib/mftrace-modified --magnification 1000 --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/10037936.enc --simplify cmsy10

echo "cmex10"
lib/mftrace-modified --magnification 1000 --keep cmex10
fontforge -lang=ff -c 'Open("mftrace.dir/cmex10.pfa.raw");SelectAll();AddExtrema();Simplify();AutoHint();Generate("cmex10.pfa");'
rm -rf mftrace.dir
rm cmex10.afm

echo "cmbx10"
lib/mftrace-modified --magnification 1000 --simplify cmbx10

echo "cmti10"
lib/mftrace-modified --magnification 1000 --simplify cmti10

echo "msam10"
lib/mftrace-modified --magnification 1000 --simplify --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/10037936.enc msam10

echo "msbm10"
lib/mftrace-modified --magnification 450 --simplify --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/10037936.enc msbm10

echo "cmmib10"
lib/mftrace-modified --magnification 1000 --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/aae443f0.enc --simplify cmmib10

echo "cmbsy10"
lib/mftrace-modified --magnification 1000 --encoding /opt/local/share/texmf-dist/fonts/enc/dvips/tetex/10037936.enc --simplify cmbsy10

echo "cmtt10"
lib/mftrace-modified --magnification 1000 --simplify cmtt10

echo "cmss10"
lib/mftrace-modified --magnification 1000 --simplify cmss10
echo "cmssi10"
lib/mftrace-modified --magnification 1000 --simplify cmssi10
echo "cmssbx10"
lib/mftrace-modified --magnification 1000 --simplify cmssbx10

echo "eufm10"
lib/mftrace-modified --magnification 1000 --simplify eufm10
echo "eufb10"
lib/mftrace-modified --magnification 1000 --simplify eufb10

#echo "eusm10"
#lib/mftrace-modified --magnification 1000 --simplify eusm10
#echo "eusb10"
#lib/mftrace-modified --magnification 1000 --simplify eusb10

echo "rsfs10"
lib/mftrace-modified --magnification 1000 --simplify --encoding /usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/tex256.enc rsfs10

mv *.pfa pfa