#!/bin/sh # original mktexmf -- make a new MF file, because one wasn't found. # # (If you change or delete the word `original' on the previous line, # installation won't write this script over yours.) # # te@informatik.uni-hannover.de, kb@mail.tug.org, and infovore@xs4all.nl. # Public domain. version='$Id: mktexmf,v 1.10 1998/02/01 15:19:42 olaf Exp $' progname=`echo $0 | sed 's@.*/@@'` usage="Usage: $progname FONT. Makes the Metafont source file for FONT, if possible. For example, \`ecr12' or \`cmr11'." # Common code for all scripts. mktex_opt=`kpsewhich --format='web2c files' mktex.opt` if test -z "$mktex_opt"; then echo "$progname: Cannot find mktex.opt; check your installation." >&2 exit 1 fi . "$mktex_opt" ( # See comments in mktexpk. name="`echo $1 | sed 's%.*/%%; s%\.mf$%%'`" case "$name" in *[0-9]w[0-9][0-9][0-9][0-9]) namestem=`echo "$name" | sed 's/w[0-9]*$//'` extension=`echo "$name" | sed 's/^.*[0-9]w//'`;; *) namestem="$name" extension=1000;; esac rootname=`echo "$namestem" | sed 's/[0-9]*$//'` pointsize=`echo "$namestem" | sed "s/^$rootname//"` sauterroot=`kpsewhich b-$rootname.mf 2>/dev/null` if test -n "$sauterroot"; then rootfile=$sauterroot else case $rootname in wn*) lhname=`echo $name | sed 's/^wn/lh/'` rootfile=`kpsewhich $lhname.mf 2>/dev/null`;; *) rootfile=`kpsewhich $rootname.mf 2>/dev/null`;; esac fi { test -z "$rootfile" || test ! -f "$rootfile"; } && exit 1 OIFS=$IFS; IFS=$SEP set x `"$mktexnam" $namestem`; shift IFS=$OIFS destdir=`echo "$3" | sed 's%/[^/][^/]*$%%'` test -d "$destdir" || "$mktexdir" "$destdir" || exit 1 cd "$destdir" >/dev/null 2>&1 || exit 1 case "$pointsize" in "") echo "$progname: no pointsize."; exit 1;; 11) realsize=10.95444;; # \magstephalf 14) realsize=14.4;; # \magstep2 17) realsize=17.28;; # \magstep3 20) realsize=20.74;; # \magstep4 25) realsize=24.88;; # \magstep5 # The new convention is to have three or four letters for the # font name and four digits for the pointsize. The number is # pointsize * 100. We effectively divide by 100 by ignoring the # last two digits. ????|?????) realsize=`echo "$pointsize" | sed 's/\(..\)$/.\1/'`;; *) realsize="$pointsize";; esac mfname="$name.mf" if test -r "$mfname"; then echo "$progname: $destdir/$mfname already exists." echo "$destdir/$mfname" >$STDOUT "$mktexupd" "$destdir" "$mfname" exit 0 fi case "$name" in ec*) cat > "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" < "mf$$.tmp" <$STDOUT echo "$progname: $destdir/$mfname: successfully generated." >&2 "$mktexupd" "$destdir" "$mfname" exit 0 ) 1>&2