home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Metafont27 / mfbin.lzh / MISSING.AWK < prev    next >
Text File  |  1991-01-14  |  3KB  |  69 lines

  1. # For you hacking pleasure !
  2. #
  3. # Copyright (C) 1991 by Frank Ridderbusch 
  4. #     (Feel free to distribute)
  5. #
  6. # AWK script, to generate a batch file to be executed by Gulam.
  7. # This script was inspired by a similar script, which Michal
  8. # Jaegermann included in his port of GNU-AWK to the ST. This script
  9. # depends on the fact, that the DVI-drivers, which I'm using, produce
  10. # a file called 'missing.fnt', which contains a line for every font,
  11. # which couldn't be opened. A sample entry looks as follows:
  12. #
  13. #  res101.scr cmtt10 magstep0
  14. #      |        |       |
  15. #      |        |       +----> magnification
  16. #      |        +------------> font name
  17. #      +---------------------> output device
  18. #                              res101.scr => Screen Previewer
  19. #                              res180.nel => NEC P6 180 dpi
  20. #                              res300.slm => Atari Laser Printer
  21. #                              res360.neh => NEC P6 360 dpi
  22. #
  23. # The resulting PK fonts go into the following directory structure:
  24. #
  25. # f:\tex\prtfonts\res101.scr\mag____1.000
  26. #                           \mag____1.095
  27. #                  .....
  28. # f:\tex\prtfonts\res180.nel\mag____1.000
  29. #                \mag____1.095
  30. #                  .....
  31. #  .........
  32. #
  33. BEGIN { fontbase = "f:\\tex\\prtfonts\\"
  34.     tfmdir = "f:\\tex\\texinput\\tfm"
  35.     pkfonts["res101.scr"] = fontbase "res101.scr" "\\mag____"
  36.     pkfonts["res180.nel"] = fontbase "res180.nel" "\\mag____"
  37.     pkfonts["res300.slm"] = fontbase "res300.slm" "\\mag____"
  38.     pkfonts["res360.neh"] = fontbase "res360.neh" "\\mag____"
  39.     mode["res101.scr"] = "stscreen"
  40.     mode["res180.nel"] = "psix_low"
  41.     mode["res300.slm"] = "stlaser"
  42.     mode["res360.neh"] = "psix_high"
  43.     magnification["magstep0"] = "1.000"
  44.     magnification["magstep1"] = "1.200"
  45.     magnification["magstep2"] = "1.440"
  46.     magnification["magstep3"] = "1.728"
  47.     magnification["magstep4"] = "2.074"
  48.     magnification["magstep5"] = "2.488"
  49.     print "#"
  50.     print "# gulam script to generate pk-fonts created by gawk"
  51.     print "# it assumes that subdirectory tfm already exists"
  52.     print "#"
  53.     print "alias virmf h:\\tex\\virmf.ttp"
  54.     print "alias gftopk h:\\tex\\gftopk.ttp"
  55.     print "#"
  56.       }
  57. { printf "virmf '&plain \\mode:=%s;\\mag:=%s;input %s'\n", mode[$1], $3, $2 
  58.   if ( $3 ~ /magstep/ ) mag = magnification[$3]
  59.   else mag = $3
  60.   match ( $1, /[0-9]+/ )
  61.   res = int (( substr ( $1, RSTART, RLENGTH ) * mag) + 0.5)
  62.   printf "if { -e %s%s } == 0\n\tmkdir %s%s\nendif\n", \
  63.       pkfonts[$1], mag, pkfonts[$1], mag
  64.   printf "gftopk .\\%s.%sgf %s%s\\%s.pk\n", $2, res, pkfonts[$1], mag, $2
  65.   printf "if { -e %s\\%s.tfm } == 0\n\tmv %s.tfm %s\nef\n\trm %s.tfm\nendif\n", \
  66.       tfmdir, $2, $2, tfmdir, $2
  67.   printf "rm %s.log %s.%s\n#\n", $2, $2, res
  68. }
  69.