5 echo "Usage: tfmtoafm FONT"
7 echo "example: tfmtoafm cmr10"
12 size=`echo $font | sed "s/[^0-9]*//"`
14 fontfile=`kpsewhich $1.tfm`
17 rm -f $t1 $t2 $font $afm
19 for i in `seq 1 127`; do printf "%d Character-%d\n" $i $i >> $t1; done
20 tfmtodit $fontfile $t1 $font
22 scaling=`nawk -v OFMT='%.5f' '/designsize/ {print $2/'$size/1000} $font`
23 tail -127 $font | cut -f 1-2 > $t1
24 cat $t1 | cut -d, -f 1-2 > $t2
26 nl -ba $t2 | nawk -F '[ \t,]+' '{print "C "$2";\t"$3";\tB 0.00 0.00 "$4/'"$scaling"'" "$5/'"$scaling"'";"}' > $t1
33 # urg 0 is difficult but we need it
34 head -1 $t1 | sed "s/1;/0;/g" >> $afm