aboutsummaryrefslogtreecommitdiffstats
path: root/doc/expert/pre_font
blob: f014e73124eac17ac0b24bff3515748dfb868424 (plain) (blame)
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
@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 may appear first or 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
There are two predefined symbols, @@CurrFamily and @@CurrFace, which
respectively return the family and face names of the current font.  For
example, right now @@CurrFamily is @CurrFamily and @@CurrFace is
@CurrFace.
@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