#!/bin/bash
export FONTID='rjth'
export TTFBASE='tahoma'
function createtfm {
BASE=`basename $1 .ttf`
# create TeX Font Metrics (tfm)
ttf2tfm ${BASE}.ttf -q -T T1-WGL4.enc $2 ${BASE}.vpl ${BASE}.tfm
# the tfm files with disabled ligatures have been obtained by
# manually editing the vpl files at this moment

# create virtual fonts (vf)
vptovf ${BASE}.vpl ${BASE}.vf ${BASE}.tfm
# generate the Adobe Font Metrics (afm)
ttf2afm -e T1-WGL4.enc -o ${BASE}.afm ${BASE}.ttf
# store the tfm file under a new name
mv ${BASE}.tfm $3.tfm
mv ${BASE}.vf $3.vf
mv ${BASE}.afm $3.afm
}
# generate medium normal font metrics (m)(n)
createtfm ${TTFBASE}.ttf '-v' ${FONTID}mn8t
# generate bold normal font metrics (b)(n)
# createtfm ${TTFBASE}bd.ttf '-v' ${FONTID}bn8t