*BSD News Article 26959


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!paladin.american.edu!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lille1.fr!ciril.fr!frmop11.cnusc.fr!lirmm!lirmm.lirmm.fr!charnier
From: charnier@lirmm.fr (Philippe Charnier)
Newsgroups: comp.os.386bsd.apps
Subject: Re: TeX -- Makefont
Date: 02 Feb 1994 13:42:46 GMT
Organization: LIRM - Montpellier France
Lines: 218
Message-ID: <CHARNIER.94Feb2144248@hpdif1.lirmm.fr>
References: <2ijj1u$4oe@nwfocus.wa.com>
Reply-To: charnier@lirmm.fr
NNTP-Posting-Host: hpdif1.lirmm.fr
In-reply-to: daniel@halcyon.com's message of 31 Jan 1994 10:35:42 -0800

In article <2ijj1u$4oe@nwfocus.wa.com> daniel@halcyon.com (Daniel Jordan) writes:

     Hello,

      My question has to do with the dvi utilities.  when i run xdvi
or dvipr the process of making fonts never succeeds because the fonts
used are never found.

      I haven't been able to find where the fonts should be: neither
the TeXbook nor the MetafontBook describe file locations (atleast not
that i saw).

    You can put them as follow :

     /usr/local/lib/TeX/fonts/tfm/*.tfm
         ................... /pk/*.pk

     use then setenv to define paths


     setenv PKFONTS /usr/local/lib/TeX/fonts/pk
     setenv VFFONTS   ..................... /vf
     setenv TEXFONTS  ..................... /tfm
     setenv GFFONTS .

     ..../fonts/pk MUST be readable/writable to run MakeTeXPK if you are
     not super user.

     edit /usr/local/bin/MakeTeXPK to correct it if necessary
     or use mine.

     don't forget :


      foo.mf --- mf ----> foo.size.gf --- gftopk ---> foo.size.pk
        |         |                                      ^
        |         -------> foo.tfm                       |
        |                                                |
        ------------------- MakeTeXPK -------------------|


------MakeTeXPK --------cut here -----------------
#!/bin/sh
#
#  Do not run this script, or dvips, as setuid programs!  This will
#  result in a major security hole!
#
#   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.
#
#   Of course, it needs to be set up for your site.
#
TEXDIR=/usr/local/lib/TeX
LOCALDIR=/usr/local/lib/TeX/fonts
DESTDIR=$LOCALDIR/pk
#
# 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
MODE=$5
#
#   Prevent display under the X Window System.  Except it doesn't always
#   work; some sh'ells don't seem to understand unset.  There are also some
#   versions of METAFONT that don't work if the DISPLAY isn't set and
#   the term type is set to xterm.
#
# unset DISPLAY
umask 0

if test "$MODE" = ""
then
   if test $BDPI = 300
   then
      MODE=imagen
   elif test $BDPI = 200
   then
      MODE=FAX
   elif test $BDPI = 360
   then
      MODE=nextII
   elif test $BDPI = 400
   then
      MODE=nexthi
   elif test $BDPI = 600
   then
      MODE=VarityperSixZeroZero
   elif test $BDPI = 100
   then
      MODE=nextscreen
   elif test $BDPI = 72
   then
      MODE=seventwo
   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
GFNAME=$NAME.$DPI'gf'
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
   chmod 777 $DESTDIR
fi

if test "$6" != ""
then
   DESTDIR=$DESTDIR"$6"
   if test ! -d $DESTDIR
   then
      mkdir $DESTDIR
      chmod 777 $DESTDIR
   fi
fi

# added by gwb, to allow searching in current dir before cd'ing
if test "$MFINPUTS" != ""
then
   MFINPUTS=$MFINPUTS:`pwd`; export MFINPUTS
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 "$6" = ""
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/$6"$PKNAME"
   then
      echo $TEXDIR/fonts/pk/$6"$PKNAME" already exists!
      exit 0
   fi
fi

unset DISPLAY
echo "mf \"\\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME\" </dev/null"
mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null
if test ! -r $GFNAME
then
   echo "Metafont failed for some reason on $GFNAME"
   exit 1
fi

gftopk -v ./$GFNAME ./$PKNAME

# Install the PK file carefully, since others may be doing the same
# as us simultaneously.

mv $PKNAME $DESTDIR/pktmp.$$
cd $DESTDIR
mv pktmp.$$ $PKNAME
chmod a+r $PKNAME

exit 0
----------------------------cut here------------------------


--

-----                                                              -----
Philippe Charnier                                      charnier@lirmm.fr


         LIRMM, 161 rue Ada, 34392 Montpellier cedex 5 -- France
------------------------------------------------------------------------