Debian Codegraph @

texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx

raw
1 %%^^A%% fontspec-code-msg.dtx -- part of FONTSPEC <latex3.github.io/fontspec>
2 %
3 % \section{Error/warning/info messages}
4 %
5 % \begin{function}{\@@_msg_new:nn,\@@_msg_new:nnn}
6 % \begin{syntax}
7 % |\@@_msg_new:nn | \Arg{msg id} \Arg{message}
8 % |\@@_msg_new:nnn| \Arg{msg id} \Arg{message} \Arg{additional text}
9 % \end{syntax}
10 % These functions define messages using the standard \verb|\msg_new:nnn(n)| commands.
11 % Wrappers are used to pre-set the package name and to trim spaces, allowing form convenient
12 % definition later in this file.
13 %
14 % An additional linebreak is added to avoid awkward breaks when the filename is
15 % included in the error message.
16 % \end{function}
17 %
18 % \section{Implementation}
19 %
20 % \subsection{Messages for package options}
21 % \begin{macrocode}
22 %<*options>
23 \msg_new:nnn {fontspec} {cm-default-obsolete}
24 {
25 The~"cm-default"~package~option~is~obsolete.
26 }
27 \msg_new:nnn {fontspec} {enc-obsolete}
28 {
29 The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
30 }
31 \msg_new:nnn {fontspec} {math-opt-unknown}
32 {
33 The~ global~ option~ 'math=#1'~ is~ not~ recognised.~ It~ will~ be~ ignored.
34 }
35 %</options>
36 % \end{macrocode}
37 %
38 %
39 % \subsection{Messages for general package behaviour}
40 %
41 % \iffalse
42 % \begin{macrocode}
43 %<*fontspec>
44 % \end{macrocode}
45 % \fi
46 %
47 % \paragraph{Shorthands for messages}
48 % \begin{macrocode}
49 \cs_new:Npn \@@_error:n { \msg_error:nn {fontspec} }
50 \cs_new:Npn \@@_error:nn { \msg_error:nnn {fontspec} }
51 \cs_new:Npn \@@_error:nx { \msg_error:nnx {fontspec} }
52 \cs_new:Npn \@@_error:nxx { \msg_error:nnxx {fontspec} }
53 \cs_new:Npn \@@_warning:n { \msg_warning:nn {fontspec} }
54 \cs_new:Npn \@@_warning:nx { \msg_warning:nnx {fontspec} }
55 \cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx {fontspec} }
56 \cs_new:Npn \@@_info:n { \msg_info:nn {fontspec} }
57 \cs_new:Npn \@@_info:nx { \msg_info:nnx {fontspec} }
58 \cs_new:Npn \@@_info:nxx { \msg_info:nnxx {fontspec} }
59 \cs_new:Npn \@@_trace:n { \msg_trace:nn {fontspec} }
60 % \end{macrocode}
61 %
62 % \begin{macro}{\@@_msg_new:nn,\@@_msg_new:nnn}
63 % \begin{macrocode}
64 \cs_new:Nn \@@_msg_new:nn
65 {
66 \msg_new:nnx {fontspec} {#1} { ^^J \tl_trim_spaces:n {#2} }
67 }
68 % \end{macrocode}
69 %
70 % \begin{macrocode}
71 \cs_new:Nn \@@_msg_new:nnn
72 {
73 \msg_new:nnxx {fontspec} {#1} { ^^J \tl_trim_spaces:n {#2} }
74 { \tl_trim_spaces:n {#3} }
75 }
76 % \end{macrocode}
77 % \end{macro}
78 %
79 % Allow messages to be written with spaces acting as normal:
80 % \begin{macrocode}
81 \char_set_catcode_space:n {32}
82 % \end{macrocode}
83 %
84 % \subsection{Errors}
85 %
86 % \begin{macrocode}
87 \@@_msg_new:nn {only-inside-encdef}
88 {
89 \exp_not:N #1 can only be used in the second argument
90 to \string\DeclareUnicodeEncoding.
91 }
92 \@@_msg_new:nn {no-size-info}
93 {
94 Size information must be supplied.\\
95 For example, SizeFeatures={Size={8-12},...}.
96 }
97 \@@_msg_new:nnn {font-not-found}
98 {
99 The font "#1" cannot be found; this may be but usually is not
100 a fontspec bug. Either there is a typo in the font name/file,
101 the font is not installed (correctly), or there is a bug
102 in the underlying font loading engine (XeTeX/luaotfload).
103 }
104 {
105 A font might not be found for many reasons.\\
106 Check the spelling, where the font is installed etc. etc.\\\\
107 When in doubt, ask someone for help!
108 }
109 \@@_msg_new:nnn {rename-feature-not-exist}
110 {
111 The feature #1 doesn't appear to be defined.
112 }
113 {
114 It looks like you're trying to rename a feature that doesn't exist.
115 }
116 \@@_msg_new:nn {no-glyph}
117 {
118 '#1' does not contain glyph #2.
119 }
120 \@@_msg_new:nnn {euler-too-late}
121 {
122 The euler package must be loaded BEFORE fontspec.
123 }
124 {
125 fontspec only overwrites euler's attempt to
126 define the maths text fonts if fontspec is
127 loaded after euler. Type <return> to proceed
128 with incorrect \string\mathit, \string\mathbf, etc.
129 }
130 \@@_msg_new:nnn {no-xcolor}
131 {
132 Cannot load named colours without the xcolor package.
133 }
134 {
135 Sorry, I can't do anything to help. Instead of loading
136 the color package, use xcolor instead.
137 }
138 \@@_msg_new:nnn {unknown-color-model}
139 {
140 Error loading colour `#1'; unknown colour model.
141 }
142 {
143 Sorry, I can't do anything to help. Please report this error
144 to my developer with a minimal example that causes the problem.
145 }
146 \@@_msg_new:nnn {not-in-addfontfeatures}
147 {
148 The "#1" font feature cannot be used in \string\addfontfeatures.
149 }
150 {
151 This is due to how TeX loads fonts; such settings
152 are global so adding them mid-document within a group causes
153 confusion. You'll need to define multiple font families to achieve
154 what you want.
155 }
156 % \end{macrocode}
157 %
158 % \subsection{Warnings}
159 %
160 % \begin{macrocode}
161 \@@_msg_new:nn {tu-clash}
162 {
163 I have found the tuenc.def encoding definition file but the TU encoding is not
164 defined by the LaTeX2e kernel; attempting to correct but you really should update
165 to the latest version of LaTeX2e.
166 }
167 \@@_msg_new:nn {tu-missing}
168 {
169 The TU encoding seems to be missing; please update to the latest version of LaTeX2e.
170 }
171 \@@_msg_new:nn {addfontfeatures-ignored}
172 {
173 \string\addfontfeature (s) ignored \msg_line_context:;
174 it cannot be used with a font that wasn't selected by a fontspec command.\\
175 \\
176 The current font is "\use:c{font@name}".\\
177 \int_compare:nTF { \clist_count:n {#1} = 1 }
178 { The requested feature is "#1". }
179 { The requested features are "#1". }
180 }
181 \@@_msg_new:nn {feature-option-overwrite}
182 {
183 Option '#2' of font feature '#1' overwritten.
184 }
185 \@@_msg_new:nn {ot-tag-too-long}
186 {
187 OpenType tag '#1' is too long; script, language, and feature tags must be four characters or fewer.
188 }
189 \@@_msg_new:nn {aat-feature-not-exist}
190 {
191 '\l_keys_key_tl=\l_keys_value_tl' feature not supported
192 for AAT font '\l_fontspec_fontname_tl'.
193 }
194 \@@_msg_new:nn {aat-feature-not-exist-in-font}
195 {
196 AAT feature '\l_keys_key_tl=\l_keys_value_tl' (#1) not available
197 in font '\l_fontspec_fontname_tl'.
198 }
199 \@@_msg_new:nn {no-opticals}
200 {
201 '#1' doesn't appear to have an Optical Size axis.
202 }
203 \@@_msg_new:nn {script-not-exist}
204 {
205 Script '#2' not explicitly supported within font '#1'.
206 Check the typeset output, and if it is okay then ignore this warning.
207 Otherwise a different font should be chosen.
208 }
209 \@@_msg_new:nn {language-not-exist}
210 {
211 Language '#1' not explicitly supported
212 within font '\l_fontspec_fontname_tl'
213 with script '\l_@@_script_name_tl'.
214 Check the typeset output, and if it is okay then ignore this warning.
215 Otherwise a different font should be chosen.
216 }
217 \@@_msg_new:nn {only-xetex-feature}
218 {
219 Ignored XeTeX-only feature: '#1'.
220 }
221 \@@_msg_new:nn {only-luatex-feature}
222 {
223 Ignored LuaTeX-only feature: '#1'.
224 }
225 \@@_msg_new:nn {unknown-renderer}
226 {
227 Renderer '#1' unknown. Assuming Harfbuzz with 'shaper=#1'.
228 Please raise a fontspec issue to add this shaper to the interface.
229 }
230 \@@_msg_new:nn {no-mapping}
231 {
232 Input mapping not supported in LuaTeX.
233 }
234 \@@_msg_new:nn {no-mapping-ligtex}
235 {
236 Input mapping not supported in LuaTeX.\\
237 Use "Ligatures=TeX" instead of "Mapping=tex-text".
238 }
239 % \end{macrocode}
240 %
241 % \begin{macrocode}
242 \@@_msg_new:nn {font-index-needs-ttc}
243 {
244 The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
245 Feature ignored.
246 }
247 \@@_msg_new:nn {feat-cannot-remove}
248 {
249 The "#1" feature cannot be deactivated. Request ignored.
250 }
251 % \end{macrocode}
252 %
253 % \subsection{Info messages}
254 %
255 % \begin{macrocode}
256 \@@_msg_new:nn {defining-font}
257 {
258 Font family '\g_@@_nfss_family_tl' created for font '#2'
259 with options [\l_@@_all_features_clist].\\
260 \\
261 This font family consists of the following NFSS series/shapes:\\
262 \g_@@_defined_shapes_tl
263 }
264 \@@_msg_new:nn {no-font-shape}
265 {
266 Could not resolve font "#1" (it probably doesn't exist).
267 }
268 \@@_msg_new:nn {set-scale}
269 {
270 \l_fontspec_fontname_tl\space scale = \l_@@_scale_tl.
271 }
272 \@@_msg_new:nn {setup-math}
273 {
274 Adjusting the maths setup (use [no-math] to avoid this).
275 }
276 \@@_msg_new:nn {opa-twice}
277 {
278 Opacity set twice, in both Colour and Opacity.\\
279 Using specification "Opacity=#1".
280 }
281 \@@_msg_new:nn {opa-twice-col}
282 {
283 Opacity set twice, in both Opacity and Colour.\\
284 Using an opacity specification in hex of "#1/FF".
285 }
286 \@@_msg_new:nn {bad-colour}
287 {
288 Bad colour declaration "#1".
289 Colour must be one of:\\
290 * a named xcolor colour\\
291 * a six-digit hex colour RRGGBB\\
292 * an eight-digit hex colour RRGGBBTT with opacity
293 }
294 % \end{macrocode}
295 %
296 % Reset `space' behaviour:
297 % \begin{macrocode}
298 \char_set_catcode_ignore:n {32}
299 % \end{macrocode}
300 %
301 % \iffalse
302 % \begin{macrocode}
303 %</fontspec>
304 % \end{macrocode}
305 % \fi
306
307
308 \endinput
309
310 % /©
311 % ------------------------------------------------
312 % The FONTSPEC package <latex3.github.io/fontspec>
313 % ------------------------------------------------
314 % Copyright 2022-2025 The LaTeX project, LPPL "maintainer"
315 % Copyright 2004-2022 Will Robertson
316 % Copyright 2009-2015 Khaled Hosny
317 % Copyright 2013 Philipp Gesang
318 % Copyright 2013-2016 Joseph Wright
319 % ------------------------------------------------
320 % This package is free software and may be redistributed and/or modified under
321 % the conditions of the LaTeX Project Public License, version 1.3c or higher
322 % (your choice): <http://www.latex-project.org/lppl/>.
323 % ------------------------------------------------
324 % ©/