Fixed part

First, MakeBatch.rexx makes your it is able to write (or rather append) entries to the batch file. @d Set up the batch file @If Exists(BATCHNAME) Then Do If Open(BATCHFILE,BATCHNAME,'W') Then Do Say "MakeBatch: Could not create "BATCHNAME" !" Exit 10 End; Else Do Call Writeln(BATCHFILE,";# Batchfile for font generation") If Close(BATCHFILE) Then Do 'Protect 'BATCHNAME' Add s' Say "MakeBatch: Batchfile "BATCHNAME" created." End; Else Do Say "MakeBatch: Error during creation of "BATCHNAME" !" Exit 10 End End End @

Here is the complete list of parameters to the MakeBatch.rexx script as described earlier. @d Get the calling parameters @Parse Arg PARAMETERS Parse Value PARAMETERS With FONTNAME DUMMY Parse Value DUMMY With DPI HBASE VBASE DUMMY Parse Value DUMMY With DRIVER DUMMY Parse Value DUMMY With PKFILENAME PKDIR . @

Only ShowDVI and DVIprint of version ≥1.08 supply arguments <drivertype> (show/print) and <pkfilename> (for example `dpi120/cmr10.120pk', depending on the font configuration files ShowDVI.fnt and DVIprint.fnt).

Only ShowDVI and DVIPrint of version ≥1.10 supply the argument <pkdir> (for example `TeXMF:fonts/source/public/cm/amiga/'). For the purposes of CallMF 2, only the <mode> part of <pkdir> would suffice, e.g., `/amiga/'.

DVIPS 5.47 supplies <drivertype>, <pkfilename>, and <pkdir>, but the latter is not correct! It is always set to `TeX:pk/' instead of the directory given in the file config.ps.

DVIPS 5.58 supplies <drivertype>, <pkfilename>, and <pkdir> correctly as given in config.ps. Surely there will also be a version fully supporting TEX Directory Structure (TDS)TEX Directory Structure (TDS)TDSTDSTDS.

To save a considerable amount of disk space, all ``show'' entries are redirected to the standard ``amiga'' mode. For example, the PasTEX mode ``OneTwoZero'' will use the 120 dpi fonts generated for ``mag=1.2'' of mode ``amiga''.

@d Fix any show entries to a single <mode> @If DRIVER="show" Then Do HBASE = "100" VBASE = "100" PKDIR = "/amiga/" PARAMETERS = FONTNAME DPI HBASE VBASE DRIVER PKFILENAME PKDIR End @

The following code is the unmodified version written by Ulrich Wisser for CallMF 1.0. I don't use DVIPS and have never tested this.

@d Insert font caching for DVIPS @If DRIVER="dvips" Then Do If Open('FONTFILE', FONTFILENAME, 'READ') Then Do Do Until EOF('FONTFILE') LINE = ReadLn('FONTFILE') If Pos(';', LINE) > 0 Then LINE = Left(LINE, Pos(';', LINE)-1) Parse Var LINE DISK'='ddd'd.'LINE If DDD=HBASE Then Do Do Until LINE = '' Parse Var LINE DIR'.'LINE If DIR=DPI Then Do If Exists(DISK':'PKFILENAME) Then Do FULLNAME=PKDIR||PKFILENAME DIRNAME=Left(FULLNAME, LastPos('/', FULLNAME)-1) If Exists(DIRNAME) Then Do Say 'makedir' DIRNAME MakeDir DIRNAME End Say 'copy 'DISK':'PKFILENAME' 'FULLNAME Copy DISK':'PKFILENAME' 'FULLNAME' QUIET NOREQ' If Close('FONTFILE') Then Say "Can't close file "FONTFILENAME"!" Exit End /* If Exists */ End /* If DIR=DPI */ End /* Do Until LINE */ End /* If DDD */ End /* Do Until EOF */ If Close('FONTFILE') Then Say "Can't close file "FONTFILENAME"!" End /* If Open */ Else Say "Couldn't find file "FONTFILENAME End /* If DRIVER */ @

Uncomment the first lines to see what MakeBatch.rexx intends to do. Else it is very simple, just hand over all PARAMETERS to the kernel script that will do the actual font generation. I thought about modifying some of the unused entries, but it doesn't seem worthwhile (and it is a good test for MakeTeXFont.rexx). @d Create a new line for the batch file @/* * Say "MakeBatch: Font named = "FONTNAME" with dpi = "DPI * Say "and base x = "HBASE", y = "VBASE * If "" = DRIVER Then * Say " for driver = "DRIVER", pkname = "PKFILENAME */ MESSAGE = "rx" MAKETEXFONT PARAMETERS @

Would it be better to `Search' for FONTNAME, DPI, HBASE, and VBASE only? @d Enter the new line in the batch file, but not twice @'Search >NIL: 'BATCHNAME' "'MESSAGE'"'

If RC =0 Then @<The line does not yet exist, append it to the batch file@> Else Say "MakeBatch: Entry already exists!" @

@d The line does not yet exist, append it to the batch file @Do @<Open the batch file for appending@> DUMMY = Writeln(BATCHFILE,MESSAGE) @<Close the batch file@> End @

@d Open the batch file for appending @If Open(BATCHFILE,BATCHNAME,'Append') Then Do Say "MakeBatch: Can't open "BATCHNAME" to add new entry" Exit 10 End @

@d Close the batch file @If Close(BATCHFILE) Then Say "MakeBatch: New entry added for "FONTNAME DPI" dpi" Else Do Say "MakeBatch: Error while adding new entry!" Exit 10 End @