summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/font-var.mklx
blob: aeec18054d4ebea1810d86d09e8fe4b9347db163 (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
%D \module
%D   [       file=font-var,
%D        version=2011.01.13, % (copied fron font-ini)
%D          title=\CONTEXT\ Font Macros,
%D       subtitle=Common Variables,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Font Macros / Common Variables}

\unprotect

% some more will move here

%D \macros
%D   {fontstyle,fontalternative,fontsize,fontbody}
%D
%D Within a bodyfont, fonts can come in different sizes. For instance \type {\tf} is
%D accompanied by \type {\tfa}, \type {\tfb} etc. The first two characters denote
%D the alternative, while the third character in these sequences represents the
%D size. The actual size is saved in a macro. The styles, being roman (\type {\rm}),
%D sans serif (\type {\ss}) etc. are also available.

% fontclass       % modern dejavu
% fontbody        % ... 10pt 11pt 12pt ...
% fontstyle       % rm ss tt mm hw cg ...
% fontalternative % tf bf sl it bs bi sc ...
% fontsize        % a b c d ...
% fontface        % 0=normal 1=text 2=script 3=scriptscript 4=x 5=xx (math are temporary)

\mutable\def\normalizedbodyfontsize{12pt}

\immutable\def\defaultfontbody      {\normalizedbodyfontsize}
\immutable\let\defaultfontstyle      \s!rm
\immutable\let\defaultfontalternative\s!tf
\immutable\let\defaultfontface       \!!zerocount

\immutable\lettonothing\defaultfontsize

\mutable\let\fontbody       \defaultfontbody
\mutable\let\fontstyle      \defaultfontstyle
\mutable\let\fontalternative\defaultfontalternative
\mutable\let\fontsize       \defaultfontsize
\mutable\let\fontface       \!!zerocount

\mutable\lettonothing\globalfontclass
\mutable\lettonothing\fontclass

\installmacrostack\fontstyle

% we can use an indirect mapping for fontclasses (map string onto numbers) and indeed this
% is somewhat more efficient but also makes the code messy ... maybe some day ...

\protect \endinput