1MF(1)                       General Commands Manual                      MF(1)
2
3
4

NAME

6       mf,  mf-nowin,  inimf,  virmf  - Metafont, a language for font and logo
7       design
8

SYNOPSIS

10       mf [options] [commands]
11

DESCRIPTION

13       Metafont reads the program in the  specified  files  and  outputs  font
14       rasters  (in gf format) and font metrics (in tfm format).  The Metafont
15       language is described in The Metafontbook.
16
17       Like TeX, Metafont is normally used with a large  body  of  precompiled
18       macros,  and font generation in particular requires the support of sev‐
19       eral macro files.  This version of Metafont looks at its  command  line
20       to  see  what  name it was called under.  Both inimf and virmf are sym‐
21       links to the mf executable.  When called as inimf  (or  when  the  -ini
22       option is given) it can be used to precompile macros into a .base file.
23       When called as virmf it will use the plain base.  When called under any
24       other name, Metafont will use that name as the name of the base to use.
25       For example, when called as mf the mf base is used, which is  identical
26       to the plain base.  Other bases than plain are rarely used.
27
28       The  commands  given  on  the  command line to the Metafont program are
29       passed to it as the first input line.  (But it is often easier to  type
30       extended  arguments  as the first input line, since UNIX shells tend to
31       gobble up or misinterpret Metafont's favorite symbols, like semicolons,
32       unless  you  quote them.)  As described in The Metafontbook, that first
33       line should begin with a filename, a \controlsequence, or a &basename.
34
35       The normal usage is to say
36
37              mf  '\mode=<printengine>; [mag=magstep(n);]' input  font
38
39       to start processing font.mf.  The single quotes are  the  best  way  of
40       keeping  the  Unix  shell  from misinterpreting the semicolons and from
41       removing the \ character, which is needed here to  keep  Metafont  from
42       thinking that you want to produce a font called mode.  (Or you can just
43       say mf and give the other stuff on  the  next  line,  without  quotes.)
44       Other  control  sequences, such as batchmode (for silent operation) can
45       also appear.  The name font will be the ``jobname'',  and  is  used  in
46       forming  output file names.  If Metafont doesn't get a file name in the
47       first line, the jobname is mfput.  The default extension, .mf,  can  be
48       overridden by specifying an extension explicitly.
49
50       A  log  of  error  messages goes into the file jobname.log.  The output
51       files are jobname.tfm and jobname.<number>gf, where <number> depends on
52       the resolution and magnification of the font.  The mode in this example
53       is shown generically as <printengine>, a symbolic term  for  which  the
54       name  of  an  actual  device or, most commonly, the name localfont (see
55       below) must be substituted. If the mode is  not  specified  or  is  not
56       valid for your site, Metafont will default to proof mode which produces
57       large character images for use in font design  and  refinement.   Proof
58       mode  can be recognized by the suffix .2602gf after the jobname.  Exam‐
59       ples of proof mode output can be found  in  Computer  Modern  Typefaces
60       (Volume  E  of  Computers  and Typesetting).  The system of magsteps is
61       identical to the system used by TeX, with values generally in the range
62       0.5,  1.0, 2.0, 3.0, 4.0 and 5.0.  A listing of gf numbers for 118-dpi,
63       240-dpi and 300-dpi fonts is shown below.
64
65           MAGSTEP        118 dpi   240 dpi   300 dpi
66
67       mag=magstep(0)     118       240       300
68       mag=magstep(0.5)   129       263       329
69       mag=magstep(1)     142       288       360
70       mag=magstep(2)     170       346       432
71       mag=magstep(3)     204       415       518
72       mag=magstep(4)     245       498       622
73       mag=magstep(5)     294       597       746
74
75       Magnification can also be specified not as a magstep but  as  an  arbi‐
76       trary value, such as 1.315, to create special character sizes.
77
78       Before  font production can begin, it is necessary to set up the appro‐
79       priate base files.  The minimum set of components for  font  production
80       for  a  given  print-engine  is  the  plain.mf macro file and the local
81       mode_def file.  The macros in plain.mf can be studied in an appendix to
82       the Metafontbook; they were developed by Donald E. Knuth, and this file
83       should never be altered except when it is  officially  upgraded.   Each
84       mode_def  specification helps adapt fonts to a particular print-engine.
85       There is a regular discussion of mode_defs in TUGboat, the  journal  of
86       the  TeX Users Group.  The local ones in use on this computer should be
87       in modes.mf.
88
89       The e response to Metafont's error-recovery  mode  invokes  the  system
90       default  editor  at the erroneous line of the source file.  There is an
91       environment variable, MFEDIT, that overrides the  default  editor.   It
92       should  contain  a  string with "%s" indicating where the filename goes
93       and "%d" indicating where the decimal linenumber (if  any)  goes.   For
94       example,  an  MFEDIT  string  for the vi editor can be set with the csh
95       command
96              setenv MFEDIT "vi +%d %s"
97
98       A convenient file in the library is null.mf, containing nothing.   When
99       mf can't find the file it thinks you want to input, it keeps asking you
100       for another file name; responding `null' gets you out of  the  loop  if
101       you don't want to input anything.
102

ONLINE GRAPHICS OUTPUT

104       Metafont  can use most modern displays, so you can see its output with‐
105       out printing.  Chapter 23 of The Metafontbook describes  what  you  can
106       do.   This  implementation  of  Metafont  uses environment variables to
107       determine which display device you want to use.  First it looks  for  a
108       variable  MFTERM,  and then for TERM.  If it can't find either, you get
109       no online output.  Otherwise, the value of the variable determines  the
110       device  to  use:  hp2627,  sun  (for old SunView), tek, uniterm (for an
111       Atari ST Tek 4014 emulator), xterm (for either X10 or  X11).   Some  of
112       these  devices  may  not  be supported in all Metafont executables; the
113       choice is made at compilation time.
114
115       On some systems, there are two Metafont binaries, mf and mf-nowin.   On
116       those  systems  the  mf  binary  supports  graphics, while the mf-nowin
117       binary does not.  The mf-nowin binary is used by scripts  like  mktexpk
118       where graphics support is a nuisance rather than something helpful.
119

OPTIONS

121       This  version  of  Metafont  understands  the  following  command  line
122       options.
123
124       -base base
125              Use base as the name of the base to be used, instead of the name
126              by which Metafont was called or a %& line.
127
128       -file-line-error
129              Print  error messages in the form file:line:error which is simi‐
130              lar to the way many compilers format them.
131
132       -no-file-line-error
133              Disable printing error messages in the file:line:error style.
134
135       -file-line-error-style
136              This is the old name of the -file-line-error option.
137
138       -halt-on-error
139              Exit with an error code when an error is encountered during pro‐
140              cessing.
141
142       -help  Print help message and exit.
143
144       -ini   Be inimf, for dumping bases; this is implicitly true if the pro‐
145              gram is called as inimf.
146
147       -interaction mode
148              Sets the interaction mode.  The mode can be  one  of  batchmode,
149              nonstopmode,  scrollmode,  and  errorstopmode.   The  meaning of
150              these modes is the same as that of the corresponding commands.
151
152       -jobname name
153              Use name for the job name, instead of deriving it from the  name
154              of the input file.
155
156       -kpathsea-debug bitmask
157              Sets  path  searching  debugging flags according to the bitmask.
158              See the Kpathsea manual for details.
159
160       -maketex fmt
161              Enable mktexfmt, where fmt must be mf.
162
163       -no-maketex fmt
164              Disable mktexfmt, where fmt must be mf.
165
166       -output-directory directory
167              directory instead of the current directory.  Look up input files
168              in directory first, the along the normal search path.
169
170       -parse-first-line
171              If the first line of the main input file begins with %& parse it
172              to look for a dump name or a -translate-file option.
173
174       -no-parse-first-line
175              Disable parsing of the first line of the main input file.
176
177       -progname name
178              Pretend to be program name.  This affects both the  format  used
179              and the search paths.
180
181       -recorder
182              Enable  the filename recorder.  This leaves a trace of the files
183              opened for input and output in a file with extension .fls.
184
185       -translate-file tcxname
186              Use the tcxname translation table.
187
188       -version
189              Print version information and exit.
190

ENVIRONMENT

192       See the Kpathsearch library documentation  (the  `Path  specifications'
193       node)  for  the  details  of how the environment variables are use when
194       searching.  The kpsewhich utility can be used to query  the  values  of
195       the variables.
196
197       If  the  environment  variable TEXMFOUTPUT is set, Metafont attempts to
198       put its output files in it, if they cannot be put in the current direc‐
199       tory.  Again, see tex(1).
200
201       MFINPUTS
202              Search path for input and openin files.
203
204       MFEDIT Command template for switching to editor.
205
206       MFTERM Determines  the  online  graphics display. If MFTERM is not set,
207              and DISPLAY is set, the Metafont window support for X  is  used.
208              (DISPLAY  must  be  set  to  a  valid X server specification, as
209              usual.)  If neither MFTERM nor DISPLAY is set, TERM is  used  to
210              guess the window support to use.
211

