-
Notifications
You must be signed in to change notification settings - Fork 34
/
fontspec-code-msg.dtx
324 lines (321 loc) · 9.1 KB
/
fontspec-code-msg.dtx
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
%%^^A%% fontspec-code-msg.dtx -- part of FONTSPEC <latex3.github.io/fontspec>
%
% \section{Error/warning/info messages}
%
% \begin{function}{\@@_msg_new:nn,\@@_msg_new:nnn}
% \begin{syntax}
% |\@@_msg_new:nn | \Arg{msg id} \Arg{message}
% |\@@_msg_new:nnn| \Arg{msg id} \Arg{message} \Arg{additional text}
% \end{syntax}
% These functions define messages using the standard \verb|\msg_new:nnn(n)| commands.
% Wrappers are used to pre-set the package name and to trim spaces, allowing form convenient
% definition later in this file.
%
% An additional linebreak is added to avoid awkward breaks when the filename is
% included in the error message.
% \end{function}
%
% \section{Implementation}
%
% \subsection{Messages for package options}
% \begin{macrocode}
%<*options>
\msg_new:nnn {fontspec} {cm-default-obsolete}
{
The~"cm-default"~package~option~is~obsolete.
}
\msg_new:nnn {fontspec} {enc-obsolete}
{
The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
}
\msg_new:nnn {fontspec} {math-opt-unknown}
{
The~ global~ option~ 'math=#1'~ is~ not~ recognised.~ It~ will~ be~ ignored.
}
%</options>
% \end{macrocode}
%
%
% \subsection{Messages for general package behaviour}
%
% \iffalse
% \begin{macrocode}
%<*fontspec>
% \end{macrocode}
% \fi
%
% \paragraph{Shorthands for messages}
% \begin{macrocode}
\cs_new:Npn \@@_error:n { \msg_error:nn {fontspec} }
\cs_new:Npn \@@_error:nn { \msg_error:nnn {fontspec} }
\cs_new:Npn \@@_error:nx { \msg_error:nnx {fontspec} }
\cs_new:Npn \@@_error:nxx { \msg_error:nnxx {fontspec} }
\cs_new:Npn \@@_warning:n { \msg_warning:nn {fontspec} }
\cs_new:Npn \@@_warning:nx { \msg_warning:nnx {fontspec} }
\cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx {fontspec} }
\cs_new:Npn \@@_info:n { \msg_info:nn {fontspec} }
\cs_new:Npn \@@_info:nx { \msg_info:nnx {fontspec} }
\cs_new:Npn \@@_info:nxx { \msg_info:nnxx {fontspec} }
\cs_new:Npn \@@_trace:n { \msg_trace:nn {fontspec} }
% \end{macrocode}
%
% \begin{macro}{\@@_msg_new:nn,\@@_msg_new:nnn}
% \begin{macrocode}
\cs_new:Nn \@@_msg_new:nn
{
\msg_new:nnx {fontspec} {#1} { ^^J \tl_trim_spaces:n {#2} }
}
% \end{macrocode}
%
% \begin{macrocode}
\cs_new:Nn \@@_msg_new:nnn
{
\msg_new:nnxx {fontspec} {#1} { ^^J \tl_trim_spaces:n {#2} }
{ \tl_trim_spaces:n {#3} }
}
% \end{macrocode}
% \end{macro}
%
% Allow messages to be written with spaces acting as normal:
% \begin{macrocode}
\char_set_catcode_space:n {32}
% \end{macrocode}
%
% \subsection{Errors}
%
% \begin{macrocode}
\@@_msg_new:nn {only-inside-encdef}
{
\exp_not:N #1 can only be used in the second argument
to \string\DeclareUnicodeEncoding.
}
\@@_msg_new:nn {no-size-info}
{
Size information must be supplied.\\
For example, SizeFeatures={Size={8-12},...}.
}
\@@_msg_new:nnn {font-not-found}
{
The font "#1" cannot be found; this may be but usually is not
a fontspec bug. Either there is a typo in the font name/file,
the font is not installed (correctly), or there is a bug
in the underlying font loading engine (XeTeX/luaotfload).
}
{
A font might not be found for many reasons.\\
Check the spelling, where the font is installed etc. etc.\\\\
When in doubt, ask someone for help!
}
\@@_msg_new:nnn {rename-feature-not-exist}
{
The feature #1 doesn't appear to be defined.
}
{
It looks like you're trying to rename a feature that doesn't exist.
}
\@@_msg_new:nn {no-glyph}
{
'#1' does not contain glyph #2.
}
\@@_msg_new:nnn {euler-too-late}
{
The euler package must be loaded BEFORE fontspec.
}
{
fontspec only overwrites euler's attempt to
define the maths text fonts if fontspec is
loaded after euler. Type <return> to proceed
with incorrect \string\mathit, \string\mathbf, etc.
}
\@@_msg_new:nnn {no-xcolor}
{
Cannot load named colours without the xcolor package.
}
{
Sorry, I can't do anything to help. Instead of loading
the color package, use xcolor instead.
}
\@@_msg_new:nnn {unknown-color-model}
{
Error loading colour `#1'; unknown colour model.
}
{
Sorry, I can't do anything to help. Please report this error
to my developer with a minimal example that causes the problem.
}
\@@_msg_new:nnn {not-in-addfontfeatures}
{
The "#1" font feature cannot be used in \string\addfontfeatures.
}
{
This is due to how TeX loads fonts; such settings
are global so adding them mid-document within a group causes
confusion. You'll need to define multiple font families to achieve
what you want.
}
% \end{macrocode}
%
% \subsection{Warnings}
%
% \begin{macrocode}
\@@_msg_new:nn {tu-clash}
{
I have found the tuenc.def encoding definition file but the TU encoding is not
defined by the LaTeX2e kernel; attempting to correct but you really should update
to the latest version of LaTeX2e.
}
\@@_msg_new:nn {tu-missing}
{
The TU encoding seems to be missing; please update to the latest version of LaTeX2e.
}
\@@_msg_new:nn {addfontfeatures-ignored}
{
\string\addfontfeature (s) ignored \msg_line_context:;
it cannot be used with a font that wasn't selected by a fontspec command.\\
\\
The current font is "\use:c{font@name}".\\
\int_compare:nTF { \clist_count:n {#1} = 1 }
{ The requested feature is "#1". }
{ The requested features are "#1". }
}
\@@_msg_new:nn {feature-option-overwrite}
{
Option '#2' of font feature '#1' overwritten.
}
\@@_msg_new:nn {ot-tag-too-long}
{
OpenType tag '#1' is too long; script, language, and feature tags must be four characters or fewer.
}
\@@_msg_new:nn {aat-feature-not-exist}
{
'\l_keys_key_tl=\l_keys_value_tl' feature not supported
for AAT font '\l_fontspec_fontname_tl'.
}
\@@_msg_new:nn {aat-feature-not-exist-in-font}
{
AAT feature '\l_keys_key_tl=\l_keys_value_tl' (#1) not available
in font '\l_fontspec_fontname_tl'.
}
\@@_msg_new:nn {no-opticals}
{
'#1' doesn't appear to have an Optical Size axis.
}
\@@_msg_new:nn {script-not-exist}
{
Script '#2' not explicitly supported within font '#1'.
Check the typeset output, and if it is okay then ignore this warning.
Otherwise a different font should be chosen.
}
\@@_msg_new:nn {language-not-exist}
{
Language '#1' not explicitly supported
within font '\l_fontspec_fontname_tl'
with script '\l_@@_script_name_tl'.
Check the typeset output, and if it is okay then ignore this warning.
Otherwise a different font should be chosen.
}
\@@_msg_new:nn {only-xetex-feature}
{
Ignored XeTeX-only feature: '#1'.
}
\@@_msg_new:nn {only-luatex-feature}
{
Ignored LuaTeX-only feature: '#1'.
}
\@@_msg_new:nn {unknown-renderer}
{
Renderer '#1' unknown. Assuming Harfbuzz with 'shaper=#1'.
Please raise a fontspec issue to add this shaper to the interface.
}
\@@_msg_new:nn {no-mapping}
{
Input mapping not supported in LuaTeX.
}
\@@_msg_new:nn {no-mapping-ligtex}
{
Input mapping not supported in LuaTeX.\\
Use "Ligatures=TeX" instead of "Mapping=tex-text".
}
% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn {font-index-needs-ttc}
{
The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
Feature ignored.
}
\@@_msg_new:nn {feat-cannot-remove}
{
The "#1" feature cannot be deactivated. Request ignored.
}
% \end{macrocode}
%
% \subsection{Info messages}
%
% \begin{macrocode}
\@@_msg_new:nn {defining-font}
{
Font family '\g_@@_nfss_family_tl' created for font '#2'
with options [\l_@@_all_features_clist].\\
\\
This font family consists of the following NFSS series/shapes:\\
\g_@@_defined_shapes_tl
}
\@@_msg_new:nn {no-font-shape}
{
Could not resolve font "#1" (it probably doesn't exist).
}
\@@_msg_new:nn {set-scale}
{
\l_fontspec_fontname_tl\space scale = \l_@@_scale_tl.
}
\@@_msg_new:nn {setup-math}
{
Adjusting the maths setup (use [no-math] to avoid this).
}
\@@_msg_new:nn {opa-twice}
{
Opacity set twice, in both Colour and Opacity.\\
Using specification "Opacity=#1".
}
\@@_msg_new:nn {opa-twice-col}
{
Opacity set twice, in both Opacity and Colour.\\
Using an opacity specification in hex of "#1/FF".
}
\@@_msg_new:nn {bad-colour}
{
Bad colour declaration "#1".
Colour must be one of:\\
* a named xcolor colour\\
* a six-digit hex colour RRGGBB\\
* an eight-digit hex colour RRGGBBTT with opacity
}
% \end{macrocode}
%
% Reset `space' behaviour:
% \begin{macrocode}
\char_set_catcode_ignore:n {32}
% \end{macrocode}
%
% \iffalse
% \begin{macrocode}
%</fontspec>
% \end{macrocode}
% \fi
\endinput
% /©
% ------------------------------------------------
% The FONTSPEC package <latex3.github.io/fontspec>
% ------------------------------------------------
% Copyright 2022-2024 The LaTeX project, LPPL "maintainer"
% Copyright 2004-2022 Will Robertson
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
% Copyright 2013-2016 Joseph Wright
% ------------------------------------------------
% This package is free software and may be redistributed and/or modified under
% the conditions of the LaTeX Project Public License, version 1.3c or higher
% (your choice): <http://www.latex-project.org/lppl/>.
% ------------------------------------------------
% ©/