#!/bin/sh # # This script file makes a new TeX PK font, because one wasn't # found. Parameters are: # # name dpi bdpi magnification [[mode] subdir] # # `name' is the name of the font, such as `cmr10'. `dpi' is # the resolution the font is needed at. `bdpi' is the base # resolution, useful for figuring out the mode to make the font # in. `magnification' is a string to pass to MF as the # magnification. `mode', if supplied, is the mode to use. # # Note that this file must execute MetaFont, and then gftopk, # and place the result in the correct location for the PostScript # driver to find it subsequently. If this doesn't work, it will # be evident because MF will be invoked over and over again. # # If no METAFONT source is available for `name' MakeTeXPK tries to # find a type1 font and if such a font is found ps2pk will be used # to render it. # If the fontname is available in $TEXCONFIG/psfonts.map it will use # the real PostScript name found for `name' otherwise it will use # `name' straight away. # # Font sources can be put into a single directory or in different # subdirectories from $MFFACES and $T1FACES. # # Of course, it needs to be set up for your site. # # Base directories where we have installed TeX and its programs TEXDIR=/usr/local/lib/tex TEXBINDIR=$TEX/bin # we explicity set the PATH PATH=/bin:/usr/bin:$TEXBINDIR:/usr/ucb; export PATH # Provide a usage message to refresh human memories. if test \( $# -lt 4 \) -o \( $# -gt 6 \) then echo "Usage: `basename $0` fontname dpi bdpi magnification [[mode] subdir]" exit 1 fi # Where MakeTeXPK will install its fonts (everybody seems to choose # something different) DESTDIR=$TEXDIR/extra-fonts # Where we look for METAFONT sources MFSUBDIR=typefaces MFFACES=/usr/local/lib/mf/$MFSUBDIR # Where we look for Type1 fonts and AFM files (do you know a better place?) T1SUBDIR=type1faces T1FACES=/usr/local/lib/mf/$T1SUBDIR # Where we look for dvips stuff TEXCONFIG=$TEXDIR/ps # What encoding scheme do we use for Type1 text fonts? # DEF_TEXT_ENCODING="" (default: AdobeStandardEncoding) # DEF_TEXT_ENCODING="-eEC.enc" (Extended Computer Modern!) DEF_TEXT_ENCODING="" # # TEMPDIR needs to be unique for each process because of the possibility # of simultaneous processes running this script. # if test "$TMPDIR" = "" then TEMPDIR=/tmp/mtpk.$$ else TEMPDIR=$TMPDIR/mtpk.$$ fi NAME=$1 DPI=$2 BDPI=$3 MAG=$4 if test $# -ge 5 ;then MODE=$5 ;fi if test $# -ge 6 ;then SUBDIR=$6 ;fi umask 0 if test "$MODE" = "" then if test $BDPI = 300 then MODE=imagen elif test $BDPI = 400 then MODE=nexthi elif test $BDPI = 100 then MODE=nextscreen elif test $BDPI = 635 then MODE=linolo elif test $BDPI = 1270 then MODE=linohi elif test $BDPI = 2540 then MODE=linosuper else echo "I don't know the mode for $BDPI" echo "Have your system admin update MakeTeXPK" exit 1 fi fi # Something like the following is useful at some sites. # DESTDIR=/usr/local/lib/tex/fonts/pk.$MODE PKNAME=$NAME.$DPI'pk' # Clean up on normal or abnormal exit trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15 if test ! -d $DESTDIR then mkdir $DESTDIR fi if test "$SUBDIR" != "" then DESTDIR=$DESTDIR"$SUBDIR" if test ! -d $DESTDIR then mkdir $DESTDIR fi fi mkdir $TEMPDIR cd $TEMPDIR if test -r $DESTDIR/$PKNAME then echo "$DESTDIR/$PKNAME already exists!" exit 0 fi # check also in the standard place if test "$SUBDIR" = "" then if test -r $TEXDIR/fonts/pk/$PKNAME then echo $TEXDIR/fonts/pk/$PKNAME already exists! exit 0 fi else if test -r $TEXDIR/fonts/pk/$SUBDIR"$PKNAME" then echo $TEXDIR/fonts/pk/$SUBDIR"$PKNAME" already exists! exit 0 fi fi # Do we have a METAFONT source for this typeface? for TF in `find $MFFACES -type f -name "*$NAME.mf" -print` do FACE=`expr $TF : "$MFFACES/\(.*\)/$NAME.mf"` break done if test -n "$FACE" then # Found a METAFONT source for $NAME if test "$FACE" = typefaces then MFINPUTS=.:$MFFACES else MFINPUTS=.:$MFFACES/$FACE fi export MFINPUTS echo mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" \\\