diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx index 84975859eea..202b16e1b19 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx @@ -28,7 +28,7 @@ \msg_redirect_module:nnn { fontspec } { warning } { none } \msg_redirect_module:nnn { fontspec } { info } { none } } -\ExecuteOptions{config,math,euenc} +\ExecuteOptions{config,math,tuenc} \ProcessOptions* % \end{macrocode} % @@ -39,13 +39,28 @@ % % Soon to be the default, with a just-in-case check: % \begin{macrocode} -\tl_set:Nn \g_fontspec_encoding_tl {TU} -\file_if_exist:nF {tuenc.def} { \bool_set_true:N \g_@@_euenc_bool } -\bool_if:NT \g_@@_euenc_bool +\bool_if:NF \g_@@_euenc_bool + { + \file_if_exist:nTF {tuenc.def} + { + \cs_if_exist:cF {T@TU} + { + \@@_warning:n {tu-clash} + \DeclareFontEncoding{TU}{}{} + \DeclareFontSubstitution{TU}{lmr}{m}{n} + } + } + { + \@@_warning:n {tu-missing} + \bool_set_true:N \g_@@_euenc_bool + } + } +\bool_if:NTF \g_@@_euenc_bool { %<xetexx> \tl_set:Nn \g_fontspec_encoding_tl {EU1} %<luatex> \tl_set:Nn \g_fontspec_encoding_tl {EU2} } + { \tl_set:Nn \g_fontspec_encoding_tl { TU } } % \end{macrocode} % % \begin{macrocode} @@ -54,7 +69,10 @@ \tl_set:Nn \ttdefault {lmtt} \RequirePackage[\g_fontspec_encoding_tl]{fontenc} \tl_set_eq:NN \UTFencname \g_fontspec_encoding_tl % for xunicode if needed -\normalsize % to overcome the encoding changing the current font size +% \end{macrocode} +% To overcome the encoding changing the current font size, but only if a class has been loaded first: +% \begin{macrocode} +\tl_if_in:NnT \@filelist {.cls} { \normalsize } % \end{macrocode} % Dealing with a couple of the problems introduced by \pkg{babel}: % \begin{macrocode} |