FONT UTILITIES

213       A number of utility programs are available.  The following is a partial
214       list of available utilities and  their  purpose.   Consult  your  local
215       Metafont guru for details.
216
217       gftopk   Takes  a  gf  file  and produces a more tightly packed pk font
218                file.
219
220       gftodvi  Produces proof sheets for fonts.
221
222       gftype   Displays the contents of a gf file in mnemonics and/or images.
223
224       pktype   Mnemonically displays the contents of a pk file.
225
226       mft      Formats a source file as shown in Computer Modern Typefaces.
227

FILES

229       mf.pool
230              Encoded text of Metafont's messages.
231
232       *.base Predigested Metafont base files.
233
234       $TEXMFMAIN/metafont/base/plain.mf
235              The standard base.
236
237       $TEXMFMAIN/metafont/misc/modes.mf
238              The file of mode_defs for your site's various printers
239

NOTES

241       This manual page is not meant to be exhaustive.  The complete  documen‐
242       tation  for  this  version  of Metafont can be found in the info manual
243       Web2C: A TeX implementation.
244

BUGS

246       On January 4, 1986 the ``final'' bug in  Metafont  was  discovered  and
247       removed.  If an error still lurks in the code, Donald E. Knuth promises
248       to pay a finder's fee which doubles every year to the first person  who
249       finds it.  Happy hunting.
250

