font-fil.mklx /size: 19 Kb    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=font-fil,
3
%D version=2011.01.13, % (copied fron font-ini)
4
%D title=\CONTEXT\ Font Macros,
5
%D subtitle=Classes and Files,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\writestatus
{
loading
}{
ConTeXt
Font
Macros
/
Classes
and
Files
}
15 16
\unprotect
17 18
%D Personally I think that using \TEX\ macro packages is complicated by the way
19
%D fonts are handled. Apart from the many encodings, we also deal with different
20
%D naming schemes. Confronted with this problem, I decided to change the definitions
21
%D into:
22
%D
23
%D \starttyping
24
%D \definebodyfont [12pt] [rm] [tf=Times-Roman at 12pt]
25
%D \stoptyping
26
%D
27
%D combined with for instance:
28
%D
29
%D \starttyping
30
%D \definefontsynonym [Times-Roman] [tir]
31
%D \stoptyping
32 33
% \definetypeface[palatino][rm][serif][palatino,allbold][default]
34
%
35
% \startfontclass[palatino]
36
% \definefontsynonym [Serif] [SerifBold]
37
% \definefontsynonym [SerifItalic] [SerifBoldItalic]
38
% \definefontsynonym [SerifSlanted] [SerifBoldSlanted]
39
% \definefontsynonym [SerifCaps] [SerifBold]
40
% \stopfontclass
41
%
42
% \setupbodyfont[palatino]
43 44
\unexpanded
\def
\startfontclass
45
{
\dosingleempty
\font_basics_start_font_class
}
46 47
\def
\font_basics_start_font_class
[#
class
]
%
48
{
\push_macro_fontclass
49
\doifelse
{
#
class
}
\v!each
50
{
\let
\fontclass
\empty
}
51
{
\doifsomething
{
#
class
}{
\def
\fontclass
{
#
class
}}}}
52 53
\unexpanded
\def
\stopfontclass
54
{
\pop_macro_fontclass
}
55 56
\def
\classfont
#
class
#
name
{
#
class
#
name
}
% \definefont[whatever][\classfont{xx}{yy} at 10pt]
57 58
%D \macros
59
%D {definefontsynonym, doifelsefontsynonym,
60
%D expandfontsynonym, truefontname, truefontdata}
61
%D
62
%D While looking for fonts, fontsynonyms are used for accessing
63
%D the files!
64
%D
65
%D \starttyping
66
%D \definefontsynonym[Serif][Lucida-Bright]
67
%D \definefontsynonym[Lucida-Bright][lbr][encoding=texnansi]
68
%D \stoptyping
69 70
\installcorenamespace
{
fontfile
}
% file synonyms
71 72
\let
\m_font_name
\empty
73
\let
\m_font_file
\empty
74 75
\def
\defaultfontfile
{
\truefontname
{
Normal
}}
% was cmtt10, but that one is gone
76
\edef
\nullfontname
{
\fontname\nullfont
}
77 78
\unexpanded
\def
\definefontsynonym
[#
name
]#
crap
[#
file
]
%
79
{
\edef
\m_font_name
{
#
name
}
%
80
\edef
\m_font_file
{
#
file
}
%
81
\ifempty
\fontclass
82
\expandafter
\font_basics_define_font_synonym_nop
83
\else
84
\expandafter
\font_basics_define_font_synonym_yes
85
\fi
}
86 87
\unexpanded
\def
\font_basics_define_font_synonym_nop
88
{
\expandafter\let\csname
\??fontfile
\m_font_name
\endcsname
\m_font_file
89
\doifelsenextoptionalcs
\font_basics_define_font_synonym_nop_opt
\font_basics_define_font_synonym_nop_nil
}
90 91
\unexpanded
\def
\font_basics_define_font_synonym_yes
92
{
\expandafter\let\csname
\??fontfile
\fontclass
\m_font_name
\endcsname
\m_font_file
93
\doifelsenextoptionalcs
\font_basics_define_font_synonym_yes_opt
\font_basics_define_font_synonym_yes_nil
}
94 95
\unexpanded
\def
\edefinefontsynonym
[#
name
]#
ignore
[#
file
]
%
96
{
\edef
\m_font_name
{
#
name
}
%
97
\edef
\m_font_file
{
#
file
}
%
98
\ifempty
\fontclass
99
\expandafter
\font_basics_define_font_synonym_nop_expanded
100
\else
101
\expandafter
\font_basics_define_font_synonym_yes_expanded
102
\fi
}
103 104
\unexpanded
\def
\font_basics_define_font_synonym_nop_expanded
#
ignore
[#
spec
]
%
105
{
\expandafter\let\csname
\??fontfile
\m_font_name
\endcsname
\m_font_file
106
\normalexpanded
{
\font_basics_define_font_synonym_nop_opt
[#
spec
]
}}
107 108
\unexpanded
\def
\font_basics_define_font_synonym_yes_expanded
#
ignore
[#
spec
]
%
109
{
\expandafter\let\csname
\??fontfile
\fontclass
\m_font_name
\endcsname
\m_font_file
110
\normalexpanded
{
\font_basics_define_font_synonym_yes_opt
[#
spec
]
}}
111 112
% \unexpanded\def\font_basics_define_font_synonym_nop_opt[#specification]%
113
% {\let\p_features \undefined
114
% \let\p_fallbacks \undefined
115
% \let\p_goodies \undefined
116
% \let\p_designsize\undefined
117
% \expandafter\font_basics_get_font_parameter_nop#specification,]=,}
118
%
119
% \unexpanded\def\font_basics_define_font_synonym_yes_opt[#specification]%
120
% {\let\p_features \undefined
121
% \let\p_fallbacks \undefined
122
% \let\p_goodies \undefined
123
% \let\p_designsize\undefined
124
% \expandafter\font_basics_get_font_parameter_yes#specification,]=,}
125
%
126
% % todo: check if we can use \edef but then we need to protect \mathsizesuffix .. in fact that
127
% % can be default then: \let\mathsizesuffix\relax .. i need to play with it first
128
%
129
% \def\font_basics_get_font_parameter_nop#key=#value,%
130
% {\if]#key%
131
% \font_basics_get_font_parameter_nop_finish
132
% \else
133
% \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
134
% \expandafter\font_basics_get_font_parameter_nop
135
% \fi}
136
%
137
% \def\font_basics_get_font_parameter_yes#key=#value,%
138
% {\if]#key%
139
% \font_basics_get_font_parameter_yes_finish
140
% \else
141
% \expandafter\normaldef\csname p_#key\endcsname{#value}% % no edef as we need to keep \mathsizesuffix
142
% \expandafter\font_basics_get_font_parameter_yes
143
% \fi}
144 145
\unexpanded
\def
\font_basics_define_font_synonym_nop_opt
[#
specification
]
%
146
{
\let
\p_features
\undefined
147
\let
\p_fallbacks
\undefined
148
\let
\p_goodies
\undefined
149
\let
\p_designsize
\undefined
150
\expandafter
\font_basics_get_font_parameter_nop
#
specification
,
\ignorearguments
}
151 152
\unexpanded
\def
\font_basics_define_font_synonym_yes_opt
[#
specification
]
%
153
{
\let
\p_features
\undefined
154
\let
\p_fallbacks
\undefined
155
\let
\p_goodies
\undefined
156
\let
\p_designsize
\undefined
157
\expandafter
\font_basics_get_font_parameter_yes
#
specification
,
\ignorearguments
}
158 159
% todo: check if we can use \edef but then we need to protect \mathsizesuffix .. in fact that
160
% can be default then: \let\mathsizesuffix\relax .. i need to play with it first
161 162
\def
\font_basics_get_font_parameter_nop
#
key
=#
value
,
%
163
{
\ifarguments
164
\font_basics_get_font_parameter_nop_finish
165
\else
166
\expandafter\normaldef\csname
p
_
#
key
\endcsname
{
#
value
}
% % no edef as we need to keep \mathsizesuffix
167
\expandafter
\font_basics_get_font_parameter_nop
168
\fi
}
169 170
\def
\font_basics_get_font_parameter_yes
#
key
=#
value
,
%
171
{
\ifarguments
172
\font_basics_get_font_parameter_yes_finish
173
\else
174
\expandafter\normaldef\csname
p
_
#
key
\endcsname
{
#
value
}
% % no edef as we need to keep \mathsizesuffix
175
\expandafter
\font_basics_get_font_parameter_yes
176
\fi
}
177 178
% helpers, some day these will be toks and counts
179 180
% \def\fntsetdefname {\glet\somefontname\defaultfontfile}
181
% \def\fntsetsomename{\gdef\somefontname} % takes argument
182
% \def\fntsetnopsize {\let\somefontsize\empty}
183
% \def\fntsetsomesize{\def\somefontsize} % takes argument
184 185
% happens later, else mkvi parsing gets into troubles
186 187
% end of helpers
188 189
% we could collect them in one macro (but no expansion)
190 191
\def
\font_basics_define_font_synonym_nop_nil
192
{
\expandafter\let\csname
\??fontfile
\m_font_name
\s!features
\endcsname
\undefined
193
\expandafter\let\csname
\??fontfile
\m_font_name
\s!fallbacks
\endcsname
\undefined
194
\expandafter\let\csname
\??fontfile
\m_font_name
\s!goodies
\endcsname
\undefined
195
\expandafter\let\csname
\??fontfile
\m_font_name
\s!designsize
\endcsname
\undefined
}
196 197
\def
\font_basics_define_font_synonym_yes_nil
198
{
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!features
\endcsname
\undefined
199
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!fallbacks
\endcsname
\undefined
200
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!goodies
\endcsname
\undefined
201
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!designsize
\endcsname
\undefined
}
202 203
\def
\font_basics_get_font_parameter_nop_finish
204
{
\expandafter\let\csname
\??fontfile
\m_font_name
\s!features
\endcsname
\p_features
205
\expandafter\let\csname
\??fontfile
\m_font_name
\s!fallbacks
\endcsname
\p_fallbacks
206
\expandafter\let\csname
\??fontfile
\m_font_name
\s!goodies
\endcsname
\p_goodies
207
\expandafter\let\csname
\??fontfile
\m_font_name
\s!designsize
\endcsname
\p_designsize
}
208 209
\def
\font_basics_get_font_parameter_yes_finish
210
{
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!features
\endcsname
\p_features
211
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!fallbacks
\endcsname
\p_fallbacks
212
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!goodies
\endcsname
\p_goodies
213
\expandafter
\glet
\csname
\??fontfile
\fontclass
\m_font_name
\s!designsize
\endcsname
\p_designsize
}
214 215
%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
216
%
217
%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
218 219
\unexpanded
\def
\defineclassfontsynonym
220
{
\dotripleargument
\font_basics_define_class_font_synonym
}
221 222
%\definefontsynonym[#tag][\fontclassname{#class}{#fileortag}]}
223 224
\def
\font_basics_define_class_font_synonym
[#
tag
][#
class
][#
fileortag
]
% needs testing
225
{
\expandafter\normaldef\csname
\??fontfile
\fontclass
#
tag
\endcsname
{
\fontclassname
{
#
class
}{
#
fileortag
}}
%
226
\font_basics_define_font_synonym_yes_nil
}
227 228
\let
\definefontfile\definefontsynonym
% dedicated to Taco Hoekwater
229 230
\unexpanded
\def
\setupfontsynonym
231
{
\dodoubleempty
\dosetupfontsynonym
}
232 233
\def
\dosetupfontsynonym
[#
name
][#
settings
]
% not yet supported, will do when needed
234
{}
235 236
% todo: replace * by ... less messy with features
237 238
% \def\truefontname#name%
239
% {\expandafter\font_helpers_true_fontname#name*\empty*\relax}
240
%
241
% \def\font_helpers_true_fontname#name*#first#rest*#crap\relax
242
% {\ifcsname\??fontfile\fontclass#name\endcsname
243
% \ifempty#first%
244
% \expandafter\truefontname\lastnamedcs
245
% \else
246
% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
247
% \fi
248
% \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
249
% \ifempty#first%
250
% \expandafter\truefontname\lastnamedcs
251
% \else
252
% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
253
% \fi
254
% \orelse\ifcsname\??fontfile#name\endcsname
255
% \ifempty#first%
256
% \expandafter\truefontname\lastnamedcs
257
% \else
258
% \expandafter\font_helpers_true_fontname_check\lastnamedcs*#first#rest%
259
% \fi
260
% \else
261
% #name\ifempty#first\else*#first#rest\fi
262
% \fi}
263
%
264
% \def\font_helpers_true_fontname_check#name%
265
% {\expandafter\font_helpers_true_fontname_check_indeed#name*\relax}
266
%
267
% \def\font_helpers_true_fontname_check_indeed#name*#crap\relax
268
% {\ifcsname\??fontfile\fontclass#name\endcsname
269
% \expandafter\font_helpers_true_fontname_check\lastnamedcs
270
% \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
271
% \expandafter\font_helpers_true_fontname_check\lastnamedcs
272
% \orelse\ifcsname\??fontfile#name\endcsname
273
% \expandafter\font_helpers_true_fontname_check\lastnamedcs
274
% \else
275
% #name%
276
% \fi}
277 278
\def
\truefontname
#
name
%
279
{
\expandafter
\font_helpers_true_fontname
#
name
*
\empty
*
\relax
}
280 281
\def
\font_helpers_true_fontname
#
name
*
#
first
#
rest
*
#
ignore
\relax
282
{
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
283
\ifempty
#
first
%
284
\expandafter
\truefontname
\lastnamedcs
285
\else
286
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
*
#
first
#
rest
%
287
\fi
288
\orelse\ifcsname
\??fontfile
\defaultfontclass
#
name
\endcsname
289
\ifempty
#
first
%
290
\expandafter
\truefontname
\lastnamedcs
291
\else
292
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
*
#
first
#
rest
%
293
\fi
294
\orelse\ifcsname
\??fontfile
#
name
\endcsname
295
\ifempty
#
first
%
296
\expandafter
\truefontname
\lastnamedcs
297
\else
298
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
*
#
first
#
rest
%
299
\fi
300
\else
301
#
name
\ifempty
#
first
\else
*
#
first
#
rest
\fi
302
\fi
}
303 304
\def
\font_helpers_true_fontname_check
#
name
%
305
{
\expandafter
\font_helpers_true_fontname_check_indeed
#
name
*
\relax
}
306 307
\def
\font_helpers_true_fontname_check_indeed
#
name
*
#
ignore
\relax
308
{
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
309
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
310
\orelse\ifcsname
\??fontfile
\defaultfontclass
#
name
\endcsname
311
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
312
\orelse\ifcsname
\??fontfile
#
name
\endcsname
313
\expandafter
\font_helpers_true_fontname_check
\lastnamedcs
314
\else
315
#
name
%
316
\fi
}
317 318
% ok when the last lookup is not stripped .. we need to be able to define synonyms for symbols
319
%
320
% \def\truefontname#name%
321
% %{\normalexpanded{\noexpand\font_helpers_true_fontname{\clf_truefontname{#name}}}}
322
% {\expandafter\expandafter\expandafter\font_helpers_true_fontname\expandafter\expandafter\expandafter{\clf_truefontname{#name}}}
323
%
324
% \def\font_helpers_true_fontname#name%
325
% {\ifcsname\??fontfile\fontclass#name\endcsname
326
% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
327
% \orelse\ifcsname\??fontfile\defaultfontclass#name\endcsname
328
% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
329
% \orelse\ifcsname\??fontfile#name\endcsname
330
% \expandafter\font_helpers_true_fontname\expandafter{\lastnamedcs}%
331
% \else
332
% % \clf_truefontname{#name}%
333
% #name% so the last one can have features !
334
% \fi}
335 336
\def
\expandfontsynonym
#
command
#
name
% one level expansion
337
{
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
338
\expandafter\normaldef\expandafter
#
command
\expandafter
{
\lastnamedcs
}
%
339
\orelse\ifcsname
\??fontfile
\defaultfontclass
#
2
\endcsname
340
\expandafter\normaldef\expandafter
#
command
\expandafter
{
\lastnamedcs
}
%
341
\fi
}
342 343
\def
\doifelsefontsynonym
#
name
%
344
{
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
345
\expandafter
\firstoftwoarguments
346
\orelse\ifcsname
\??fontfile
\defaultfontclass
#
name
\endcsname
347
\expandafter
\firstoftwoarguments
348
\else
349
\expandafter
\secondoftwoarguments
350
\fi
}
351 352
\let
\doiffontsynonymelse\doifelsefontsynonym
353 354
%D \macros
355
%D {tracedfontname}
356
%D
357
%D A goody:
358 359
\def
\tracedfontname
#
name
%
360
{
#
name
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
361
%\expandafter\tracedfontname\csname\??fontfile\fontclass#name\endcsname
362
\expandafter
\tracedfontname
\lastnamedcs
363
\orelse\ifcsname
\??fontfile
#
name
\endcsname
364
%\expandafter\tracedfontname\csname\??fontfile#name\endcsname
365
\expandafter
\tracedfontname
\lastnamedcs
366
\fi
}
367 368
%D \macros
369
%D {fontclass, defaultfontclass}
370
%D
371
%D The fontclass model was introduced a while after we implement the basic font
372
%D model and at that time we still defaulted to no model at all. Nowadays we default
373
%D to the \type {modern} fontclass.
374 375
\let
\fontclass
\empty
376
\let
\defaultfontclass
\empty
377 378
\def
\fontclassname
#
class
#
name
% tricky ... no lastnamedcs here due to nesting
379
{
\ifcsname
\??fontfile
#
class
#
name
\endcsname
380
\fontclassname
{
#
class
}{
\csname
\??fontfile
#
class
#
name
\endcsname
}
%
381
\orelse\ifcsname
\??fontfile
#
name
\endcsname
382
\fontclassname
{
#
class
}{
\csname
\??fontfile
#
name
\endcsname
}
%
383
\else
384
#
2
%
385
\fi
}
386 387
\installmacrostack\fontclass
388 389
%D Files or names can have properties and these need to be consulted at some point.
390
%D They can inherit them.
391 392
% Why these expanded and rscale not ... maybe not worth the trouble (delayed
393
% expansion actually would be better i.e. macros in feature specs). Test
394
% without pre-expansion.
395 396
\def
\font_helpers_update_font_class_parameters
397
{
\edef
\m_font_class_direction
{
\begincsname
\??fontclass
\fontclass\fontstyle
\s!direction
\endcsname
}
%
398
\edef
\m_font_class_features
{
\begincsname
\??fontclass
\fontclass\fontstyle
\s!features
\endcsname
}
%
399
\edef
\m_font_class_fallbacks
{
\begincsname
\??fontclass
\fontclass\fontstyle
\s!fallbacks
\endcsname
}
%
400
\edef
\m_font_class_goodies
{
\begincsname
\??fontclass
\fontclass\fontstyle
\s!goodies
\endcsname
}
%
401
\edef
\m_font_class_designsize
{
\begincsname
\??fontclass
\fontclass\fontstyle
\s!designsize
\endcsname
}}
402 403
% resolve
404 405
\def
\font_helpers_set_features_yes
#
name
%
406
{
\ifcsname
\??fontfile
\fontclass
#
name
\s!features
\endcsname
\edef
\m_font_features
{
\lastnamedcs
}
\orelse
% class + symbolic_name
407
\ifcsname
\??fontfile
#
name
\s!features
\endcsname
\edef
\m_font_features
{
\lastnamedcs
}
\orelse
% symbolic_name
408
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
\expandafter
\font_helpers_set_features_yes
\lastnamedcs
\orelse
% class + parent_name
409
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_features_yes
\lastnamedcs
\else
% parent_name
410
\let
\m_font_features
\empty
\fi
}
411 412
\def
\font_helpers_set_fallbacks_yes
#
name
%
413
{
\ifcsname
\??fontfile
\fontclass
#
name
\s!fallbacks
\endcsname
\edef
\m_font_fallbacks
{
\lastnamedcs
}
\orelse
414
\ifcsname
\??fontfile
#
name
\s!fallbacks
\endcsname
\edef
\m_font_fallbacks
{
\lastnamedcs
}
\orelse
415
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
\expandafter
\font_helpers_set_fallbacks_yes
\lastnamedcs
\orelse
416
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_fallbacks_yes
\lastnamedcs
\else
417
\let
\m_font_fallbacks
\empty
\fi
}
418 419
\def
\font_helpers_set_goodies_yes
#
name
%
420
{
\ifcsname
\??fontfile
\fontclass
#
name
\s!goodies
\endcsname
\edef
\m_font_goodies
{
\lastnamedcs
}
\orelse
421
\ifcsname
\??fontfile
#
name
\s!goodies
\endcsname
\edef
\m_font_goodies
{
\lastnamedcs
}
\orelse
422
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
\expandafter
\font_helpers_set_goodies_yes
\lastnamedcs
\orelse
423
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_goodies_yes
\lastnamedcs
\else
424
\let
\m_font_goodies
\empty
\fi
}
425 426
\def
\font_helpers_set_designsize_yes
#
name
%
427
{
\ifcsname
\??fontfile
\fontclass
#
name
\s!designsize
\endcsname
\edef
\m_font_designsize
{
\lastnamedcs
}
\orelse
428
\ifcsname
\??fontfile
#
name
\s!designsize
\endcsname
\edef
\m_font_designsize
{
\lastnamedcs
}
\orelse
429
\ifcsname
\??fontfile
\fontclass
#
name
\endcsname
\expandafter
\font_helpers_set_designsize_yes
\lastnamedcs
\orelse
430
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_designsize_yes
\lastnamedcs
\else
431
\let
\m_font_designsize
\empty
\fi
}
432 433
\def
\font_helpers_set_features_nop
#
name
%
434
{
\ifcsname
\??fontfile
#
name
\s!features
\endcsname
\edef
\m_font_features
{
\lastnamedcs
}
\orelse
435
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_features_nop
\lastnamedcs
\else
436
\let
\m_font_features
\empty
\fi
}
437 438
\def
\font_helpers_set_fallbacks_nop
#
name
%
439
{
\ifcsname
\??fontfile
#
name
\s!fallbacks
\endcsname
\edef
\m_font_fallbacks
{
\lastnamedcs
}
\orelse
440
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_fallbacks_nop
\lastnamedcs
\else
441
\let
\m_font_fallbacks
\empty
\fi
}
442 443
\def
\font_helpers_set_goodies_nop
#
name
%
444
{
\ifcsname
\??fontfile
#
name
\s!goodies
\endcsname
\edef
\m_font_goodies
{
\lastnamedcs
}
\orelse
445
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_goodies_nop
\lastnamedcs
\else
446
\let
\m_font_goodies
\empty
\fi
}
447 448
\def
\font_helpers_set_designsize_nop
#
name
%
449
{
\ifcsname
\??fontfile
#
name
\s!designsize
\endcsname
\edef
\m_font_designsize
{
\lastnamedcs
}
\orelse
450
\ifcsname
\??fontfile
#
name
\endcsname
\expandafter
\font_helpers_set_designsize_nop
\lastnamedcs
\else
451
\let
\m_font_designsize
\empty
\fi
}
452 453
\def
\font_helpers_update_font_parameters_yes
454
{
\font_helpers_set_features_yes
\somefontname
455
\font_helpers_set_fallbacks_yes
\somefontname
456
\font_helpers_set_goodies_yes
\somefontname
457
\font_helpers_set_designsize_yes
\somefontname
}
458 459
\def
\font_helpers_update_font_parameters_nop
460
{
\font_helpers_set_features_nop
\somefontname
461
\font_helpers_set_fallbacks_nop
\somefontname
462
\font_helpers_set_goodies_nop
\somefontname
463
\font_helpers_set_designsize_nop
\somefontname
}
464 465
\def
\font_helpers_update_font_parameters
466
{
\ifempty
\fontclass
\font_helpers_update_font_parameters_nop
\else
\font_helpers_update_font_parameters_yes
\fi
}
467 468
\installcorenamespace
{
fontclass
}
469 470
% we can pack them (don't use \setxvalue!)
471 472
\unexpanded
\def
\savefontclassparameters
#
style
#
rscale
#
features
#
fallbacks
#
goodies
#
designsize
#
direction
%
473
{
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!rscale
}
#
rscale
%
474
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!features
}
#
features
%
475
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!fallbacks
}
#
fallbacks
%
476
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!goodies
}
#
goodies
%
477
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!designsize
}
#
designsize
%
478
\letgvalue
{
\??fontclass
\fontclass
#
style
\s!direction
}
#
direction
}
% math
479 480
% bonus
481 482
\let
\currentfontinstancespec
\clf_currentfontinstancespec
% expandable
483 484
\protect
\endinput
485