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 / Mftobdf / build-initial- next >
Text File  |  1989-04-05  |  1KB  |  66 lines

  1. #!/bin/sh
  2. #    Posted-From: The MITRE Corp., Bedford, MA
  3. #    X-Alternate-Route: user%node@mbunix.mitre.org
  4. #    Return-Path: <ramsdell@huxley>
  5. #    Posted-Date: Mon, 20 Mar 89 07:08:32 EST
  6. #    Date: Mon, 20 Mar 89 07:08:32 EST
  7. #    From: ramsdell@huxley.mitre.org (John D. Ramsdell)
  8. #    To: grunwald@m.cs.uiuc.edu (Dirk Grunwald)
  9. #    Subject: texx2 font generator
  10. #    
  11. #    Here is a simple way to generate fonts for TeXx2.
  12. #    John
  13. #    
  14. #!/bin/sh
  15. FONTDPI=300
  16. TFMFONTDIR=/usr/local/lib/tex/fonts/tfm
  17. DPI=$1
  18. XFONTDIR=/usr/local/lib/tex/fonts/snf$DPI
  19.  
  20. # MAG=1000*DPI/FONTDPI
  21. case "$DPI" in
  22. 150)    MAG=500;;
  23. 100)    MAG=333;;
  24.  75)    MAG=250;;
  25.   *)    echo "Unknown size $1" 1>&2; exit 1;;
  26. esac
  27.  
  28. if test ! -d $XFONTDIR
  29. then 
  30.    echo Cannot find $XFONTDIR
  31.    exit 1
  32. fi
  33.  
  34. TMPDIR=/tmp/tfm2snf$$
  35. trap 'rm -rf /tmp/$TMPDIR; exit' 0 1 2 3 15
  36. mkdir $TMPDIR
  37. cd $TMPDIR
  38.  
  39. for tfm in $TFMFONTDIR/*.tfm
  40. do
  41.     base=`basename $tfm .tfm`
  42.     for scale in "1000" "1098" "1200" "1440" "1728" "2074" "2488" \
  43.         "2988" "3583" "4300" "5160"
  44.     do
  45.     mftobdf -mag $MAG -scaled $scale $base
  46.     done
  47. done
  48.  
  49. #  Process bdf files.
  50. for file in *.bdf ;
  51. do
  52.     if test ! -s $file
  53.     then
  54.     echo $file is empty
  55.     else
  56.     base=`basename $file .bdf`
  57.     echo Processing $base
  58.     bdftosnf $base.bdf > $XFONTDIR/$base.snf
  59.     fi
  60. done
  61. #
  62. cd $XFONTDIR
  63. rm -rf $TMPDIR
  64. mkfontdir
  65.  
  66.