SUGGESTED READING

252       Donald  E.  Knuth, The Metafontbook (Volume C of Computers and Typeset‐
253       ting), Addison-Wesley, 1986, ISBN 0-201-13445-4.
254       Donald E. Knuth, Metafont: The Program (Volume D of Computers and Type‐
255       setting), Addison-Wesley, 1986, ISBN 0-201-13438-1.
256       Donald  E.  Knuth, Computer Modern Typefaces (Volume E of Computers and
257       Typesetting), Addison-Wesley, 1986, ISBN 0-201-13446-2.
258       TUGboat (the journal of the TeX Users Group).
259

COMMENTS

261       Warning: ``Type design can be hazardous to your other interests.   Once
262       you  get  hooked,  you will develop intense feelings about letterforms;
263       the medium will intrude on the messages that you read.   And  you  will
264       perpetually  be  thinking  of  improvements  to  the fonts that you see
265       everywhere, especially those of your own design.''
266

SEE ALSO

268       gftopk(1), gftodvi(1), gftype(1), mft(1), pltotf(1), tftopl(1).
269

AUTHORS

271       Metafont was designed by Donald E. Knuth, who implemented it using  his
272       Web  system  for  Pascal programs.  It was originally ported to Unix by
273       Paul Richards at the University of Illinois at Urbana-Champaign.   This
274       page was mostly written by Pierre MacKay.
275
276
277
278Web2C 7.5.4                    10 November 2001                          MF(1)
Impressum