| 1 |
%% |
| 2 |
%% This is file `fontspec.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% fontspec.dtx (with options: `fontspec,load') |
| 8 |
%% fontspec-code-vars.dtx (with options: `options') |
| 9 |
%% fontspec-code-msg.dtx (with options: `options') |
| 10 |
%% fontspec-code-opening.dtx (with options: `options') |
| 11 |
%% fontspec-code-load.dtx (with options: `fontspec,load') |
| 12 |
%% ------------------------------------------------ |
| 13 |
%% The FONTSPEC package <latex3.github.io/fontspec> |
| 14 |
%% ------------------------------------------------ |
| 15 |
%% Copyright 2022-2025 The LaTeX project, LPPL "maintainer" |
| 16 |
%% Copyright 2004-2022 Will Robertson |
| 17 |
%% Copyright 2009-2013 Khaled Hosny |
| 18 |
%% ------------------------------------------------ |
| 19 |
%% This package is free software and may be redistributed and/or modified under |
| 20 |
%% the conditions of the LaTeX Project Public License, version 1.3c or higher |
| 21 |
%% (your choice): <http://www.latex-project.org/lppl/>. |
| 22 |
%% ------------------------------------------------ |
| 23 |
%%^^A%% fontspec.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 24 |
%%^^A%% Metadata for the package, including files and versioning |
| 25 |
|
| 26 |
\RequirePackage{xparse} |
| 27 |
\ProvidesExplPackage{fontspec}% |
| 28 |
{2025/09/29}{2.9g}{Font selection for XeLaTeX and LuaLaTeX} |
| 29 |
|
| 30 |
%%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 31 |
\bool_new:N \g__fontspec_cfg_bool |
| 32 |
\bool_new:N \g__fontspec_math_bool |
| 33 |
|
| 34 |
%%^^A%% fontspec-code-msg.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 35 |
\msg_new:nnn {fontspec} {cm-default-obsolete} |
| 36 |
{ |
| 37 |
The~"cm-default"~package~option~is~obsolete. |
| 38 |
} |
| 39 |
\msg_new:nnn {fontspec} {enc-obsolete} |
| 40 |
{ |
| 41 |
The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding. |
| 42 |
} |
| 43 |
\msg_new:nnn {fontspec} {math-opt-unknown} |
| 44 |
{ |
| 45 |
The~ global~ option~ 'math=#1'~ is~ not~ recognised.~ It~ will~ be~ ignored. |
| 46 |
} |
| 47 |
|
| 48 |
%%^^A%% fontspec-code-opening.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 49 |
\DeclareKeys |
| 50 |
{ |
| 51 |
,math .bool_gset:N = \g__fontspec_math_bool |
| 52 |
,math .usage:n = preamble |
| 53 |
,math / unknown .code:n = { } % \msg_warning:nnn {fontspec} {math-opt-unknown} {#1} |
| 54 |
,no-math .bool_gset_inverse:N = \g__fontspec_math_bool |
| 55 |
,no-math .usage:n = preamble |
| 56 |
,config .bool_gset:N = \g__fontspec_cfg_bool |
| 57 |
,config .usage:n = load |
| 58 |
,no-config .bool_gset_inverse:N = \g__fontspec_cfg_bool |
| 59 |
,no-config .usage:n = load |
| 60 |
,cm-default .code:n = { \msg_warning:nn {fontspec} {cm-default-obsolete} } |
| 61 |
,euenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{euenc} } |
| 62 |
,tuenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{tuenc} } |
| 63 |
,quiet .code:n = |
| 64 |
{ |
| 65 |
\msg_redirect_module:nnn { fontspec } { warning } { info } |
| 66 |
\msg_redirect_module:nnn { fontspec } { info } { none } |
| 67 |
} |
| 68 |
,silent .code:n = |
| 69 |
{ |
| 70 |
\msg_redirect_module:nnn { fontspec } { warning } { none } |
| 71 |
\msg_redirect_module:nnn { fontspec } { info } { none } |
| 72 |
} |
| 73 |
,verbose .code:n = |
| 74 |
{ |
| 75 |
\msg_redirect_module:nnn { fontspec } { warning } { warning } |
| 76 |
\msg_redirect_module:nnn { fontspec } { info } { info } |
| 77 |
} |
| 78 |
} |
| 79 |
\SetKeys{config,math} |
| 80 |
\ProcessKeyOptions |
| 81 |
|
| 82 |
%%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <latex3.github.io/fontspec> |
| 83 |
\sys_if_engine_luatex:T |
| 84 |
{ |
| 85 |
\RequirePackage{luaotfload} |
| 86 |
\lua_now:e{require("fontspec")} |
| 87 |
\RequirePackage{fontspec-luatex} |
| 88 |
\endinput |
| 89 |
} |
| 90 |
\sys_if_engine_xetex:T |
| 91 |
{ |
| 92 |
\RequirePackage{fontspec-xetex} |
| 93 |
\endinput |
| 94 |
} |
| 95 |
\msg_new:nnn {fontspec} {cannot-use-pdftex} |
| 96 |
{ |
| 97 |
The~ fontspec~ package~ requires~ either~ XeTeX~ or~ LuaTeX.\\\\ |
| 98 |
You~ must~ change~ your~ typesetting~ engine~ to,~ e.g.,~ |
| 99 |
"xelatex"~ or~ "lualatex"~ instead~ of~ "latex"~ or~ "pdflatex". |
| 100 |
} |
| 101 |
\msg_fatal:nn {fontspec} {cannot-use-pdftex} |