home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PRINTING / DVIPS54.ZIP / DVIPS / MAKETEXP < prev    next >
Text File  |  1990-11-25  |  3KB  |  103 lines

  1. #!/bin/sh
  2. #
  3. #   This script file makes a new TeX PK font, because one wasn't
  4. #   found.  Parameters are:
  5. #
  6. #   name dpi bdpi magnification [mode]
  7. #
  8. #   `name' is the name of the font, such as `cmr10'.  `dpi' is
  9. #   the resolution the font is needed at.  `bdpi' is the base
  10. #   resolution, useful for figuring out the mode to make the font
  11. #   in.  `magnification' is a string to pass to MF as the
  12. #   magnification.  `mode', if supplied, is the mode to use.
  13. #
  14. #   Note that this file must execute Metafont, and then gftopk,
  15. #   and place the result in the correct location for the PostScript
  16. #   driver to find it subsequently.  If this doesn't work, it will
  17. #   be evident because MF will be invoked over and over again.
  18. #
  19. #   Of course, it needs to be set up for your site.
  20. #
  21. # TEMPDIR needs to be unique for each process because of the possibility
  22. # of simultaneous processes running this script.
  23. DESTDIR=/LocalLibrary/Fonts/TeXFonts/pk
  24. TEMPDIR=/tmp/mtpk.$$
  25. NAME=$1
  26. DPI=$2
  27. BDPI=$3
  28. MAG=$4
  29. MODE=$5
  30.  
  31. umask 0
  32.  
  33. if test "$MODE" = ""
  34. then
  35.    if test $BDPI = 300
  36.    then
  37.       MODE=imagen
  38.    elif test $BDPI = 400
  39.    then
  40.       MODE=nexthi
  41.    elif test $BDPI = 100
  42.    then
  43.       MODE=nextscreen
  44.    elif test $BDPI = 635
  45.    then
  46.       MODE=linolo
  47.    elif test $BDPI = 1270
  48.    then
  49.       MODE=linohi
  50.    elif test $BDPI = 2540
  51.    then
  52.       MODE=linosuper
  53.    else
  54.       echo "I don't know the mode for $BDPI"
  55.       echo "Have your system admin update MakeTeXPK"
  56.       exit 1
  57.    fi
  58. fi
  59.  
  60. #  Something like the following is useful at some sites.
  61. # DESTDIR=/usr/local/lib/tex/fonts/pk.$MODE
  62. GFNAME=$NAME.$DPI'gf'
  63. PKNAME=$NAME.$DPI'pk'
  64.  
  65. # Clean up on normal or abnormal exit
  66. trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15
  67.  
  68. mkdir $TEMPDIR
  69. cd $TEMPDIR
  70.  
  71. if test -r $DESTDIR/$PKNAME
  72. then
  73.    echo "$DESTDIR/$PKNAME already exists!"
  74.    exit 0
  75. fi
  76.  
  77. # check also in the standard place
  78.  
  79. if test -r /usr/lib/tex/fonts/pk/$PKNAME
  80. then
  81.    echo /usr/lib/tex/fonts/pk/$PKNAME already exists!
  82.    exit 0
  83. fi
  84.  
  85. echo mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" \\\</dev/null
  86. mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null
  87. if test ! -r $GFNAME
  88. then
  89.    echo "Metafont failed for some reason on $GFNAME"
  90.    exit 1
  91. fi
  92.  
  93. gftopk $GFNAME $PKNAME
  94.  
  95. # Install the PK file carefully, since others may be doing the same
  96. # as us simultaneously.
  97.  
  98. mv $PKNAME $DESTDIR/pktmp.$$
  99. cd $DESTDIR
  100. mv pktmp.$$ $PKNAME
  101.  
  102. exit 0
  103.