|
楼主 |
发表于 2002-6-27 08:36:58
|
显示全部楼层
我在网上找了一个 SHELL 脚本(ttf2pt1) ,但是不能运行???
好像提示不能发现目录(没认真看,有点忘了)
脚本内容如下:
#!/bin/sh
#
# By Edward G.J. Lee 2001.11.25
# This code is Public Domain.
#
if [ $# -ne 1 ]
then
echo "Usage: `basename $0` your.ttf"
exit 1
fi
echo
echo "Now create *.t1a and *.enc and *.afm files. Wait... "
echo
FONTNAME=$1
MAPFILE=/usr/local/share/ttf2pt1/maps/cugb.map
n=1
while [ $n -lt 10 ]
do
m=0$n
ttf2pt1 -GE -pft -Ohub -W0 -L $MAPFILE+$m $FONTNAME ${FONTNAME%.ttf}$m
n=`expr $n + 1`
done
m=10
while [ $m -lt 56 ]
do
ttf2pt1 -GE -pft -Ohub -W0 -L $MAPFILE+$m $FONTNAME ${FONTNAME%.ttf}$m
m=`expr $m + 1`
done
# avoid dvips(k)(before v5.86) t1part module bug.
#
perl -pi -e 's/_/Z/g' *.t1a *.afm
echo
echo "Now create *.pfb, wait... "
echo
for ps in *.t1a
do
t1asm -b $ps > ${ps%.t1a}.pfb
done
echo
echo "Now create *.tfm, wait... "
echo
for afm in *.afm
do
afm2tfm $afm
done
AFM=${FONTNAME%.ttf}-afm
TFM=${FONTNAME%.ttf}-tfm
PFB=${FONTNAME%.ttf}-pfb
ENC=${FONTNAME%.ttf}-enc
rm -f *.t1a
mkdir -p $AFM $TFM $PFB $ENC
mv -f *.enc $ENC
mv -f *.afm $AFM
mv -f *.tfm $TFM
mv -f *.pfb $PFB
echo
echo "OK, all done. :-)"
echo |
|