@Section
   @Title { "@Font" and "@Char" }
   @Tag { font }
@Begin
@PP
A @I font
font. @Index { Fonts }
is a collection of characters which may be
printed.  Many fonts come in {@I families},
family @Index { Family of a font }
face @Index { Face of a font }
which are groups of fonts that
have been designed to go together.  For example, the Times family
includes the following fonts:
@ID { Times Base } @Font {
    Base      @Font { Times Base }
//1vx Slope     @Font { Times Slope }
//1vx Bold       @Font { Times Bold }
//1vx BoldSlope @Font { Times BoldSlope }
}
Thus, each font has two names: its @I { family name } (Times,
Helvetica, etc.) and its @I { face name } (Base, Slope, etc.).  Times
Base is more commonly called Times Roman, and Times Slope is more
commonly called Times Italic.  Lout avoids these names in favour of
generic names which can be applied to many font families.
@PP
Ligatures,
ligatures @Index Ligatures
kerning @Index Kerning
such as fl for {@OneCol f}l and fi for {@OneCol f}i, are considered by
Basser Lout to be an integral part of the font:  if the font definition
(see below) mentions them, they will be used.  Similarly, kerning (fine
adjustment of the space between adjacent characters to improve the
appearance) is done whenever indicated in the font definition.  Enclosing
one of the letters in @@OneCol is one sure way to disable a ligature or kern.
@PP
The @@Font symbol
font.sym @Index { @@Font symbol }
returns its right parameter in a font and size specified by its left:
@ID {
@Code "{ Times Base 12p } @Font"  @I object
}
The family and face names must have appeared together in a {@Code fontdef};
the size is arbitrary and may be given in any one of the {@Code "c"},
{@Code "i"}, {@Code "p"}, {@Code "m"}, {@Code "f"}, {@Code "s"}, and
{@Code "v"} units of measurement (Section {@NumberOf concatenation}),
although @Code 10p and @Code 12p are the most common sizes for text.  There
may be empty objects and @@Null objects in the left parameter of @@Font;
these are ignored.
@PP
When a @@Font symbol is nested inside the right parameter of
another @@Font symbol, the inner one determines the font of its
own right parameter.  However, it may be abbreviated so as to inherit
part of the outer symbol:
@ID @Code {
"{ Times Base 12p } @Font"
"{ hello, Slope @Font hello, 15p @Font hello }"
}
has result
@ID {
{ Times Base 12p } @Font
{ hello, Slope @Font hello, 15p @Font hello }
}
The first inner @@Font inherits the outer family and size, changing only
the face; the second inherits the outer family and face.  When a family
name is given, it must be followed immediately by a face name.  A size
change always comes last.
@PP
Sizes of the form +{@I length} and --{@I length} may also be used,
meaning that the font size is to be @I length larger or smaller than
the inherited value.  For example, --{@Code "2p"} is often used for
superscripts and subscripts.  These forms are highly recommended, since
they don't need to be changed if a decision is made to alter the font
size of the document as a whole.
@PP
The @@Font symbol also switches to and from small capitals:
"smallcaps" @Index { small capitals }
@ID @Code {
"smallcaps @Font ..."
"nosmallcaps @Font ..."
}
These may be nested, and they cooperate with other font changes.  The
precise effect depends on the font (see below).  There is a default
value (@Code {"nosmallcaps"}), so it is not necessary to mention this
attribute when giving an initial font.
@PP
When Lout runs, the first thing it reads is a list of font definitions,
font.def @Index { @Code fontdef }
like these:
@ID {
    @Code "fontdef  Times  Base   {"  @I implementation-dependent  @Code "}"
//1vx @Code "fontdef  Times  Slope  {"  @I implementation-dependent  @Code "}"
}
Each line tells Lout of the existence of a font, and assigns it a family
name and a face name.  There are a few fonts which are the only members
of their families; even though these fonts do not need a face name, they
must be given one by their {@Code fontdef}.  The part between braces may
vary with different implementations of Lout; it is supposed to contain
the information Lout needs to work with the font.
@PP
In Basser Lout Version 3, this implementation-dependent part consists of
a PostScript font name, an
adobe @Index { Adobe Systems, Inc. }
Adobe font metrics (formerly AFM) file whose FontName entry must agree
with the PostScript font name just mentioned, the name of a Lout
Character Mapping (LCM) file, and the word @Code Recode or {@Code NoRecode}:
@ID @Code
"fontdef  Times  Base  {  Times-Roman  Ti-Ro  LtLatin1.LCM  Recode }"
It seems to have become an invariable rule at Adobe Systems that the font
name and the file name should be the same, but some operating systems do
not permit such long file names, so Lout does not use them.  The files are
searched for in standard places.  Consult the PostScript Reference Manual
@Cite { $adobe1990ps } for general information about fonts and encoding
vectors; briefly, an 8-bit
lcm. @Index { LCM file }
character code @I c in Lout's input is mapped to the character in the
Adobe font metrics file whose name appears on the line labelled @I c in the
LCM file.  The LCM file also defines various character-to-character
mappings, such as upper-case to lower-case, which are used for various
purposes, such as the production of small capitals.  If the word
@Code NoRecode appears, Lout assumes that the given encoding vector is
already associated with this font in the PostScript interpreter, and
optimizes its output accordingly.
@PP
If there are two font definitions with the same family and face name,
it is an error unless the second one has the same font name and file name
as the first, in which case it is silently ignored.  A PostScript font
name and file may appear in two or more font definitions, allowing one
PostScript font to have two or more equally valid Lout names, and
different LCM files.
@PP
The @@Char symbol
char @Index { @@Char symbol }
allows a character to be specified by its name (its PostScript name in
Basser Lout) rather than by its code:
@ID @Code "@Char  nine"
is equivalent to @Code "9" in most fonts.  This is useful as a
documentation aid and to be sure of getting the right character even if the
encoding vector of the font is changed.  However @@Char will fail if the
character named is not in the encoding vector of the current font.
@End @Section
