15cm=24cm `=̈

SBMKBAT UTILITY


Introduction


Perhaps the most common use of METAFONT is to produce font rasters from MF source. One may have numerous fonts to process for several output devices and possibly at several magnifications. Since this can be time consuming, DOS batch files seem to be the natural aid for dealing with the problem. When the files are numerous, even writing the batch files can be a chore. The operations for each font and mode are nearly the same, so a program to write the batch file is in order. This is the idea behind sbmkbat. One produces a model batch file, a list of names, and files to give the data associated with different modes and magnifications. Then sbmkbat processes these to produce the desired batch file.


The Name File


One creates a file named _name_._m_. The entries in this ASCII text file are the name of the font followed by single decimal or hexidecimal digits separated by white space (blank space or tab). If the name on the line is followed by no digits, then this name takes the previous digit values. Thus one need only include digits on the line containing the first name, if the digits for all the names are to be the same. An earlier version of sbmkbat would not work properly if two adjacent lines of the Name File contained the same name. The current version simply acccumualtes digit values for repeated names. The digits refer to the mode or magnification, so sbmkbat can handle up to 16 different modes or magnifications in a single run. There is no specific connection between the digit used and mode or magnification. The digit simply acts to distinguish different parameter sets. The font name will later be referenced by _name_. Blank lines are ignored, as is any line whose first character is %. If you use % to omit a line, be sure to include any desired digits from that line in a following line which does not start with %.


The Digit Files


For each digit which appears in _name_._m_, the program will look for a file with the name _d_._m_, where d is this digit. Thus one may have files _0_._m_ to _F_._m_ which hold the mode/magnification strings. Each of these files may define up to 10 strings which are associated with the tags _m0_ up to _m9_. Case is significant, so do not try _M2_ as this will not be interpreted as a tag. The file _5_._m_, for example, may be used to assign strings to any of these 10 tags. Unassigned tags correspond to empty strings. The string value associated with a tag is determined as follows. Lines in the file whose first character is % are ignored. White space is removed from the start and end of each non-% line. The first data remaining on the line must be a string of the form _md_, where d is a decimal digit; The value assigned to this tag is all characters on the line up to the first string of the form _mx_ or to the end of the line, where x is any character. If this x is a decimal digit, the data for the corresponding tag starts immediately after _mx_. Otherwise the program moves to the next line. If a tag is repeated, the the last string given is the one used to make the batch file.


The Model Batch


After the name and digit files have been parsed, the program looks for the file batch_mo.del. The program reads and stores the data in this file. Each occurence of _name_ will later be replaced in the output file MKMF.BAT by the current name as taken from the name file. Each occurence of _md_, where d is a decimal digit, will be replaced by the string assigned from the current digit file. Lines in batch_mo.del which have % as first character are skipped. The order in which the entries in the output file are written is first by the name order from the name file, then by numerical order for the digit files. If you prefer, all the batch entries for a given name to be done together, then include the switch -n on the command line, viz., sbmkbat -n.


Special Directories


To illustrate the use of sbmkbat two example directories should be included with this distribution. The directory MAGSTEPS contains the necessary files for creating the cm fonts in the imagen mode at the standard magsteps (provided that one has the MetaFont source files). The F file corresponds to magstephalf; the other digit files have the natural correspondence. Different DVI printing programs will require modification of these files, depending upon the directory structure and MF mode used by the printing program. Another way to access larger font sizes is by using the parameter files devised by John Sauter to create cm fonts at point sizes in addition to the standard ones. When the standard cm sizes are given as Sauter inputs, the technique produces fonts equivalent to the standard ones. There is the slight complication that the cm 17 point fonts are really 17.28 point fonts. For this reason the files in the SAUTER directory have been set up so that point sizes above 10 are related to nearby \magstep values. A small change to batchmo.del will result in true point sizes, but a file cmr17 so created is not the true cmr17.


Processing Single Fonts


To process several fonts, it is better to create the _name_._m_ file and proceed as above. The 0.1 version of sbmkbat allows a directory, a name and size hex-digits to be supplied on the command line. If one wants to generate the 20 and 25 point versions of cmcyr, one could execute
sbmkbat \sauter cmcyr F 0
and then run the batch file so created. If a directory is specified on the command line, this directory will be appended to other files read by the program. If what appears to be a font name and size data are given on the command line, then these data are used in place of those in _name_._m_.