summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/font-lib.mklx
blob: f7342c7d41fff9a0386297311ad0fb585808b62a (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
%D \module
%D   [       file=font-lib,
%D        version=2011.01.13, % (copied fron font-ini)
%D          title=\CONTEXT\ Font Macros,
%D       subtitle=Libraries,
%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 / Libraries}

\unprotect

\registerctxluafile{font-ini}{autosuffix}
\registerctxluafile{font-log}{}
\registerctxluafile{font-con}{autosuffix} % kind of early
%registerctxluafile{font-cft}{}
\registerctxluafile{font-enc}{}
\registerctxluafile{font-fmp}{autosuffix}
\registerctxluafile{font-agl}{}           % if needed we can comment this and delay loading
\registerctxluafile{font-cid}{}           % cid maps
\registerctxluafile{font-map}{optimize}

% helpers

\registerctxluafile{font-otr}{optimize}   % opentype fontloader
\registerctxluafile{font-web}{}           % opentype fontloader
\registerctxluafile{font-cff}{optimize}   % quadratic outlines
\registerctxluafile{font-ttf}{optimize}   % cubic outlines
\registerctxluafile{font-dsp}{optimize}   % ... for this one
\registerctxluafile{font-hsh}{autosuffix} % hashes used by context
\registerctxluafile{font-vir}{}
\registerctxluafile{font-vfc}{autosuffix}
\registerctxluafile{font-prv}{}           % needs hashes
\registerctxluafile{font-nod}{optimize}
\registerctxluafile{font-oti}{}           % otf initialization
\registerctxluafile{font-ott}{}           % otf tables (first)
\registerctxluafile{font-otl}{autosuffix}
\registerctxluafile{font-oto}{}
\registerctxluafile{font-otj}{autosuffix,optimize}
\registerctxluafile{font-oup}{}
\registerctxluafile{font-ota}{autosuffix}
%registerctxluafile{font-ots-pre-scale}{autosuffix,optimize}
\registerctxluafile{font-ots}{autosuffix,optimize}
\registerctxluafile{font-otd}{autosuffix,optimize}
\registerctxluafile{font-otc}{}
\registerctxluafile{font-oth}{}
% \doifelsefileexists{font-osd-new.lmt}{
%     \registerctxluafile{font-osd-new}{autosuffix}
% } {
    \registerctxluafile{font-osd}{}
% }
%registerctxluafile{font-osm}{}
\registerctxluafile{font-ogr}{autosuffix}

% we use otf code for type one

\registerctxluafile{font-onr}{optimize}
\registerctxluafile{font-one}{autosuffix,optimize}
\registerctxluafile{font-afk}{}

\registerctxluafile{font-txt}{autosuffix}

% tfm

\registerctxluafile{font-tpk}{autosuffix,optimize}
\registerctxluafile{font-tfm}{autosuffix}

% name database

\registerctxluafile{font-syn}{}
\registerctxluafile{font-trt}{}

% shapes

\registerctxluafile{font-shp}{}

% so far

\registerctxluafile{font-pat}{} % patchers

\registerctxluafile{node-fnt}{autosuffix} % here

\registerctxluafile{font-mps}{autosuffix} % outline fun

\registerctxluafile{font-lua}{}

\registerctxluafile{font-enh}{autosuffix}

\registerctxluafile{good-ini}{}
\registerctxluafile{good-gen}{autosuffix}
\registerctxluafile{good-ctx}{}
\registerctxluafile{good-mth}{autosuffix}

\registerctxluafile{font-def}{autosuffix}
\registerctxluafile{font-ctx}{autosuffix} % after def as it overloads

% extensions, order matters

\registerctxluafile{font-imp-checks}{autosuffix}
\registerctxluafile{font-imp-ligatures}{autosuffix}
\registerctxluafile{font-imp-tex}{}
\registerctxluafile{font-imp-reorder}{}
\registerctxluafile{font-imp-properties}{autosuffix}
\registerctxluafile{font-imp-unicode}{}
\registerctxluafile{font-imp-text}{autosuffix}
\registerctxluafile{font-imp-math}{autosuffix}
\registerctxluafile{font-imp-notused}{}
\registerctxluafile{font-imp-effects}{autosuffix}
\registerctxluafile{font-imp-quality}{autosuffix}
\registerctxluafile{font-imp-italics}{}
\registerctxluafile{font-imp-dimensions}{}
\registerctxluafile{font-imp-spacekerns}{}
\registerctxluafile{font-imp-tweaks}{}
\registerctxluafile{font-imp-combining}{}
\registerctxluafile{font-imp-scripts}{autosuffix}
\registerctxluafile{font-imp-sanitize}{autosuffix} % fixes for indic fonts
\registerctxluafile{font-imp-digits}{autosuffix}

\registerctxluafile{font-imp-tracing}{autosuffix} % comes last!

\registerctxluafile{font-fbk}{autosuffix}

\registerctxluafile{font-aux}{}

\registerctxluafile{font-lig}{} % only for experiments so try to avoid it

%D Some low level helpers
%D
%D \starttyping
%D \def\TestLookup#specification%
%D   {\dolookupfontbyspec{#specification}
%D     pattern: #specification, found: \dolookupnoffound
%D    \blank
%D    \dorecurse {\dolookupnoffound} {%
%D      \recurselevel:~\dolookupgetkeyofindex{fontname}{\recurselevel}\quad
%D    }%
%D    \blank}
%D
%D \TestLookup{familyname=helveticaneue}
%D \TestLookup{familyname=helveticaneue,weight=bold}
%D \TestLookup{familyname=helveticaneue,weight=bold,style=italic}
%D \stoptyping

%D We can also move the lookups to the fonts.namespace (of commands) one can also
%D directly use the clf calls when speed is needed.

% todo: public implementors:

\permanent          \def\dolookupfontbyspec     #1{\clf_fontlookupinitialize{#1}}
\permanent          \def\dolookupnoffound         {\clf_fontlookupnoffound}
\permanent          \def\dolookupgetkeyofindex#1#2{\clf_fontlookupgetkeyofindex{#1}\numexpr#2\relax}
\permanent          \def\dolookupgetkey         #1{\clf_fontlookupgetkey{#1}}
\permanent          \def\cleanfontname          #1{\clf_cleanfontname{#1}}
\permanent\protected\def\setfontofid            #1{\clf_setfontofid\numexpr#1\relax}

%D I have to put it someplace, so here:
%D
%D \starttyping
%D     \definefontfeature[test][mode=plug,features=text]
%D     \definefont[FontA][Serif*test]
%D     \definefont[FontB][Serif*test]
%D     {\FontA aaa}{\FontB\glyphscale 1200  bbb}
%D     {\FontA aaa}{\FontB\glyphscale 1200  bbb}
%D \stoptyping

\protect \endinput