home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / bbs / programs / amiga / metafont.lha / MF / REXX / CreateMagBatch.rexx next >
OS/2 REXX Batch file  |  1994-05-13  |  2KB  |  82 lines

  1. /*
  2. **  AREXX $VER: CreateMagBatch 1.0 (13.05.94)
  3. **
  4. **  Georg Hessmann (hessmann@informatik.uni-hamburg.de)
  5. **
  6. **
  7. **  CreateMagBatch
  8. **
  9. **  Create a command batchfile for a given list of fonts
  10. **  and a given resolution.
  11. **
  12. **  Arguments: fontlist dpi hbasedpi vbasedpi pkdir
  13. **
  14. **    fontlist : file with one font per line
  15. **    dpi      : create fonts with this resolution
  16. **    hbasedpi :
  17. **    vbasedpi : use this to determine, which MF mode should be used
  18. **               (see MF:config/modes)
  19. **    pkdir    : target directory
  20. **
  21. **
  22. **
  23. **  HISTORY:  
  24. **
  25. **  1.0:  Wrote the script.
  26. **        Georg Hessmann (13.05.94)
  27. **
  28. */
  29.  
  30. parse arg fontlist dpi hbasedpi vbasedpi pkdir .
  31.  
  32. SIGNAL ON ERROR
  33. SIGNAL ON FAILURE
  34. SIGNAL ON BREAK_C
  35. SIGNAL ON BREAK_D
  36.  
  37.  
  38. /* open the fontlist file */
  39. IF ~open('flist', fontlist, 'read') THEN DO
  40.   say "Can't find file "fontlist"!"
  41.   exit 10
  42. END
  43.  
  44.  
  45. /* open the command file */
  46. IF ~open('commfile', "RAM:MagBatch.sh", 'write') THEN DO
  47.   say "Can't open file "RAM:MagBatch.sh"!"
  48.   exit 10
  49. END
  50.  
  51.  
  52. /* create a command-list for all fonts */
  53. DO UNTIL eof('flist')
  54.   line = readln('flist')
  55.   line = strip(translate(line, '', '2009'X))    /* a space and a tab */
  56.   font = word(line,1)
  57.  
  58.   IF font ~= "" THEN DO
  59.     fullfont = pkdir||font"."dpi"pk"
  60.     IF ~exists(fullfont) THEN DO
  61.       comm = "rx MF:rexx/MakeTeXFont" font dpi hbasedpi vbasedpi "CreateMag" font"."dpi"pk" pkdir
  62.       dummy = writeln('commfile',comm)
  63.     END
  64.   END
  65. END
  66.  
  67. dummy = close('commfile')
  68. dummy = close('flist')
  69.  
  70. address command 'protect RAM:MagBatch.sh add s'
  71.  
  72. EXIT 0
  73.  
  74. /*---------------------------------*/
  75.  
  76.  
  77. BREAK_C:
  78. BREAK_D:
  79. ERROR:
  80. FAILURE:
  81.          EXIT 5
  82.