summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/plain/pdcmac/pdcfsel.dtx
blob: a7010f20a09ad5ba0dbd807bf1b05f4530a222d1 (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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
% pdcfsel.dtx -- documentation & source for pdcfsel.tex -*-tex-*-
        
%%%@TeX-document-file {
%%% title 	= "PDCFSEL, a font selection scheme for TeX",
%%% filename 	= "$texmf/doc/plain/pdcmac/pdcfsel.dtx",
%%% version 	= "$Revision: 3.5 $",
%%% package 	= "pdcmac 1.0",
%%% date 	= "$Date: 1995/03/28 19:05:54 $",
%%% author	= "P. Damian Cugley",
%%% email	= "damian.cugley@comlab.ox.ac.uk",
%%% address	= "Oxford University Computing Laboratory,"
%%%                Parks Road, Oxford  OX1 3QD, UK",
%%% abstract	= "This document describes and defines pdcfsel.tex,
%%%                a file of definitions for managing font selection in
%%%                documents based on the plain TeX macros.
%%%                Running plain TeX on this file produces both the
%%%                definitions file and the printed documentation.",
%%% copyright	= "Copyright (c) 1991-1995 P. Damian Cugley",
%%% copying	= "This program is free software; you can redistribute
%%%		   it and/or modify it under the terms of the GNU
%%%		   General Public License as published by the Free
%%%		   Software Foundation; either version 2 of the License,
%%%		   or (at your option) any later version.",
%%% notice	= "This program is distributed in the hope that it will
%%%		   be useful, but WITHOUT ANY WARRANTY; without even the
%%%		   implied warranty of MERCHANTABILITY or FITNESS FOR A
%%%		   PARTICULAR PURPOSE.  See the GNU General Public
%%%		   License for more details.",
%%% notice	= "You should have received a copy of the GNU General
%%%		   Public License along with this program; if not, write
%%%		   to the Free Software Foundation, Inc., 675 Mass Ave,
%%%		   Cambridge, MA 02139, USA.",
%%% codetable	= "USASCII",
%%% dependencies = "pdccode.tex"
%%%}

%{{{ pdcfsel
%{{{  premable

\relax
\input pdccode

\document
\rcs$Id: pdcfsel.dtx,v 3.5 1995/03/28 19:05:54 pdc Exp $\endrcs

\codefile{pdcfsel.tex}
	
%}}}  premable
%{{{  intro
	
\author{P. Damian Cugley}	
\title{PDCFSEL, a font-selection scheme for \TeX}	
\section{Introduction}

	This document describes PDCFSEL, a file of font selection macros
	designed to be used with documents using the plain \TeX\ format
	(rather than \LaTeX, for example).

	The PDCFSEL macros perform a similar function to the so-called
	New Font Selection Scheme~2 (used in \LaTeX~2e).  PDCFSEL uses a
	simpler model of font selection, and so is a smaller
	package---about 110~lines of code---which is just as well as a
	copy of it will probably need to be included with documents
	using it.  The description of which fonts are used in a document
	can be relatively compact, despite not using any special
	database files.

\subsec{Organizing fonts into fontsets}

	We can arrange the fonts used in an imaginary \TeX\ document in
	a table like so (with an asterisk marking fonts that have to be
	scaled to fit):
    $$\def\*{{\rm*}}
\vbox{\halign{\strut#\hfil&\quad\vrule#&&\quad\tt#\hfil\cr
	&&		|\rm|&|\it|&|\bf|&|\bi|&|\mi|&|\sy|\cr
\noalign{\nointerlineskip}\omit& height \jot\cr
\noalign{\hrule}\omit& height 1\jot\cr
\noalign{\nointerlineskip}%
	body text&&	cmr10&	cmti10&	cmbx10&	cmbxti10& cmmi10& cmsy10\cr
	footnotes&&	cmr8&	cmti8&	cmbx8&	cmbxti10\*& cmmi8& cmsy8\cr
	script&&	cmr7&	cmti7&	cmbx7&	cmbxti10\*& cmmi7& cmsy7\cr
	scriptscript&&	cmr5&	cmti7\*& cmbx5&	cmbxti10\*& cmmi5& cmsy5\cr
\noalign{\nointerlineskip}\omit& height\jot depth\jot&\multispan6\dotfill\cr
\noalign{\nointerlineskip}%
	heading&& 	cmss12& cmssi12& -&-&-&-\cr
	subheading&&	cmss10& cmssi10& -&-&-&-\cr
}}
    $$ 
	The column headings are {\it font nicknames}.  These nicknames
	are used as described in the {\it\TeX book} to switch between
	fonts in the same row.  Each has a corresponding {\it fam}
	used in maths mode, with symbolic names like |\itfam| and
	|\bffam| (we define $\hbox{|\rmfam|}=0 $ for consistency).
	I~have added nicknames |\mi| and |\sy| for maths italic and
	maths symbol respectively.

	Each row of the table is a {\it fontset}.  Plain \TeX\ defines a
	single fontset (which is like the `body text' row of this
	table); in Appendix~E, Knuth discusses formats that switch
	between different fontsets with macros like |\ninepoint| and
	|\eightpoint|.  \LaTeX~2.09 uses many fontsets, called
	|\normalsize|, |\large|, and so on.  (NFSS~2 uses a more complex
	system, where size, weight, and slant may be changed
	independently of each other.)

	In this table, subheadings and body text have different fontsets
	in the above, even though the fonts are the same size.  Also,
	there are no |\sf| fonts; the headings are printed in sanserif
	by using a fontset with |\rm| mapped on to a sanserif font.
	This is more logical and flexible than the \LaTeX\ approach.

	We can call font families which allow this table to work tidily
	`regular', and families (like Computer Modern) that require
	exceptions `irregular'.  The above table has one exception
	(|\it| in scriptscript must use a scaled font); the CM Bold
	Extended Text Italic fonts can be described as regular if we
	think of the `body text' entry as being `|cmbxti10 at 10pt|', so
	that the fonts in that column are scaled fonts without
	exception.  To make font specification compact, we want to take
	advantage of regular families as much as possible, while not
	making it difficult to include exceptions.

\subsec{Introduction to using  PCDFSEL}

	PDCFSEL uses no databases of font families, and loads no fonts
	by default.  This makes it more flexible, but also requires
	document designers to write a `mini-database' of those fonts
	used in the document.  The above scheme might be defined as
	follows:
\smallskip
\halign{\indent#\hfil\cr
	|\input pdcfsel|\cr
\noalign{\smallbreak}%
	|\newfam\bifam|\cr
\noalign{\smallbreak}%
	|\def\texttemplate{%|\cr
	|    \m{rm}{cmr}\m{it}{cmti}\m{bf}{cmbx}\@\m{bi}{cmbxti10}%|\cr
	|    \M{mi}{cmmi}\M{sy}{cmsy}%|\cr
	|}|\cr
	|\loadfont\scriptscriptit{cmti7 at 5pt }|\cr
	|\xfontset{scriptscript}\texttemplate{5}|\cr
	|\xfontset{script}\texttemplate{7}|\cr
	|\fontset{note}\texttemplate{8}{10pt}{scriptscript}{scriptscript}|\cr
	|\fontset{body}\texttemplate{10}{12pt}{script}{scriptscript}|\cr
\noalign{\smallbreak}%
	|\def\headingtemplate{%|\cr
	|    \f{rm}{cmss}\f{it}{cmssi}%|\cr
	|}|\cr
 |\fontset{subheading}\headingtemplate{10}{12pt}{subheading}{subheading}|\cr
 |\fontset{heading}\headingtemplate{12}{14pt}{subheading}{subheading}|\cr
\noalign{\smallbreak}%
	|\bodyfonts|\cr
}
\smallbreak
\noindent
	This defines commands |\bodyfonts|, |\notefonts|,
	|\headingfonts| and |\subheadingfonts| which switch between
	fontsets.  (The {\it script} and {\it scriptscript} fontsets,
	which are defined with |\xfontset|, are used only in maths
	mode and don't need `-|fonts|' commands.)  These -|fonts|
	commands are not usually used directly in documents;
	|\notefonts| will be used in some |\footnote| command,
	|\headingfonts| in some heading-generating command, and so on.
	
	Changes of fontset are accompanied by changes in parameters like
	|\baselineskip| and pseudo-parameters like |\smallskipamount|,
	and give definitions to the {\it maths font tables}
	|\textfont\rmfam|, \dots, |\scriptscriptfont\syfam| (for those
	fonts that will be used in maths mode).

	We want font nickname commands to be efficient, because they
	are expected to be more common than changes between rows in
	the table.  In this implementation, after an invocation of
	|\bodyfonts|, the macro |\rm| expands to exactly `|\fam\rmfam
	\bodyrm|'.  

\subsec{How the rest of this document is organized}

	The remainder of this document is a description of all of
	|pdcfsel.tex|, including more details of how the commands it
	defines are used.

	Running this document (|pdcfsel.dtx|) through plain \TeX\
	creates the definitions file (|pdcfsel.tex|) in addition to
	the usual |dvi| and |log| files.  This way the macros and
	their documentation may be kept together in one file.  The
	definition lines are numbered.

	The definitions start with macros for loading individual
	fonts, followed by the macros used to group fonts into
	fontsets.
%}}}  intro
%{{{  getting started
	
\section{Getting started}

\subsec{File identification}

	We start with some comments indentifying the file.
\code
        |% pdcfsel.tex -- macros for loading fonts -*-tex-*-
        |
        |%%%@TeX-document-file {
        |%%% title      = "PDC Font Selection Scheme",
        |%%% filename   = "$texmf/tex/plain/pdcmac/pdcfsel.tex",
        \|\%\%\% version \space\space\space= "\fileversion",
        \|\%\%\% Date \space\space\space\space\space\space= "\filedate",
	\|\%\%\% creator\space\space\space\space= "\filename",
        |%%% package    = "pdcmac 1.0",
        |%%% author     = "P. Damian Cugley",
        |%%% email      = "damian.cugley@comlab.ox.ac.uk",
        |%%% address    = "Oxford University Computing Laboratory,"
        |%%%               Parks Road, Oxford  OX1 3QD, UK",
        |%%% abstract   = "A file of definitions for managing font 
        |%%%               selection in documents based on the plain 
        |%%%               TeX macros.  
	|%%%                 This file was generated by running
	|%%%               plain TeX on pdcfsel.dtx.",
        |%%% dependencies = ""
        |%%%}
        |
	\|\string\message\{\fileversion\space\string<%
		\fileauthor\space\filedate\string>\}
\endcode

\subsec{Private names}

        Macros internal to FSEL all have names starting `|\FSEL|'.

\subsec{Macros for edefs}

	These save typing |\expandafter| a lot.  The expression
	`|\expcs|\<token>\arg{\<tokens>}', creates a csname from
	\<tokens> and applies \<token> to the result.  In the body of an
	|\edef|, The expression `|\noexpcs|\arg{\<tokens>}' converts
	\<tokens> to a csname without expanding the result.
\code
	|\def\expcs#1#2{\expandafter#1\csname#2\endcsname}
	|\def\noexpcs{\expcs\noexpand}
\endcode
%}}}  getting started
%{{{  selecting demand-loading
	
\section{Selecting auto-loading mode} 

	The flag |\ifFSELautoload| is true, fonts are auto-loaded when
	they first used instead of all at the start.  This is useful
	when not all the fonts described by the fontsets will be
	needed.  The flag is set with the user command
	|\autoloadfonts|.

	When demand-loading, the fonts used
        are written to a file named after the document with a |.fnt|
	suffix.  This checklist might
        be used to decide which fonts need to be sent with the
        document if it is being sent to someone to compile on a
        different \TeX\ system.
\code
        |\newif\ifFSELautoload
        |\def\autoloadfonts{
        |    \FSELautoloadtrue
        |    \csname newwrite\endcsname \FSELfile
        |    \immediate\openout\FSELfile=\jobname.fnt
        |}
\endcode
%}}}  selecting demand-loading
%{{{  making csname for one font
	
\section{How to set up the csname for one font}

        The macro |\loadfont| is used to load individual fonts, defining
	a control sequence name (csname) which may be used later to
	switch to that font.  When not demand-loading fonts, this is
	just like |\global\font| followed by expanding the
	|\everyloadfont| macro.

	If the csname is already defined, then this command does
	nothing.  This is so that irregularities in the font scheme for
	the document can be allowed for.  Parameter |#1| is the csname,
	for example `|\bodyrm|', and |#2| is the external name, for
	example `|cmr10|' or `|cmr10 at 12pt|'.
\code
        |\def\loadfont#1#2{%
        |    \ifx#1\relax 
	|        \FSELloadfont#1{#2}%
	|    \else\ifx#1\UNDEFINED
	|        \FSELloadfont#1{#2}%
	|    \fi\fi
	|}
\endcode
	(We have to compare |#1| against both |\relax|, which is
	produced by |\csname|--|\endcsname|, and a completely undefined
	csname.)  The macro |\FSELloadfont| doesa the actual work of
	loading the font.
\code
	|\def\FSELloadfont#1#2{%
        |    \ifFSELautoload
\endcode
\begingroup \leftskip=\parindent \advance\leftskip4\fontdimen6\tentt
\noindent{\it Demand-loading}.  We don't load the font, instead we
	define a csname as a macro.  When expanded this new macro will
	(a)~write the font name to the |fnt| file; (b)~define the macro
	|\subfont| to load |cmr10| instead (in case \TeX\ stops with a
	`font not loadable' message); (c)~load the font for real (this
	overwrites the macro); (d)~call |\everyloadfont| for per-font
	customization and (e)~switch to the new font.
\par\endgroup
\code
        |        \edef#1{%
        |            \write\FSELfile{#2}%
        |            \def\noexpand\subfont{\global\font\noexpand#1cmr10 }%
        |            \global\font\noexpand#1#2\relax
        |            \noexpand\everyloadfont\noexpand#1{#2}%
        |            \noexpand#1%
        |        }%
        |    \else
\endcode
\leftline{\hskip4\fontdimen6\tentt \indent{\it Immediate loading}.}
\code
        |        \global\font#1#2\relax  \everyloadfont#1{#2}%
        |    \fi
        |}
\endcode

	The macro |\everyloadfont| is expanded immediately after
	actually loading a font.  (The definition used is that one
	current when the font is actually loaded, not the one current
	when |\loadfont| was executed.)  Its |#1| parameter is always a
	\<fontdef token>, i.e., it can be to used as a parameter to
	|\fontdimen1|.  The |#2| parameter is the external name of the
	font.
\code
        |\def\everyloadfont#1#2{}
\endcode
	For example, in a document with a ragged-right margin, this
	might be used to suppress the stretch and
        shrink of interword spaces by being defined as follows
    $$
\vbox{\halign{#\hfil\cr
	|\def\everyloadfont#1#2{%|\cr
	|    \fontdimen3#1=0pt \fontdimen4#1=0pt|\cr
	|}|\cr
}}
    $$
%}}}  making csname for one font
%{{{  making a fontset
	
\section{How to set up a fontset}

	Now that we know how to define individual font csnames, we
        need the mechanism for grouping them in to fontsets.  A
	fontset is defined by a template macro which says what font
	nicknames are defined and gives part of the external font
	name.  The template macro takes no parameters and expands to
	a list each of whose elements are of the form
    $$ 
\vbox{\halign{$#$\hfil&\quad#\hfil\cr
	\<type> \arg{\<nickname>} \arg{\<partial name>}&
		or\cr
	\cs{@} \<type> \arg{\<nickname>} \arg{\<external name>}&
		for a scaled font.\cr
}}
    $$ 
	where a \<type> is one of the control sequences |\f|, |\m| or
	|\M|, and \<nickname> is the two- or three-letter nickname
	used for the font (without any leading backslash), for example
	|rm|, |it|, |bf|.  There must be a font fam called
	|\|\<nickname>|fam| (|\rmfam|, |\itfam| etc.\ are already
	defined).

	If there is no |\@|, then the \<partial name> is a font name
	sans the size specification, such as |cmr|.  The size in
	points will be appended to this (|cmr| + $10\pt$ = |cmr10|).
	If |\@| is included then the \<external name> is the complete
	font name, such as |cmr10| or |ptmr|.  This will be followed
	by `{\tt\char32 at\char32 10pt\char32 }', say.

	The \<type> specifies how much support for mathematics this font
	requires.  This is because maths mode requires that all fonts
	that might be used in a formula be loaded (because the font
	tables |\textfont|, |\scriptfont| and |\scriptscriptfont| must
	be set).  The code |\f| means that the font is not used in
	maths, |\m| means that |\textfont| and |\scriptfont| will be set
	correctly for this fam, and |\M| means that |\scriptscriptfont|
	will also be set.  In these cases there must be a corresponding
	token ending in `-|fam|' that expands to the fam number.

	The fontset name is a sequence of \<letter>s, like `|body|',
	`|note|', `|script|', `|heading|'.  This is turned into a
	fontset selection macro by adding `|\|' to the front and
	`|fonts|' to the end (e.g., |\bodyfonts|).  The csnames for
	loaded fonts are formed from the fontset name + the nickname
	(e.g., |\bodyrm|).

\subsec{Defining the csnames for a fontset}

	The macro |\xfontset| defines all the csnames for the fonts in a
	fontset, without defining a `-|fonts|' macro.  This is used to
	define a fontset that is never selected in its own right (e.g.,
	its fonts are used only as subscripts and superscripts), and
	also used internally by the |\fontset| command.  Its arguments
	are |#1| the fontset name, |#2| the csname of a template macro,
	and |#3| a \<number> that specifies the font size (sans the
	`|pt|').
\code
        |\def\xfontset#1#2#3{
        |    \def\f##1##2{\expcs\loadfont{#1##1}{##2#3}}
        |    \let\m=\f \let\M=\f 
        |    \def\@##1##2##3{\expcs\loadfont{#1##2}{##3 at #3pt }}
        |    #2
        |}
\endcode

\subsec{Defining a complete fontset}

	The user command |\fontset| is used to define a complete
	fontset.  Its parameters are
        |#1| (a string of letters) is the fontset name,
        |#2| (a csname) is a template macro,
        |#3| (a \<number>) is size in points,
        |#4| (a \<skip>) is baseline skip,
        |#5| (a fontset name) is the scriptstyle fontset, and
        |#6| (a fontset name) is the scriptscriptstyle fontset.
\code
        |% Set up a fontset -- define \#1fonts
        |\def\fontset#1#2#3#4#5#6{%
        |    \xfontset{#1}{#2}{#3}%
\endcode
\begingroup\leftskip=\parindent \advance\leftskip2\fontdimen6\tentt
\noindent
	Now to define the |\#1fonts| macro.  When demand-loading, this
	macro will call |\#1mathfonts| (to ensure the fonts needed for
	maths are loaded).  Then it will call |\FSELnicknames| to
	define |\rm|, |\it|, etc., and to define |\textfont\rmfam|, etc.
	Finally it will set the baseline skip and related parameters and
	switch to the new |\rm| font.
\par\endgroup
\code
        |    \expcs\edef{#1fonts}{%
        |       \ifFSELautoload \noexpcs{#1mathsfonts}\fi
        |       \noexpand\FSELnicknames{#1}{#5}{#6}\noexpand#2%
        |       \noexpand\setbaselineskip{#4}%
        |       \noexpand\rm
        |    }%
\endcode
\begingroup\leftskip=\parindent \advance\leftskip2\fontdimen6\tentt
\noindent
	If we are demand-loading, we must define |\#1mathsfonts| as well.
\par\endgroup
\code
        |    \ifFSELautoload
        |       \expcs\def{#1mathsfonts}{\FSELloadmaths{#1}{#5}{#6}#2}%
        |    \fi
        |}
\endcode

\subsec{Setting font nicknames}

	|\FSELnicknames|
	gives definitions to |\f|, |\m| and |\M| so that expanding the
	template macro defines |\rm| and the like.  If the fontset name
	is |ffff|, and a nickname |xx| is introduced with |\f|, the
	macro |\xx| is defined to |\ffffxx|.  If it is introduced with
	|\m|, then the font table entries  |\textfont\xxfam| and |\scriptfont\xxfam| are also
	set, and |\xx| expands to `|\fam\xxfam \ffffxx|'.  If it is
	introduced with |\M| then |\scriptscriptfont\xxfam| is also set.

	The parameters are |#1| the fontset name, |#2| the fontset name
	for scriptstyle, and |#3| the fontset name for
	scriptscriptstyle.  The implicit fourth parameter is the
	template macro.
\code
        |\def\FSELnicknames#1#2#3{%
        |    \let\@\relax
        |    \def\f##1##2{%
        |       \expcs\edef{##1}{\noexpcs{#1##1}}%
        |    }%
        |    \def\m##1##2{%
        |       \expcs\textfont{##1fam}\csname#1##1\endcsname
        |       \expcs\scriptfont{##1fam}\csname#2##1\endcsname
        |       \expcs\edef{##1}{%
	|           \fam\expcs\noexpand{##1fam}%
	|           \expcs\noexpand{#1##1}%
	|       }%
        |    }%
        |    \def\M##1{%
        |       \expcs\scriptscriptfont{##1fam}\csname#3##1\endcsname
        |       \m{##1}%
        |    }%
        |}
\endcode

\subsec{Setting the baseline skip}
	The second helper macro, |\setbaselineskip|, sets
	|\baselineskip| and a bunch of related paramaters and
	pseudo-parameters like |\smallskipamount|.  It takes one
	parameter, a \<skip>.
\notepar
	My definitions for the skips that go before and after displays
	put less white\-space around displays than is set in plain \TeX.
	This can be changed by redefining this macro in a style file.
\endnotepar
\code
        |\def\setbaselineskip#1{%
        |    \baselineskip#1\relax \normalbaselineskip\baselineskip
        |    \jot0.25\baselineskip
        |    \smallskipamount 0.25\baselineskip plus 0.083\baselineskip
        |       minus 0.083\baselineskip
        |    \medskipamount 0.5\baselineskip plus 0.167\baselineskip
        |       minus 0.167\baselineskip
        |    \bigskipamount 1\baselineskip plus 0.333\baselineskip
        |       minus 0.333\baselineskip
        |    \abovedisplayskip\medskipamount
        |    \abovedisplayshortskip\abovedisplayskip 
        |    \advance\abovedisplayshortskip-1\abovedisplayskip
        |    \belowdisplayskip\medskipamount
        |    \belowdisplayshortskip\smallskipamount
        |}
\endcode

\subsec{Loading maths fonts}
	Finally, we need to force the fonts used in maths at a given
	size to be loaded.  for |\f| fonts this does nothing; for |\m|
	fonts it loads the text and script fonts; for |\M| fonts it also
	loads the scriptscript font.

	This is done the first time this fontset is selected, even if no
	formulas are used (rather than trying to do something
	complicated like use |\everymath|\dots).  Because this macro
	only needs to be used once for each fontset, it finishes by
	redefining |\#1mathfonts| to be the same as |\relax|.
	
	Its parameters are |#1| the fontset name, |#2| the fontset name
	for scriptstyle, and |#3| the fontset name for scriptscriptstyle.
\code
        |\def\FSELloadmaths#1#2#3{%
        |    \let\@\relax \def\f##1##2{}%
        |    \def\m##1##2{\csname#1##1\endcsname \csname#2##1\endcsname}%
        |    \def\M##1{\csname#3##1\endcsname \m{##1}}%
        |    \global\expcs\let{#1mathsfonts}\relax
        |}
\endcode
	
%}}}  making a fontset
%{{{  finishing up
	
\section{Finishing up}
	
	We define |\rmfam|, |\mifam| and |\syfam| as aliases for the
	numbers $0$, $1$ and $2$.  This is so that the maths fonts may
	be included in the font templates without any special
	arrangements.   The names |\itfam|,  |\bffam|, |\ttfam|, and |\slfam| are set in |plain.tex|.
\code
        |\chardef\rmfam=0 \chardef\mifam=1 \chardef\syfam=2
\endcode
	Note that we do not include an alias for the the maths
	extension font's fam number.  This is because there is only
	one maths extension font---|cmex10|---used for all sizes, so it
	does not belong in any fontset.

\section{Summary of user commands}

	The following lists the user commands provided by FSEL.  A
	\<fontset name> is a sequence of letters like |note|;
	\<points> is a \TeX\ \<number> representing size in points
	(without any final |pt|); an \<external name> is the external
	name for a font (e.g., `|cmr12|').

\medskip\hrule\medskip

\begingroup \parindent=0pt

	|\autoloadfonts|

	|\loadfont|\<csname>\arg{\<external name>}

	|\xfontset|\arg{\<fontset name>}\<csname>\arg{\<points>}

	|\fontset|\arg{\<fontset
	name>}\<csname>\arg{\<points>}\arg{\<skip>}\arg{\<fontset
	name>}\arg{\<fontset name>}

	|\def\everyloadfont#1#2{| \dots\ |}|

	|\def\setbaselineskip#1{| \dots\ |}|

\medskip\hrule\medskip

\endgroup

%}}}  finishing up
%{{{  bugs

\section{Bugs}

	FSEL clobbers the macros |\f|, |\m|, |\M| and |\@|.
%}}}  bugs
\endcodefile
\enddocument
\bye
	
%}}} pdcfsel

%Local variables:
%fold-folded-p: t
%fill-prefix: "	"
%End: