home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / Xtex / TeXtoXfont.rem < prev    next >
Text File  |  1991-02-19  |  2KB  |  80 lines

  1. #!/bin/sh
  2. #
  3. # This probably ony works for machines using BDF and the like; I haven't
  4. # converted it to follow the guidelines of XTeXtoXFont.SCRIPT, which gets
  5. # editing by the makefile for a specific site.
  6. #
  7.  
  8. #
  9. #   This script file makes a new X/TeX screen font, because one wasn't
  10. #   found.  It is designed to run on the client machine but produce fonts 
  11. #   for the server machine.  Parameters are:
  12. #
  13. #   name dpi bdpi magnification destdir server user
  14. #
  15. #   `name' is the name of the font, such as `cmr10'.  `dpi' is
  16. #   the resolution the font is needed at.  `bdpi' is the base
  17. #   resolution, useful for figuring out the mode to make the font
  18. #   in.  `magnification' is a string to pass to MF as the
  19. #   magnification.  'destdir' is the directory in which to cache the new
  20. #   font.  'server' is the name of the X server machine.  'user' is the
  21. #   user name to use in accessing the server via rsh.
  22. #
  23. #   Note that this file must execute Metafont, mftobdf, and then bdftosnf,
  24. #   and place the result in the correct location for X
  25. #   to find it subsequently.  
  26. #
  27. #   Of course, it needs to be set up for your site.
  28. #
  29. # TEMPDIR needs to be unique for each process because of the possibility
  30. # of simultaneous processes running this script.
  31. TEMPDIR=/tmp/bdf-snf.$$
  32. NAME=$1
  33. DPI=$2
  34. BDPI=$3
  35. MAG=$4
  36. MODE=$5
  37. DESTDIR=$6
  38. SERVER=$7
  39. USER=$8
  40. umask 0
  41.  
  42. #  Something like the following is useful at some sites.
  43. GFNAME=$NAME.$DPI'gf'
  44. BDFNAME=$NAME.$DPI.'bdf'
  45. SNFNAME=$NAME.$DPI.'snf'
  46.  
  47. # Clean up on normal or abnormal exit
  48. trap "cd /; rm -rf $TEMPDIR" 0 1 2 15
  49.  
  50. mkdir $TEMPDIR
  51. cd $TEMPDIR
  52.  
  53. echo mf "\mode:=$MODE; mag:=$MAG/1000; scrollmode; input $NAME" \\\</dev/null
  54. mf "\mode=$MODE; mag=$MAG/1000; scrollmode; input $NAME" </dev/null
  55. if test ! -r $GFNAME
  56. then
  57.    echo "Metafont failed for some reason on $GFNAME"
  58.    exit 1
  59. fi
  60.  
  61. echo "mftobdf -dpi" $DPI $NAME
  62. mftobdf -dpi $DPI $NAME
  63. if test ! -r $BDFNAME
  64. then 
  65.     echo "Mftobdf failed for some reason on $BDFNAME"
  66.     exit 1
  67. fi
  68.  
  69. # Install the BDF files carefully, since others may be doing the same
  70. # as us simultaneously.
  71.  
  72. rcp $BDFNAME $USER@$SERVER:$DESTDIR/bdftmp.$$
  73. rsh $SERVER -l $USER mv $DESTDIR/bdftmp.$$ $DESTDIR/$BDFNAME
  74.  
  75.  
  76. rsh $SERVER -l $USER mkfontdir $DESTDIR
  77. xset fp rehash
  78.  
  79. exit 0
  80.