summaryrefslogtreecommitdiff
path: root/systems/knuth/local/man1/mf.1
blob: 40ed1647048896796c39ba6b4a2f813b2131a633 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
.TH MF 1L  10/19/89
.SH NAME
mf, inimf  \- METAFONT, a language for font design
.SH SYNOPSIS
.B mf
[ first line ]
.PP
.B inimf
[ first line ]
.ie t .ds TX \fRT\v'+0.3m'E\v'-0.3m'X\fP \" for troff
.el .ds TX TeX \" for nroff
.\" to use, type \*(TX
.ie t .ds OX \fIT\v'+0.3m'E\v'-0.3m'X\fP \" for troff
.el .ds OX TeX \" for nroff
.\" the same but obliqued

.SH DESCRIPTION
M\s-2ETAFONT\s0
reads the program in the specified files
and outputs font rasters (in gf format) and font metrics (tfm files).
M\s-2ETAFONT\s0
capabilities and language are described in
.I The M\s-2ETAFONT\s0\^book
by Donald E. Knuth, published by Addison-Wesley.
.PP
Like
\*(TX, M\s-2ETAFONT\s0
is normally used with a large body of precompiled macros, and font generation
in particular requires the support of several macro files.  The basic
program as compiled is called
.I inimf;
it can be used to precompile macros into a ``*.base'' file, which can be
preloaded when you invoke inimf under another name. If you call it `mf',
the file plain.base is quickly loaded; if you call it `foo' and link
`foo' to `inimf', you get the file foo.base. A different base file
can be loaded if you say &mybase at the beginning of your first input line.
As described in 
.I The M\s-2ETAFONT\s0\^book,
that line should otherwise begin with a file name
or a \\\|controlsequence.
The normal usage is to say
.IP
\fBmf\ \fR ' \\\|mode=<printengine>\^;\^ [\^\\\|mag=magstep(\fI\^n\fR\^)\^;\^] ' input\ \^\fI font \fR
.PP
to start processing 
.I font.mf.  
The single quotes are the best way of keeping the
shell from misinterpreting the semicolons and 
from removing the \\ characters, which are needed here to
keep M\s-2ETAFONT\s0 from thinking that you want to produce a font called
``mode'' or ``mag''. (Or you can just say `mf' and give the other stuff
on the next line, without quotes.) Other
\\\|controlsequences, such as \\\|batchmode (for silent operation) can
also appear. 
The name ``font'' will be the ``jobname'', and is used in forming
output file names.
If M\s-2ETAFONT\s0 doesn't get a file name in the first line, 
the jobname is ``mfput''.
The default `.mf' extension can be overridden by specifying an extension
explicitly.
There is no way to read a M\s-2ETAFONT\s0 input file with no filename extension.
.PP
A log of error messages goes 
into \fI font\fB\^.\^\fIlog\fR where\fI font\fR is the jobname.  
The output files 
are \fI font\fB\^.\^\fItfm\fR and \fI font\fB\^.\^\fI<\fR\^number\^\fI>gf\fR
where <number> depends on the resolution and
magnification of the font.  The ``\\\|mode'' in this example is 
shown generically as <printengine>, a symbolic term for which the name
of an actual printengine or the name ``localfont'' (see below) must be
substituted.
If the ``\\\|mode'' is not specified
or is not valid for your site, 
M\s-2ETAFONT\s0 
will
default to ``proof'' mode which produces large character images for
use in font design and refinement.  Proof mode can immediately
be recognized by the appearance of the suffix 
.I .2602gf 
\^ after the jobname.  Examples of proof mode output can be found
in 
.I The Computer Modern Fonts,
(Volume E of
.I Computers and Typesetting
), by Donald Knuth.
The system of 
.I magsteps 
is identical to the system used by
\*(TX,
with values normally in the range 0.5, 1.0, 2.0, 3.0, 4.0 and 5.0.
A listing of gf numbers for 118-dpi, 240-dpi and 300-dpi fonts
is shown below.
.ds f. mf.tbl \" tbl output inserted here
.TS 
.if \n+(b.=1 .nr d. \n(.c-\n(c.-1
.de 35
.ps \n(.s
.vs \n(.vu
.in \n(.iu
.if \n(.u .fi
.if \n(.j .ad
.if \n(.j=0 .na
..
.nf
.nr #~ 0
.if n .nr #~ 0.6n
.ds #d .d
.if \(ts\n(.z\(ts\(ts .ds #d nl
.fc
.nr 33 \n(.s
.rm 80 81 82 83
.nr 80 0
.nr 38 \w\s-2MAGSTEP\s0
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(0)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(0.5)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(1)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(2)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(3)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(4)
.if \n(80<\n(38 .nr 80 \n(38
.nr 38 \wmag=magstep(5)
.if \n(80<\n(38 .nr 80 \n(38
.80
.rm 80
.nr 81 0
.nr 38 \w118 dpi
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w118
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w129
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w142
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w170
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w204
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w245
.if \n(81<\n(38 .nr 81 \n(38
.nr 38 \w294
.if \n(81<\n(38 .nr 81 \n(38
.81
.rm 81
.nr 82 0
.nr 38 \w240 dpi
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w240
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w263
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w288
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w346
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w415
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w498
.if \n(82<\n(38 .nr 82 \n(38
.nr 38 \w597
.if \n(82<\n(38 .nr 82 \n(38
.82
.rm 82
.nr 83 0
.nr 38 \w300 dpi
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w300
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w329
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w360
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w432
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w518
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w622
.if \n(83<\n(38 .nr 83 \n(38
.nr 38 \w746
.if \n(83<\n(38 .nr 83 \n(38
.83
.rm 83
.nr 38 1n
.nr 79 0
.nr 40 \n(79+(0*\n(38)
.nr 80 +\n(40
.nr 41 \n(80+(3*\n(38)
.nr 81 +\n(41
.nr 42 \n(81+(3*\n(38)
.nr 82 +\n(42
.nr 43 \n(82+(3*\n(38)
.nr 83 +\n(43
.nr TW \n(83
.if t .if \n(TW>\n(.li .tm Table at line 13 file mf.tbl is too wide - \n(TW units
.nr #I \n(.i
.in +(\n(.lu-\n(TWu-\n(.iu)/2u
.fc  
.nr #T 0-1
.nr #a 0-1
.eo
.de T#
.ds #d .d
.if \(ts\n(.z\(ts\(ts .ds #d nl
.mk ##
.nr ## -1v
.ls 1
.ls
..
.ec
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'\s-2MAGSTEP\s0\h'|\n(41u'118 dpi\h'|\n(42u'240 dpi\h'|\n(43u'300 dpi
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(0)\h'|\n(41u'118\h'|\n(42u'240\h'|\n(43u'300
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(0.5)\h'|\n(41u'129\h'|\n(42u'263\h'|\n(43u'329
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(1)\h'|\n(41u'142\h'|\n(42u'288\h'|\n(43u'360
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(2)\h'|\n(41u'170\h'|\n(42u'346\h'|\n(43u'432
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(3)\h'|\n(41u'204\h'|\n(42u'415\h'|\n(43u'518
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(4)\h'|\n(41u'245\h'|\n(42u'498\h'|\n(43u'622
.ta \n(80u \n(81u \n(82u \n(83u 
.nr 31 \n(.f
.nr 35 1m
\&\h'|\n(40u'mag=magstep(5)\h'|\n(41u'294\h'|\n(42u'597\h'|\n(43u'746
.fc
.nr T. 1
.T# 1
.in \n(#Iu
.35
.TE
.if \n-(b.=0 .nr c. \n(.c-\n(d.-12

.br
Magnification can also be specified not as a magstep but as an
arbitrary value, such as 1.315, to create special character sizes.
.PP

Before font production can begin, it is necessary to set up the
appropriate `base' files.  The minimum set of components for font
production for a given print-engine is the `plain.mf' macro file
and the local `mode_def' file.  The macros in `plain.mf' can be
studied in an appendix to the
.I M\s-2ETAFONT\s0\^book;
they were developed by Donald Knuth, and this file should never be
altered except when it is officially upgraded.  
Each mode_def specification helps adapt fonts to a particular print-engine.
There is a regular discussion of mode_defs in the journal of the 
\*(TX
Users Group,
.I TUGboat;
the local ones in use on this computer (art) are in the
file /home/tex/local/lib/art.mf.
With only `plain.mf' and `<\^\s-2SITE\s0\^>\^-modes.mf' 
loaded it is possible to
create fonts of simple characters, such as those used for the
M\s-2ETAFONT\s0
logo, and those used for the LaTeX line and circle fonts,
but the production of Computer Modern fonts would be facilitated by
making a cmmf.base file (which includes the macros in cmbase.mf as
well as those in plain.mf).
.PP
Several environment variables can be used to set up directory
paths to search when M\s-2ETAFONT\s0 opens a file for input.
For example, the
.I csh
command
.br
.in +4
setenv \s-2MFINPUTS\s0\ .\^:\^/usr/me/mylib\^:\^/usr/local/lib/mf/inputs
.in -4
or the
.I sh
command sequence
.br
.in +4
\s-2MFINPUTS\s0\|=\|.\^:\^/usr/me/mylib\^:\^/usr/local/lib/mf/inputs
.br
export \s-2MFINPUTS\s0
.in -4
.br
would cause all invocations of M\s-2ETAFONT\s0 and its derivatives to look for
\\\|input files first in the current directory, then in a hypothetical
user's ``mylib'', and finally in the system library.
Normally, the user will place the command sequence which sets up the
\s-2MFINPUTS\s0 environment variable in the
.I .\|cshrc
or
.I .\|profile
file.
.PP
The
.I e
response to M\s-2ETAFONT\s0\|'s error-recovery mode invokes the
.I GNU emacs
editor at the erroneous line of the source file.
There is an environment variable, \s-2MFEDIT\s0, 
that can be used to specify the editor.  
It should contain a string with "%s" indicating where the
filename goes and "%d" indicating where the decimal linenumber (if any) goes.
For example, an \s-2MFEDIT\s0 string for the "vi" editor can be set by:
.br

.ti +3
     setenv \s-2MFEDITOR\s0 "/usr/bin/vi +%d %s"
.br
.sp .7
(replacing the path name for the editor
as appropriate on your system).
The Environment section below lists the relevant environment variables,
and their defaults.
.PP
A convenient file in the library is null.mf, containing nothing.
When mf can't find the file it thinks you want to input, it keeps
asking you for another file name;  responding `null' gets you out
of the loop if you don't want to input anything.
.PP
.SH ENVIRONMENT
The defaults for all environments are set at the
time of compilation, by reference to a file called /home/tex/local/mfpaths.h.  
The values given below are preset in this file.
.PP
.IP \s-2MFINPUTS\s0
Search path for \\\|input and \\\|openin files.  It should be colon-separated,
and start with ``.''.  The entire path must be no longer than 700
characters long.  
Default: .\^:\^/home/tex/local/lib\^:\^/home/tex/dist/lib
.IP \s-2MFBASES\s0
Search path for base files.  Default: .\^:\^/home/tex/local/mf
.IP \s-2MFPOOL\s0
Search path for M\s-2ETAFONT\s internal
strings.  Default: .\^:\^/home/tex/local/mf
.IP \s-2MFEDIT\s0
Command template for switching to editor.  Default: /emacs +%d %s
.br

.SH "FONT UTILITIES"
.PP
A number of utility programs are available (see section See Also). 
The following is a partial list of available utilities and their purpose. 
Consult your local M\s-2ETAFONT\s0 guru for details.
.br
.TP 1.5i
.B	 gftopk
Takes a GF file and produces a more tightly packed PK font file 
TP
.B	 gftodvi
Produces proof sheets for fonts
.TP
.B	 gftype
Displays the contents of a GF file in mnemonics and images
.br
.TP
.B	 pktype
Mnemonically displays the contents of a PK file
.br
.TP
.B	 mft
Formats a source file (font.mf) as shown in
.I Computer Modern Typefaces
.PP

.SH "FILES"
.TP 1.3i
/home/tex/{dist,local}/lib
M\s-2ETAFONT\s0's library areas
.TP
/home/tex/local/mf/mf.pool
Encoded text of M\s-2ETAFONT\s0's messages
.TP
/home/tex/local/mf/*.base
M\s-2ETAFONT\s0 base files
.TP
/home/tex/dist/lib/plain.mf
The ``standard'' macro package
.TP
/home/tex/local/lib/art.mf
The file of ``mode_def''s for your site's various printers
.TP
/home/tex/dist/cm
M\s-2ETAFONT\s0 sources for Computer Modern
.TP
/home/tex/local/cm
Local variations of Computer Modern
.br

.SH "SUGGESTED READING"
Donald E. Knuth,
.I The M\s-2ETAFONT\s0\^book
(Volume C of \fI Computers and Typesetting\fR\|)
.br
Donald E. Knuth,
.I M\s-2ETAFONT\s0\^ the Program
(Volume D of \fI Computers and Typesetting\fR\|)
.br
Donald E. Knuth,
.I Computer Modern Typefaces 
(Volume E of \fI Computers and Typesetting\fR\|)
.br
.I TUGboat
(the publication of the \*(TX Users Group)
.br
.SH "COMMENTS"
Warning: ``Type design can be hazardous to your other interests. 
Once you get hooked, you will develop intense feelings about letterforms;
the medium will intrude on the messages that you read.
And you will perpetually be thinking of improvements to the fonts that
you see everywhere, especially those of your own design.''
.br
.SH "BUGS"
On January 4, 1986 the ``final''
bug in M\s-2ETAFONT\s0 was discovered and removed. If an error still
lurks in the code, D. E. Knuth promises to
pay a finders fee which doubles every year
to the first person who finds it. Happy
hunting.
.SH "AUTHORS"
M\s-2ETAFONT\s0 was designed by Donald E. Knuth, 
who implemented it using his W\s-2EB\s0 system for Pascal programs.
It was ported to Unix by Paul Richards at the University of Illinois
at Urbana-Champaign.
This page written by Pierre MacKay (mostly).
.br
.SH "SEE ALSO"
dvitype(1), gftopk(1), gftodvi(1), gftype(1), mft(1),
pktype(1), pltotf(1), tftopl(1)