lilypond-1.3.65
[lilypond.git] / buildscripts / mf-to-xpms.sh
blob3e3d84dcd0a4d8af35e1b7b897e7ab70cb5dd635
1 #!@SHELL@
2 # mf-to-xpms.sh
4 if [ $# -ne 1 ]; then
5 echo Usage: mf-to-xpms feta20
6 exit 2
7 fi
9 font=`basename $1 .mf`
10 mf=$font.mf
11 afm=out/$font.afm
12 PKTOPBM=pktopbm
13 MODE=ibmvga
14 RESOLUTION=110
15 named=yes
17 if [ ! -e out/$font.${RESOLUTION}pk ]; then
18 mf "\\mode=${MODE}; \\input $mf"
19 mv $font.${RESOLUTION}gf out
20 rm -f $font.log $font.tfm
21 gftopk out/$font.${RESOLUTION}gf out/$font.${RESOLUTION}pk
24 # num=`grep "^C *[0-9]*;" $afm | tail -1 | sed "s!^C *\([^;]*\).*!\\1!"`
25 # num=66
26 # tex=out/$font.tex
27 # cat > $tex <<EOF
28 # \font\fetatwenty=feta20
29 # \fetatwenty
30 # \nopagenumbers
31 # \newcount\c\c64
32 # \char\c
33 # \loop\ifnum\c<$num\advance\c by1
34 # \vfill\eject
35 # \char\c
36 # \repeat
37 # \vfill\eject
38 # \end
39 # EOF
41 # for i in $NUMS; do
42 # $PKTOPBM out/$font.${RESOLUTION}pk -c $i out/$font-$i.pbm
43 # done
45 # numbered files
46 if [ "x$named" = "x" ]; then
47 NUMS=`grep "^C *[0-9]* *;" $afm | sed "s!^C *\([^ ;]*\).*!\\1!"`
48 PBMS=`grep "^C *[0-9]* *;" $afm | sed "s!^C *\([^ ;]*\).*!out/$font-\\1.pbm!"`
49 else
50 NUMS=`grep "^C *[0-9]* *;" $afm | sed "s!^C *.*; *N *\([^ ;]*\).*!\\1!"`
51 PBMS=`grep "^C *[0-9]* *;" $afm | sed "s!^C *.*; *N *\([^ ;]*\).*!out/$font-\\1.pbm!"`
54 # $PKTOPBM out/$font.${RESOLUTION}pk -x 100 -y 100 $PBMS
55 $PKTOPBM out/$font.${RESOLUTION}pk $PBMS
57 for i in $NUMS; do
58 ppmtoxpm out/$font-$i.pbm > out/$font-$i.xpm
59 done
60 rm -f $PBMS