ma-cb-en-fonts.tex /size: 7909 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-fonts
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=Fonts and font switches]
8
9\startsection[title=Introduction]
10
11\index{Computer Modern Roman}
12\index{Lucida Bright}
13\index{AMS}
14
15The default font in \CONTEXT\ is the {\em Computer Modern Roman} (\type{cmr}).
16In \CONTEXT\ the following fonts are available.
17
18\startplacetable[reference=tab:fonts in context,title={Fonts in \CONTEXT.}]
19\starttable[|l|l|l|]
20\HL
21\NC \bf Name              \NC \bf Logical name \NC \bf Also known as     \NC\MR
22\HL
23\NC Computer Modern Roman \NC cmr              \NC Computer Modern Roman \NC\FR
24\NC Termes                \NC termes           \NC Times New Roman       \NC\MR
25\NC Adventor              \NC adventor         \NC Avant Garde           \NC\MR
26\NC Bonum                 \NC bonum            \NC Bookman               \NC\MR
27\NC Chorus                \NC chorus           \NC Zapf Chancery         \NC\MR
28\NC Cursor                \NC cursor           \NC Courier               \NC\MR
29\NC Heros                 \NC heros            \NC Helvetica             \NC\MR
30\NC Pagella               \NC pagella          \NC Palatino              \NC\MR
31\NC Schola                \NC schola           \NC Century Schoolbook    \NC\MR
32\NC Dejavu                \NC dejavu           \NC                       \NC\MR
33\NC Iwona                 \NC iwona            \NC                       \NC\MR
34\NC Gentium               \NC gentium          \NC                       \NC\MR
35\NC Cambria               \NC cambria          \NC                       \NC\MR
36\NC Antykwa               \NC antykwa          \NC                       \NC\MR
37\NC Utopia                \NC utopia           \NC                       \NC\MR
38\NC LucidaBright          \NC lucidanova       \NC                       \NC\LR
39\HL
40\stoptable
41\stopplacetable
42
43% in map: tex-context\tex\texmf\fonts
44
45For further reading we refer to the \goto {\em Fonts in \CONTEXT}
46[ url (manual:fonts) ] manual where you can find information on how to install 
47your own font.
48
49\stopsection
50
51\startsection[title=Fontstyle and size]
52
53\index{font+style}
54\index{font+size}
55
56\Command{\tex{setupbodyfont}}
57\Command{\tex{switchtobodyfont}}
58
59You can select the font family, style and size for a document with:
60
61\shortsetup{setupbodyfont}
62
63If you typed \type{\setupbodyfont[chorus,9pt]} {\switchtobodyfont[chorus,9pt] in
64the setup area of the input file your text would look something like this.}
65
66For changes in mid-document and on section level you should use:
67
68\shortsetup{switchtobodyfont}
69
70\startbuffer
71On November 10th (one day before Saint Martinsday) the youth of
72Hasselt go from door to door to sing a special song and they
73accompany themselves on a {\em foekepot}. They won't leave
74before you give them some money or sweets. The song goes like this:
75
76\startnarrower
77\switchtobodyfont[heros,small]
78\startlines
79Foekepotterij, foekepotterij,
80Geef mij een centje dan ga'k voorbij.
81Geef mij een alfje dan blijf ik staan,
82'k Zal nog liever naar m'n arrenmoeder gaan.
83Hier woont zo'n rieke man, die zo vulle gèven kan.
84Gèf wat, old wat, gèf die arme stumpers wat,
85'k Eb zo lange met de foekepot elopen.
86'k Eb gien geld om brood te kopen.
87Foekepotterij, foekepotterij,
88Geef mij een centje dan ga'k voorbij.
89\stoplines
90\stopnarrower
91\stopbuffer
92
93\typebuffer
94
95Notice that \type{\start...\stopnarrower} is also used as a begin and end of the
96fontswitch. The function of \type{\start...\stoplines} in this example is
97obvious.
98
99\start
100\getbuffer
101\stop
102
103If you want an overview of the available font family you can type:
104
105\startbuffer
106\showbodyfont[pagella]
107\stopbuffer
108
109\typebuffer
110
111\getbuffer
112
113\stopsection
114
115\startsection[title=Style and size switch in commands]
116
117In a number of commands one of the parameters is \type{style} to indicate the
118desired typestyle. For example:
119
120\startbuffer
121\setuphead[chapter][style=\tfd]
122\stopbuffer
123
124\typebuffer
125
126In this case the character size for chapters is indicated with a command
127\type{\tfd}. But instead of a command you could use the predefined options that
128are related to the actual typeface:
129
130\startbuffer
131normal  bold  slanted  boldslanted  type  mediaeval
132small  smallbold  smallslanted  smallboldslanted smalltype
133capital cap
134\stopbuffer
135
136\typebuffer
137
138\stopsection
139
140\startsection[title=Local font style and size]
141
142\Command{\tex{rm}}
143\Command{\tex{ss}}
144\Command{\tex{tt}}
145\Command{\tex{sl}}
146\Command{\tex{bf}}
147\Command{\tex{tfa}}
148\Command{\tex{tfb}}
149\Command{\tex{tfc}}
150\Command{\tex{tfd}}
151
152In the running text (local) you can change the {\em typestyle} into roman, sans
153serif and teletype with \type{\rm}, \type{\ss} and \type{\tt}.
154
155You can change the {\em typeface} like italic and boldface with \type{\sl} and
156\type{\bf}.
157
158The {\em typesize} is changed with \type{\switchtobodyfont}.
159
160The actual style is indicated with \type{\tf}. If you want to change into a
161somewhat greater size you can type \type{\tfa}, \type{\tfb}, \type{\tfc} and
162\type{\tfd}. An addition of \type{a}, \type{b}, \type{c} and \type{d} to
163\type{\sl}, \type{\it} and \type{\bf} is also allowed.
164
165\startbuffer
166{\tfc Mintage}
167
168In the period from {\tt 1404} till {\tt 1585} Hasselt had its own
169{\sl right of coinage}. This right was challenged by other cities,
170but the {\switchtobodyfont[7pt] bishops of Utrecht} did not honour
171these {\slb protests}.
172\stopbuffer
173
174\typebuffer
175
176The curly braces indicate begin and end of style or size switches.
177
178\getbuffer
179
180\stopsection
181
182\startsection[title=Redefining fontsize]
183
184\index{fontsize}
185
186\Command{\tex{definebodyfont}}
187
188For special purposes you can define your own size of the bodyfont.
189
190\shortsetup{definebodyfont}
191
192A definition could look like this:
193
194\startbuffer
195\definebodyfont[10pt][rm][tfe=Regular at 36pt]
196
197{\tfe Hasselt!}
198\stopbuffer
199
200\typebuffer
201
202Now \type{\tfe} will produce 36pt characters saying:
203{\hbox{\getbuffer}}
204
205\stopsection
206
207\startsection[title=Small caps]
208
209\index{small caps}
210
211\Command{\tex{cap}}
212
213Abbreviations like \PDF\ (\infull{PDF}) are printed in pseudo small caps. A small
214capital is somewhat smaller than the capital of the actual typeface. Pseudo small
215caps are produced with:
216
217\shortsetup{cap}
218
219If you compare \type{\cap{hasselt}} and \type{\sc hasselt}: \cap{hasselt} and
220{\sc hasselt} you can see the difference. The command \type{\sc} shows the real
221small caps. The reason for using pseudo small caps instead of real small caps is
222just a matter of taste.
223
224\stopsection
225
226\startsection[title=Emphasized]
227
228\index{emphasized}
229
230\Command{\tex{em}}
231
232To emphasize words consistently throughout your document
233you use:
234
235\starttyping
236\em
237\stoptyping
238
239Empasized words appear in a slanted style.
240
241\startbuffer
242If you walk through Hasselt you should {\bf \em watch out} for
243{\em Amsterdammers}. An {\em Amsterdammer} is {\bf \em not} a
244person from Amsterdam but a little stone pillar used to separate
245sidewalk and road. A pedestrian should be protected by these
246{\em Amsterdammers} against cars but more often people get hurt
247from tripping over them.
248\stopbuffer
249
250\typebuffer
251
252This becomes:
253
254\getbuffer
255
256{\em An emphasize within an emphasize is {\em normal} again
257and a boldface emphasize looks like {\bf this or \em this}}.
258
259\stopsection
260
261\startsection[title=Teletype / verbatim]
262
263\index{type}
264\index{verbatim}
265
266\Command{\tex{starttyping}}
267\Command{\tex{type}}
268\Command{\tex{setuptyping}}
269\Command{\tex{setuptype}}
270
271If you want to display typed text and want to keep your line breaking exactly as
272it is you use:
273
274\shortsetup{starttyping}
275
276In the text you can use:
277
278\shortsetup{type}
279
280The curly braces enclose the text you want in teletype. You have to be careful
281with \type{\type} because the line breaking mechanism does not work anymore.
282
283You can set up the 'typing' with:
284
285\shortsetup{setuptyping}
286\shortsetup{setuptype}
287
288\stopsection
289
290\startsection[title=Encodings]
291
292In \CONTEXT\ \MKIV\ font ecoding is no issue (anymore).
293
294\stopsection
295
296\stopchapter
297
298\stopcomponent
299
300