blob: 7d0501b89e188004c773e00fc797b713660ca14f (
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
|
%%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
%
% \section{The \texttt{fontspec.sty} loading file}
%
% Before we begin, for the rest of the package we use the \texttt{@@} \textsf{expl3}
% module syntax with module name `\texttt{fontspec}'.
% \begin{macrocode}
%<@@=fontspec>
% \end{macrocode}
% The \texttt{fontspec.sty} file is simply set up to load the appropriate
% \texttt{fontspec-xetex.sty} or \texttt{fontspec-luatex.sty} file.
% This is performed by the following code.
%
% \begin{macrocode}
%<*load>
% \end{macrocode}
%
% \paragraph{\LuaLaTeX}
% \begin{macrocode}
\sys_if_engine_luatex:T
{
\RequirePackage{luaotfload}
\lua_now:e{require("fontspec")}
\RequirePackageWithOptions{fontspec-luatex}
\endinput
}
% \end{macrocode}
%
% \paragraph{\XeLaTeX}
% \begin{macrocode}
\sys_if_engine_xetex:T
{
\RequirePackageWithOptions{fontspec-xetex}
\endinput
}
% \end{macrocode}
%
% \paragraph{Other}
% If not one of the above, error and exit.
% \begin{macrocode}
\msg_new:nnn {fontspec} {cannot-use-pdftex}
{
The~ fontspec~ package~ requires~ either~ XeTeX~ or~ LuaTeX.\\\\
You~ must~ change~ your~ typesetting~ engine~ to,~ e.g.,~
"xelatex"~ or~ "lualatex" instead~ of~ "latex"~ or~ "pdflatex".
}
\msg_fatal:nn {fontspec} {cannot-use-pdftex}
% \end{macrocode}
%
% \paragraph{Closing}
% That's the end of the \texttt{fontspec.sty} file.
% \begin{macrocode}
\endinput
%</load>
% \end{macrocode}
\endinput
% /©
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
% Copyright 2004-2020 Will Robertson, LPPL "maintainer"
% 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/>.
% ------------------------------------------------
% ©/
|