2 # original mktexmf -- make a new MF file, because one wasn't found.
4 # (If you change or delete the word `original' on the previous line,
5 # installation won't write this script over yours.)
7 # te@dbs.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl.
10 version='$Id: mktexmf,v 1.27 2005/01/25 17:39:21 olaf Exp $'
11 progname=`echo $0 | sed 's%.*/%%'`
12 usage="Usage: $progname FONT.
14 Makes the Metafont source file for FONT, if possible. For example,
15 \`ecr12' or \`cmr11'."
17 # Common code for all scripts.
18 : ${MT_TEXMFMAIN=`kpsewhich --expand-path='$TEXMFMAIN'`}
19 : ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`}
20 test -n "$MT_MKTEX_OPT" || MT_MKTEX_OPT="$MT_TEXMFMAIN/web2c/mktex.opt"
21 if test ! -f "$MT_MKTEX_OPT"; then
22 echo "$progname: Cannot find mktex.opt; check your installation." >&2
29 # See comments in mktexpk.
30 name="`echo $1 | sed 's%.*/%%; s%\.mf$%%'`"
31 rootname=`echo "$name" | sed 's/[0-9]*$//'`
32 pointsize=`echo "$name" | sed "s/^$rootname//"`
34 sauterroot=`kpsewhich b-$rootname.mf 2>/dev/null`
35 if test -n "$sauterroot"; then
40 # csso12[0-5][0-9] from CJK package; unsupported by mktexmf
43 cs*|lcsss*|icscsc*|icstt*|ilcsss*)
44 rootfile=`kpsewhich cscode.mf`;;
45 wn[bcdfirstuv]*|rx[bcdfiorstuvx][bcfhilmostx]|l[abcdhl][bcdfiorstuvx]*)
46 lhprefix=`echo "$name" | sed 's/^\(..\).*/\1/'`
47 rootfile=`kpsewhich ${lhprefix}codes.mf 2>/dev/null`;;
49 rootfile=`kpsewhich $rootname.mf 2>/dev/null`;;
52 { test -z "$rootfile" || test ! -f "$rootfile"; } && exit 1
54 #if test -z "$MT_MFNAME"; then
56 set x `"$MT_MKTEXNAM" $name`; shift
61 destdir=`echo "$MT_MFNAME" | sed 's%/[^/][^/]*$%%'`
62 test -d "$destdir" || "$MT_MKTEXDIR" "$destdir" || exit 1
63 cd "$destdir" || exit 1
66 "") echo "$progname: no pointsize."; exit 1;;
67 11) realsize=10.95;; # \magstephalf
68 14) realsize=14.4;; # \magstep2
69 17) realsize=17.28;; # \magstep3
70 20) realsize=20.74;; # \magstep4
71 25) realsize=24.88;; # \magstep5
72 30) realsize=29.86;; # \magstep6
73 36) realsize=35.83;; # \magstep7
74 # The new convention is to have three or four letters for the
75 # font name and four digits for the pointsize. The number is
76 # pointsize * 100. We effectively divide by 100 by ignoring the
78 ????|?????) realsize=`echo "$pointsize" | sed 's/\(..\)$/.\1/'`;;
79 *) realsize="$pointsize";;
83 if test -r "$mfname"; then
84 echo "$progname: $destdir/$mfname already exists."
85 echo "$destdir/$mfname" >$STDOUT
86 "$MT_MKTEXUPD" "$destdir" "$mfname"
92 cat > "mf$$.tmp" <<END
93 if unknown exbase: input exbase fi;
99 cat > "mf$$.tmp" <<END
100 if unknown dxbase: input dxbase fi;
105 cs*|lcsss*|icscsc*|icstt*|ilcsss*)
106 cat > "mf$$.tmp" <<END
111 wn[bcdfirstuv]*|rx[bcdfiorstuvx][bcfhilmostx]*|l[abcdhl][bcdfiorstuvx]*)
112 cat > "mf$$.tmp" <<END
116 g[lmorst][bijmtwx][cilnoru]*)
117 # A small superset of the names of the cbgreek fonts.
118 cat > "mf$$.tmp" <<END
119 % generated by mktexmf
124 cat > "mf$$.tmp" <<END
125 design_size := $realsize;
131 chmod `kpsestat -xst,go-w .` "mf$$.tmp"
133 mv "mf$$.tmp" "$mfname"
135 echo "$destdir/$mfname" >$STDOUT
136 echo "$progname: $destdir/$mfname: successfully generated." >&2
137 "$MT_MKTEXUPD" "$destdir" "$mfname"