home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / text / dvipsami.lha / tex / MakeTeXPK < prev   
Encoding:
Text File  |  1992-06-13  |  2.4 KB  |  110 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. DESTDIR=/usr/local/tex/fonts/pk
  25. TEMPDIR=/tmp/mtpk.$$
  26. NAME=$1
  27. DPI=$2
  28. BDPI=$3
  29. MAG=$4
  30. MODE=$5
  31.  
  32. umask 0
  33.  
  34. if test "$MODE" = ""
  35. then
  36.    if test $BDPI = 300
  37.    then
  38.       MODE=CanonCX
  39.    elif test $BDPI = 400
  40.    then
  41.       MODE=nexthi
  42.    elif test $BDPI = 100
  43.    then
  44.       MODE=nextscreen
  45.    elif test $BDPI = 635
  46.    then
  47.       MODE=linolo
  48.    elif test $BDPI = 1270
  49.    then
  50.       MODE=linohi
  51.    elif test $BDPI = 2540
  52.    then
  53.       MODE=linosuper
  54.    else
  55.       echo "I don't know the mode for $BDPI"
  56.       echo "Have your system admin update MakeTeXPK"
  57.       exit 1
  58.    fi
  59. fi
  60.  
  61. #  Something like the following is useful at some sites.
  62. # DESTDIR=/usr/local/lib/tex/fonts/pk.$MODE
  63. GFNAME=$NAME.$DPI'gf'
  64. PKNAME=$NAME.$DPI'pk'
  65.  
  66. # Clean up on normal or abnormal exit
  67. trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15
  68.  
  69.  
  70. if test ! -d $DESTDIR
  71. then
  72.    mkdir $DESTDIR
  73. fi
  74.  
  75. mkdir $TEMPDIR
  76. cd $TEMPDIR
  77.  
  78. if test -r $DESTDIR/$PKNAME
  79. then
  80.    echo "$DESTDIR/$PKNAME already exists!"
  81.    exit 0
  82. fi
  83.  
  84. # check also in the standard place
  85.  
  86. if test -r /usr/local/tex/fonts/pk/$PKNAME
  87. then
  88.    echo /usr/local/tex/fonts/pk/$PKNAME already exists!
  89.    exit 0
  90. fi
  91.  
  92. echo mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" \\\</dev/null
  93. mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null
  94. if test ! -r $GFNAME
  95. then
  96.    echo "Metafont failed for some reason on $GFNAME"
  97.    exit 1
  98. fi
  99.  
  100. gftopk $GFNAME $PKNAME
  101.  
  102. # Install the PK file carefully, since others may be doing the same
  103. # as us simultaneously.
  104.  
  105. mv $PKNAME $DESTDIR/pktmp.$$
  106. cd $DESTDIR
  107. mv pktmp.$$ $PKNAME
  108.  
  109. exit 0
  110.