Debian Codegraph @

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

raw
1 %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <latex3.github.io/fontspec>
2 %
3 % \section{The \texttt{fontspec.sty} loading file}
4 %
5 % Before we begin, for the rest of the package we use the \texttt{@@} \textsf{expl3}
6 % module syntax with module name `\texttt{fontspec}'.
7 % \begin{macrocode}
8 %<@@=fontspec>
9 % \end{macrocode}
10 % The \texttt{fontspec.sty} file is simply set up to load the appropriate
11 % \texttt{fontspec-xetex.sty} or \texttt{fontspec-luatex.sty} file.
12 % This is performed by the following code.
13 %
14 % \begin{macrocode}
15 %<*load>
16 % \end{macrocode}
17 %
18 % \paragraph{\LuaLaTeX}
19 % \begin{macrocode}
20 \sys_if_engine_luatex:T
21 {
22 \RequirePackage{luaotfload}
23 \lua_now:e{require("fontspec")}
24 \RequirePackage{fontspec-luatex}
25 \endinput
26 }
27 % \end{macrocode}
28 %
29 % \paragraph{\XeLaTeX}
30 % \begin{macrocode}
31 \sys_if_engine_xetex:T
32 {
33 \RequirePackage{fontspec-xetex}
34 \endinput
35 }
36 % \end{macrocode}
37 %
38 % \paragraph{Other}
39 % If not one of the above, error and exit.
40 % \begin{macrocode}
41 \msg_new:nnn {fontspec} {cannot-use-pdftex}
42 {
43 The~ fontspec~ package~ requires~ either~ XeTeX~ or~ LuaTeX.\\\\
44 You~ must~ change~ your~ typesetting~ engine~ to,~ e.g.,~
45 "xelatex"~ or~ "lualatex"~ instead~ of~ "latex"~ or~ "pdflatex".
46 }
47 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
48 % \end{macrocode}
49 %
50 % \paragraph{Closing}
51 % That's the end of the \texttt{fontspec.sty} file.
52 % \begin{macrocode}
53 \endinput
54 %</load>
55 % \end{macrocode}
56
57 \endinput
58
59 % /©
60 % ------------------------------------------------
61 % The FONTSPEC package <latex3.github.io/fontspec>
62 % ------------------------------------------------
63 % Copyright 2022-2025 The LaTeX project, LPPL "maintainer"
64 % Copyright 2004-2022 Will Robertson
65 % Copyright 2009-2015 Khaled Hosny
66 % Copyright 2013 Philipp Gesang
67 % Copyright 2013-2016 Joseph Wright
68 % ------------------------------------------------
69 % This package is free software and may be redistributed and/or modified under
70 % the conditions of the LaTeX Project Public License, version 1.3c or higher
71 % (your choice): <http://www.latex-project.org/lppl/>.
72 % ------------------------------------------------
73 % ©/