texlive[69833] Master/texmf-dist: fontspec (14feb24)

commits+karl at tug.org commits+karl at tug.org
Wed Feb 14 00:46:54 CET 2024


Revision: 69833
          https://tug.org/svn/texlive?view=revision&revision=69833
Author:   karl
Date:     2024-02-14 00:46:54 +0100 (Wed, 14 Feb 2024)
Log Message:
-----------
fontspec (14feb24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md
    trunk/Master/texmf-dist/doc/latex/fontspec/README.md
    trunk/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf
    trunk/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-closing.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-enc.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-aat.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-fontload.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-graphite.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-interfaces.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-math.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-scripts.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-user.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-xfss.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2024-02-13 23:46:54 UTC (rev 69833)
@@ -1,6 +1,20 @@
 Change history
 ==============
 
+
+## v2.9a (2024/02/13)
+
+  * Added a `Scale=MatchAveragecase` paramater which averages `Scale=MatchLowercase` and `Scale=MatchUppercase`.
+  * Switched options to LaTeX keyval handler.
+  * Added option `verbose` to undo silent/quiet.
+  * `euenc`/`tuenc` options are now obsolete (TU is the only encoding). 
+  * Support variable fonts under LuaLaTeX.
+  * Skip scanning for filenames when loading fonts by name on LuaLaTeX.
+  * Allow restricting filename lookup to kpathsea lookups using `KpseOnly`.
+  * Added support for named colors from l3color.
+  * Support with lualatex spotcolors and cmyk colors in the pdf. 
+
+
 ## v2.8a (2022/01/15)
 
   * Add `SwashFont` and `BoldSwashFont` features to support LaTeX's now-builtin `\textsw`

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontspec/README.md	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/doc/latex/fontspec/README.md	2024-02-13 23:46:54 UTC (rev 69833)
@@ -54,10 +54,10 @@
   <http://www.ctan.org/pkg/fontspec>
 
 Development and historical versions are available from Github:
-  <http://github.com/wspr/fontspec>
+  <http://github.com/latex3/fontspec>
 
 Please offer suggestions and file bug reports in the issue tracker:
-  <http://github.com/wspr/fontspec/issues>
+  <http://github.com/latex3/fontspec/issues>
 
 If you are running TeX Live, you can update to the latest version of this package by running
 
@@ -67,12 +67,11 @@
 
     http://mirror.ctan.org/install/macros/latex/contrib/fontspec.tds.zip
 
-If you wish to use the latest development version from Github, either use git to obtain the bleeding edge version with
+If you wish to use the latest development version from Github, use git to obtain the latest repository code with
 
-    git clone git://github.com/wspr/fontspec.git
+    git clone git://github.com/latex3/fontspec.git
 
-(For bleeding edge versions, see the `working` branch.)
-Having obtained the package from Github, install the package code by running
+See the `working` branch for changes that have not been released to CTAN yet (no guarantees the code in that branch will always be fully functional). Having obtained the package from Github, install the package code by running
 
     l3build install
 

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -378,6 +378,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-closing.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-closing.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-closing.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -32,6 +32,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-enc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-enc.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-enc.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -146,6 +146,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-aat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-aat.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-aat.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -231,6 +231,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -571,6 +571,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-fontload.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-fontload.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-fontload.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -34,7 +34,7 @@
 %
 % \begin{macro}[pTF]{\@@_primitive_font_if_null:N}
 %    \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_if_null:N {p,TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_if_null:N {p,TF,T,F}
   {
     \ifx #1 \nullfont
       \prg_return_true:
@@ -47,12 +47,12 @@
 %
 % \begin{macro}[pTF]{\@@_primitive_font_set:NnnTF,\@@_primitive_font_gset:NnnTF}
 %    \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_set:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_set:Nnn {TF,T,F}
   {
     \@@_primitive_font_set:Nnn #1 {#2} {#3}
     \@@_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
   }
-\prg_set_conditional:Nnn \@@_primitive_font_gset:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_gset:Nnn {TF,T,F}
   {
     \@@_primitive_font_gset:Nnn #1 {#2} {#3}
     \@@_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
@@ -66,7 +66,7 @@
 %
 % \begin{macro}[TF]{\@@_primitive_font_if_exist:n}
 %    \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_if_exist:n {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_if_exist:n {TF,T,F}
   {
     \group_begin:
       \@@_font_suppress_not_found_error:
@@ -124,6 +124,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-graphite.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-graphite.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-graphite.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -116,6 +116,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-interfaces.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-interfaces.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-interfaces.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -284,6 +284,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -282,13 +282,14 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_font_is_file:,\@@_font_is_name:}
+% \begin{macro}{\@@_font_is_file:,\@@_font_is_name:,\@@_font_is_kpse:}
 % The \cs{@@_fontname_wrap:n} command takes the font name and either passes it through unchanged or wraps it in the syntax for loading a font `by filename'.
-% \XeTeX's syntax is followed since \pkg{luaotfload} provides compatibility.
+% For Lua\TeX\ there are two kinds kinds of filename based loading supported: Regular filename lookups which include system fonts and lookups restricted to kpse.
 %    \begin{macrocode}
 \cs_new:Nn \@@_font_is_name:
   {
-    \cs_set_eq:NN \@@_fontname_wrap:n \use:n
+%<XE>  \cs_set_eq:NN \@@_fontname_wrap:n \use:n
+%<LU>  \cs_set:Npn \@@_fontname_wrap:n ##1 { name: ##1 }
   }
 %    \end{macrocode}
 %
@@ -298,6 +299,16 @@
     \cs_set:Npn \@@_fontname_wrap:n ##1 { [ \l_@@_font_path_tl ##1 ] }
   }
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+%<*LU>
+\cs_new:Nn \@@_font_is_kpse:
+  {
+    \cs_set:Npn \@@_fontname_wrap:n ##1 { kpse: ##1 }
+  }
+%</LU>
+%<XE>\cs_new_eq:NN \@@_font_is_kpse: \@@_font_is_file:
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@@_set_scriptlang:}
@@ -360,7 +371,8 @@
 
     \str_if_eq:eeF { \l_@@_hexcol_tl \l_@@_opacity_tl }
                      { \c_@@_hexcol_tl \c_@@_opacity_tl }
-      { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
+%<XE>       { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
+%<LU>       { \@@_update_featstr:n { color = {\l_@@_hexcol_tl\l_@@_opacity_tl} } }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -445,7 +457,7 @@
     \prop_gput:cnx {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {fontdef}
       {
         \@@_construct_font_call:nn {\l_fontspec_fontname_tl}
-          { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
+          { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist \@@_get_variations: }
       }
     \prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {script-num} \l_@@_script_int
     \prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {lang-num}   \l_@@_language_int
@@ -649,7 +661,7 @@
     \group_begin:
     \@@_primitive_font_set:Nnn \l_@@_tmpa_font { \@@_construct_font_call:nn {#1}   { \l_@@_pre_feat_sclist } } { \f at size pt + 1sp }
     \@@_primitive_font_set:Nnn \l_@@_tmpb_font { \@@_construct_font_call:nn {#1#2} { \l_@@_pre_feat_sclist } } { \f at size pt + 1sp }
-    \str_if_eq:eeTF { \@@_primitive_font_get_name:N \l_@@_tmpa_font } { \@@_primitive_font_get_name:N \l_@@_tmpb_font }
+    \cs_if_eq:NNTF \l_@@_tmpa_font \l_@@_tmpb_font
       { \group_end: \prg_return_false: }
       { \group_end: \prg_return_true: }
   }
@@ -790,7 +802,7 @@
 %<debug>\typeout{====~Setup~NFSS~shape:~<\l_@@_size_tl>~\l_fontspec_fontname_tl}
 
     \@@_get_features:n { #2 , #3 , #4 }
-%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist}
+%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist \@@_get_variations:}
 
     \tl_if_empty:NF \l_@@_scale_tl
       {
@@ -801,7 +813,7 @@
       {
         <\l_@@_size_tl> \l_@@_scale_tl
         \@@_construct_font_call:nn { \l_fontspec_fontname_tl }
-          { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
+          { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist \@@_get_variations: }
       }
   }
 %    \end{macrocode}
@@ -1052,6 +1064,33 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_get_variations:}
+% \cmd{\@@_get_variations:} builds the feature string representing the
+% current variation instance and/or axis settings.
+%    \begin{macrocode}
+\cs_generate_variant:Nn \tl_tail:n { e }
+\cs_new:Nn \@@_format_axis:nn
+  {
+    , #1 = #2
+  }
+\cs_new:Nn \@@_get_variations:
+  {
+    \tl_if_empty:NF \g_@@_instance_tl
+      {
+        instance = { \g_@@_instance_tl };
+      }
+      \prop_if_empty:NF \g_@@_rawvariations_prop
+      {
+        axis = {
+          \tl_tail:e {
+            \prop_map_function:NN \g_@@_rawvariations_prop \@@_format_axis:nn
+          }
+        };
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Initialisation}
 %
 % \begin{macro}{\@@_init:}
@@ -1089,6 +1128,8 @@
 \cs_new:Nn \@@_init_fontface:
   {
     \tl_gclear:N \g_@@_rawfeatures_sclist
+    \prop_gclear:N \g_@@_rawvariations_prop
+    \tl_gclear:N \g_@@_instance_tl
     \tl_clear:N \l_@@_scale_tl
     \tl_set_eq:NN \l_@@_opacity_tl \c_@@_opacity_tl
     \tl_set_eq:NN \l_@@_hexcol_tl \c_@@_hexcol_tl
@@ -1210,6 +1251,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -63,7 +63,13 @@
     \bool_set_true:N \l_@@_noit_bool
     \bool_set_true:N \l_@@_external_bool
     \tl_set:Nn \l_@@_font_path_tl {#1}
-    \@@_font_is_file:
+    \bool_lazy_and:nnTF { \l_@@_external_kpse_bool } { \tl_if_empty_p:N \l_@@_font_path_tl }
+      {
+        \@@_font_is_kpse:
+      }
+      {
+        \@@_font_is_file:
+      }
 %<*XE>
     \keys_set:nn {fontspec-renderer} {Renderer=OpenType}
 %</XE>
@@ -89,7 +95,23 @@
 \@@_keys_define_code:nnn {fontspec} {Extension} {}
 %    \end{macrocode}
 %
+% \paragraph{\feat{KpseOnly}}
+% If the font is specified by filename, only search for it through kpse.
+% \XeTeX\ does not support finding system fonts by filename so this is always implicitly set
+% there.
+%    \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-preparse-external} {KpseOnly}
+  {
+    \bool_set_true:N \l_@@_external_kpse_bool
+    \bool_if:NT \l_@@_external_bool
+      {
+        \@@_font_is_kpse:
+      }
+  }
+\@@_keys_define_code:nnn {fontspec} {KpseOnly} {}
+%    \end{macrocode}
 %
+%
 % \paragraph{\feat{Renderer}}
 % This feature must be processed before all others (the other font shape and features
 % options are also pre-parsed for convenience) because the renderer determines the format
@@ -463,8 +485,8 @@
 %
 % \paragraph{Scale}
 % If the input isn't one of the pre-defined string options, then
-% it's gotta be numerical. \cs{fontspec_calc_scale:n} does all the work in
-% the auto-scaling cases.
+% it's gotta be numerical. \cs{fontspec_calc_scale:n} and \cs{fontspec_calc_scale:nn}
+% do all the work in the auto-scaling cases.
 %    \begin{macrocode}
 \@@_keys_define_code:nnn {fontspec} {Scale}
   {
@@ -472,8 +494,10 @@
       {
         {MatchLowercase} { \@@_calc_scale:n {5} }
         {MatchUppercase} { \@@_calc_scale:n {8} }
+        {MatchAveragecase} { \@@_calc_scale:nn {5} {8} }
       }
       { \tl_set:Nx \l_@@_scale_tl {#1} }
+      \@@_info:n {set-scale}
   }
 %    \end{macrocode}
 %
@@ -520,7 +544,6 @@
                        \dim_to_fp:n {\l_@@_tmpb_dim}   }
         }
 
-      \@@_info:n {set-scale}
       \exp_args:NNNx
     \group_end:
     \tl_set:Nx \l_@@_scale_tl { \l_@@_scale_tl }
@@ -529,6 +552,26 @@
 % \end{macro}
 %
 %
+% \begin{macro}{\@@_calc_scale:nn}
+% This macro calls \cs{fontspec_calc_scale:n} twice
+% and then sets the scale to the average of the two results.
+%    \begin{macrocode}
+\cs_new:Nn \@@_calc_scale:nn
+{
+    \group_begin:
+      \__fontspec_calc_scale:n {#1}
+      \tl_set_eq:NN \l_@@_tmp_tl \l_@@_scale_tl
+      \__fontspec_calc_scale:n {#2}
+      \tl_set:Nx \l_@@_scale_tl
+        {
+          \fp_eval:n { (\l_@@_tmp_tl + \l_@@_scale_tl)/2 }
+        }
+      \exp_args:NNNx
+    \group_end:
+    \tl_set:Nx \l_@@_scale_tl { \l_@@_scale_tl }
+  }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\@@_set_font_dimen:NnN}
 % This function sets the dimension |#1| (for font |#3|) to `fontdimen' |#2|
 % for either font dimension 5 (x-height) or 8 (cap-height). If, for some
@@ -675,26 +718,61 @@
 %    \end{macrocode}
 %
 % \paragraph{Color}
-% Hooks into pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
+% Test first if the color is a named l3color, then if it is a color from
+% \pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
+% If this fails the argument is assumed to be a hex color.
+%
 %    \begin{macrocode}
 \@@_keys_define_code:nnn {fontspec} {Color}
   {
-    \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+%<*XE>
+    \color_if_exist:nTF {#1}
       {
-        \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+        \color_export:nnN {#1} {HTML}\l_@@_hexcol_tl
       }
       {
-        \int_compare:nTF { \tl_count:n {#1} == 6 }
-          { \tl_set:Nn \l_@@_hexcol_tl {#1} }
+        \cs_if_exist:cTF { \token_to_str:N \color@ #1 }        
           {
-            \int_compare:nTF { \tl_count:n {#1} == 8 }
-              { \fontspec_parse_colour:viii #1 }
+            \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+          }
+          {
+            \int_compare:nTF { \tl_count:n {#1} == 6 }
+              { \tl_set:Nn \l_@@_hexcol_tl {#1} }
               {
-                \bool_if:NF \l_@@_firsttime_bool
-                  { \@@_warning:nx {bad-colour} {#1} }
+                \int_compare:nTF { \tl_count:n {#1} == 8 }
+                  { \fontspec_parse_colour:viii #1 }
+                  {
+                    \bool_if:NF \l_@@_firsttime_bool
+                      { \@@_warning:nx {bad-colour} {#1} }
+                  }
               }
           }
       }
+%</XE>
+%<*LU>
+    \color_if_exist:nTF {#1}
+      {
+        \tl_set:Nn \l_@@_hexcol_tl {#1}
+      }
+      {
+        \cs_if_exist:cTF { \token_to_str:N \color@ #1 }        
+          {
+            \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+          }
+          {
+            \int_compare:nTF { \tl_count:n {#1} == 6 }
+              { \tl_set:Nn \l_@@_hexcol_tl {#1} }
+              {
+                \int_compare:nTF { \tl_count:n {#1} == 8 }
+                  { \fontspec_parse_colour:viii #1 }
+                  {
+                    \bool_if:NF \l_@@_firsttime_bool
+                      { \@@_warning:nx {bad-colour} {#1} }
+                  }
+              }
+          }
+      }      
+%</LU>
   }
 %    \end{macrocode}
 %
@@ -723,6 +801,7 @@
       }
     \tl_set:Nx \l_@@_opacity_tl
       {
+%<LU>      ,
         \int_compare:nT { \l_@@_tmp_int <= "F } {0} % zero pad
         \int_to_hex:n { \l_@@_tmp_int }
       }
@@ -760,14 +839,21 @@
 % \subsubsection{Continuous font axes}
 %
 %    \begin{macrocode}
+%<*XE>
 \@@_keys_define_code:nnn {fontspec} {Weight}
   {
     \@@_update_featstr:n{weight=#1}
   }
+%</XE>
+%<LU>\@@_define_opentype_variation_axis:nn {Weight} {wght}
+%<*XE>
 \@@_keys_define_code:nnn {fontspec} {Width}
   {
     \@@_update_featstr:n{width=#1}
   }
+%</XE>
+%<LU>\@@_define_opentype_variation_axis:nn {Width} {wdth}
+\@@_define_opentype_variation_axis:nn {Slant} {slnt}
 \@@_keys_define_code:nnn {fontspec} {OpticalSize}
 %<*XE>
   {
@@ -795,6 +881,23 @@
 %</LU>
 %    \end{macrocode}
 %
+% For other potentially font specific variation axes, there is a raw setter available:
+%    \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-opentype} {RawAxis}
+  {
+    \prop_gput_from_keyval:Nn \g_@@_rawvariations_prop {#1}
+  }
+%    \end{macrocode}
+%
+% \subsubsection{Variation instances}
+%
+%    \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-opentype} {Instance}
+  {
+    \tl_gset:Nn \g_@@_instance_tl {#1}
+  }
+%    \end{macrocode}
+%
 % \subsubsection{Font transformations}
 % These are to be specified to apply directly to a font shape:
 %    \begin{macrocode}
@@ -914,6 +1017,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -407,6 +407,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -21,7 +21,7 @@
   {
     \RequirePackage{luaotfload}
     \lua_now:e{require("fontspec")}
-    \RequirePackageWithOptions{fontspec-luatex}
+    \RequirePackage{fontspec-luatex}
     \endinput
   }
 %    \end{macrocode}
@@ -30,7 +30,7 @@
 %    \begin{macrocode}
 \sys_if_engine_xetex:T
   {
-    \RequirePackageWithOptions{fontspec-xetex}
+    \RequirePackage{fontspec-xetex}
     \endinput
   }
 %    \end{macrocode}
@@ -60,6 +60,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-math.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-math.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-math.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -248,6 +248,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -13,6 +13,7 @@
 \cs_new:Npn \@@_error:n     { \msg_error:nn     {fontspec} }
 \cs_new:Npn \@@_error:nn    { \msg_error:nnn    {fontspec} }
 \cs_new:Npn \@@_error:nx    { \msg_error:nnx    {fontspec} }
+\cs_new:Npn \@@_error:nxx   { \msg_error:nnxx    {fontspec} }
 \cs_new:Npn \@@_warning:n   { \msg_warning:nn   {fontspec} }
 \cs_new:Npn \@@_warning:nx  { \msg_warning:nnx  {fontspec} }
 \cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx {fontspec} }
@@ -188,10 +189,21 @@
   Input mapping not supported in LuaTeX.\\
   Use "Ligatures=TeX" instead of "Mapping=tex-text".
  }
-\@@_msg_new:nn {cm-default-obsolete}
+%    \end{macrocode}
+% message for package options must be loaded earlier
+%    \begin{macrocode}
+%</fontspec>
+%<*options>
+\msg_new:nnn {fontspec} {cm-default-obsolete}
  {
-  The "cm-default" package option is obsolete.
+  The~"cm-default"~package~option~is~obsolete.
  }
+\msg_new:nnn {fontspec} {enc-obsolete}
+ {
+  The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
+ }
+%</options>
+%<*fontspec> 
 \@@_msg_new:nn {font-index-needs-ttc}
  {
   The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
@@ -268,6 +280,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -4,7 +4,7 @@
 %
 % \iffalse
 %    \begin{macrocode}
-%<*fontspec>
+%<*options>
 %    \end{macrocode}
 % \fi
 %
@@ -11,68 +11,67 @@
 % \subsection{Package options}
 %
 %    \begin{macrocode}
-\DeclareOption{cm-default}
+\DeclareKeys 
   {
-    \@@_warning:n {cm-default-obsolete}
-  }
+    cm-default  .code:n = { \msg_warning:nn   {fontspec} {cm-default-obsolete} }    
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareOption {math}     { \bool_gset_true:N  \g_@@_math_bool  }
-\DeclareOption {no-math}  { \bool_gset_false:N \g_@@_math_bool  }
-\DeclareOption {config}   { \bool_gset_true:N  \g_@@_cfg_bool   }
-\DeclareOption {no-config}{ \bool_gset_false:N \g_@@_cfg_bool   }
-\DeclareOption {euenc}    { \bool_gset_true:N  \g_@@_euenc_bool }
-\DeclareOption {tuenc}    { \bool_gset_false:N \g_@@_euenc_bool }
+    ,math    .bool_gset:N = \g_@@_math_bool
+    ,math    .usage:n     =  preamble
+    ,no-math .bool_gset_inverse:N = \g_@@_math_bool
+    ,no-math .usage:n             =  preamble
+    ,config  .bool_gset:N = \g_@@_cfg_bool
+    ,config  .usage:n     = load
+    ,no-config  .bool_gset_inverse:N = \g_@@_cfg_bool
+    ,no-config  .usage:n             = load
+    ,euenc  .code:n = { \msg_warning:nnn   {fontspec} {enc-obsolete}{euenc} }    
+    ,tuenc  .code:n = { \msg_warning:nnn   {fontspec} {enc-obsolete}{tuenc} }    
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareOption {quiet}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { info }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
-\DeclareOption{silent}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { none }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
+    ,quiet .code:n = 
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { info }
+        \msg_redirect_module:nnn { fontspec } { info } { none }
+      }
+    ,silent .code:n = 
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { none }
+        \msg_redirect_module:nnn { fontspec } { info } { none }
+      }
+    ,verbose .code:n = 
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { warning }
+        \msg_redirect_module:nnn { fontspec } { info } { info }      
+      }  
+  }        
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\ExecuteOptions{config,math,tuenc}
-\ProcessOptions*
+\SetKeys{config,math}
+\ProcessKeyOptions
 %    \end{macrocode}
 %
+% \iffalse
+%    \begin{macrocode}
+%</options>
+%<*fontspec>
+%    \end{macrocode}
+% \fi
 %
 %
-%
 % \subsection{Encodings}
 %
-% Soon to be the default, with a just-in-case check:
+% Now the default, with a just-in-case check:
 %    \begin{macrocode}
-\bool_if:NF \g_@@_euenc_bool
+\cs_if_exist:cF {T at TU}
   {
-    \file_if_exist:nTF {tuenc.def}
-      {
-        \cs_if_exist:cF {T at TU}
-          {
-            \@@_warning:n {tu-clash}
-            \DeclareFontEncoding{TU}{}{}
-            \DeclareFontSubstitution{TU}{lmr}{m}{n}
-          }
-      }
-      {
-        \@@_warning:n {tu-missing}
-        \bool_gset_true:N \g_@@_euenc_bool
-      }
+    \@@_warning:n {tu-clash}
+    \DeclareFontEncoding{TU}{}{}
+    \DeclareFontSubstitution{TU}{lmr}{m}{n}
   }
-\bool_if:NTF \g_@@_euenc_bool
-  {
-%<XE>    \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
-%<LU>    \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
-  }
-  { \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
+\tl_gset:Nn \g_fontspec_encoding_tl { TU }  
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -100,17 +99,7 @@
 % Something to do with \cmd\select at language\ ending up in the \texttt{.aux}
 % file which is read at the beginning of the document.
 %
-%    \begin{macrocode}
-\bool_if:NT \g_@@_euenc_bool
-  {
-%<LU>    \cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
-%<LU>    \cs_set:Npn \XeTeXpicfile {}
-    \RequirePackage{xunicode}
-%<LU>    \cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
-  }
-%    \end{macrocode}
 %
-%
 % \subsection{Generic functions}
 %
 % \begin{macro}{\FontspecSetCheckBoolTrue}
@@ -201,6 +190,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -10,6 +10,22 @@
 %
 %
 %
+% \begin{macro}{\@@_define_opentype_variation_axis:nn}
+%    \begin{macrocode}
+\cs_new:Nn \@@_define_opentype_variation_axis:nn
+  {
+    \keys_define:nn {fontspec-opentype}
+      {
+        #1 .code:n = {
+          \prop_gput:Nnn \g_@@_rawvariations_prop { #2 } { ##1 }
+        },
+        #1 .value_required:n = true,
+        #1 .groups:n = {opentype},
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@@_define_opentype_feature_group:n}
 %    \begin{macrocode}
 \cs_new:Nn \@@_define_opentype_feature_group:n
@@ -466,6 +482,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-scripts.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-scripts.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-scripts.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -37,7 +37,7 @@
 \newfontscript{CJK~Ideographic}{hani}
 \newfontscript{Coptic}{copt}
 \newfontscript{Cypriot~Syllabary}{cprt}
-\newfontscript{Cypro~Minoan}{cpmn}
+\newfontscript{Cypro-Minoan}{cpmn}
 \newfontscript{Cyrillic}{cyrl}
 \newfontscript{Default}{DFLT}
 \newfontscript{CustomDefault}{latn,DFLT}
@@ -71,6 +71,7 @@
 \newfontscript{Javanese}{java}
 \newfontscript{Kaithi}{kthi}
 \newfontscript{Kannada}{knd2,knda}
+\newfontscript{Kawi}{kawi}
 \newfontscript{Kayah~Li}{kali}
 \newfontscript{Kharosthi}{khar}
 \newfontscript{Khitan~Small~Script}{kits}
@@ -92,7 +93,7 @@
 \newfontscript{Mandaic}{mand}
 \newfontscript{Manichaean}{mani}
 \newfontscript{Marchen}{marc}
-\newfontscript{Masaram Gondi}{gonm}
+\newfontscript{Masaram~Gondi}{gonm}
 \newfontscript{Math}{math}
 \newfontscript{Medefaidrin}{medf}
 \newfontscript{Meitei~Mayek}{mtei}
@@ -108,6 +109,7 @@
 \newfontscript{Myanmar}{mym2,mymr}
 \newfontscript{N'Ko}{nko~}
 \newfontscript{Nabataean}{nbat}
+\newfontscript{Nag~Mundari}{nagm}
 \newfontscript{Nandinagari}{nand}
 \newfontscript{Newa}{newa}
 \newfontscript{Nushu}{nshu}
@@ -195,6 +197,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-user.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-user.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-user.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -540,6 +540,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -4,6 +4,7 @@
 %
 % \iffalse
 %    \begin{macrocode}
+%<@@=fontspec>
 %<*fontspec>
 %    \end{macrocode}
 % \fi
@@ -50,9 +51,12 @@
 %    \end{macrocode}
 % For package options:
 %    \begin{macrocode}
+%</fontspec>
+%<*options>
 \bool_new:N \g_@@_cfg_bool
 \bool_new:N \g_@@_math_bool
-\bool_new:N \g_@@_euenc_bool
+%</options>
+%<*fontspec>
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -63,6 +67,7 @@
 \bool_new:N \l_@@_defining_encoding_bool
 \bool_new:N \l_@@_scriptlang_exist_bool
 \bool_new:N \g_@@_em_normalise_slant_bool
+\bool_new:N \l_@@_external_kpse_bool
 \bool_new:N \l_@@_proceed_bool
 %    \end{macrocode}
 %
@@ -151,6 +156,7 @@
 \prop_new:N \g_@@_strong_prop
 \prop_new:N \g_@@_fontid_family_prop
 \prop_new:N \g_@@_family_int_prop
+\prop_new:N \g_@@_rawvariations_prop
 %    \end{macrocode}
 %
 % \paragraph{Token lists}
@@ -288,11 +294,13 @@
 \tl_new:N \l_@@_punctspace_adjust_tl
 \tl_new:N \l_@@_wordspace_adjust_tl
 \tl_new:N \l_@@_postadjust_tl
+\tl_new:N \g_@@_instance_tl
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \tl_const:Nn \c_@@_hexcol_tl {000000}
-\tl_const:Nn \c_@@_opacity_tl {FF~}
+%<XE> \tl_const:Nn \c_@@_opacity_tl {FF~}
+%<LU> \tl_const:Nn \c_@@_opacity_tl {}
 \tl_const:Nn \c_@@_postadjust_tl { \l_@@_wordspace_adjust_tl \l_@@_punctspace_adjust_tl }
 %    \end{macrocode}
 %
@@ -328,6 +336,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-xfss.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-xfss.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-xfss.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -151,6 +151,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -30,6 +30,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -339,6 +339,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -204,6 +204,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -330,7 +330,7 @@
 (For example, if you set the colour in a \verb|\setmainfont| command, \verb|\color{...}| and related commands, including hyperlink colouring, will no longer have any effect on text in this font.)
 Therefore, \pkg{fontspec}'s colour commands are best used to set explicit colours in specific situations, and the \pkg{xcolor} package is recommended for more general colour functionality.
 
-The colour is defined as a triplet of two-digit Hex RGB
+The colour can be defined as a triplet of two-digit Hex RGB
 values, with optionally another value for the transparency (where
 |00| is completely transparent and |FF| is opaque.)
 \begin{Lexample}{color}{Selecting colour with transparency.}
@@ -341,8 +341,6 @@
   {\addfontfeature{Color=DDBB2299}P}\kern-0.5ex
   {\addfontfeature{Color=00BB3399}R}
 \end{Lexample}
-Transparency is supported by \LuaLaTeX; \XeLaTeX\ with the \texttt{xdvipdfmx} driver
-does not support this feature.
 
 If you load the \pkg{xcolor} package, you may use any named colour instead
 of writing the colours in hexadecimal.
@@ -353,23 +351,68 @@
  \definecolor{Foo}{rgb}{0.3,0.4,0.5}
  \fontspec[Color=Foo]{Verdana} ...
 \end{Verbatim}
-The \pkg{color} package is \emph{not} supported; use \pkg{xcolor} instead.
 
-You may specify the transparency with a named colour using the \feat{Opacity}
-feature which takes an decimal from zero to one corresponding to
-transparent to opaque respectively:
+You may also use named colours defined with the color commands of the L3 
+programming layer:
 \begin{Verbatim}
+ \ExplSyntaxOn
+ \color_set:nnn{Foo}{rgb}{0.3,0.4,0.5}
+\ExplSyntaxOff
+ ...
+ \fontspec[Color=Foo]{Verdana} ...
+\end{Verbatim}
+
+Color expressions (\verb+red!50!blue+) are not supported. The \pkg{color} 
+package is \emph{not} supported neither. 
+
+The code will at first test for color names of the L3 layer, then for xcolor 
+names and at last try to use the argument as a hexadecimal value.
+
+You may specify the transparency with a named colour using the \feat{Opacity} 
+feature which takes an decimal from zero to one corresponding to transparent 
+to opaque respectively: 
+\begin{Verbatim}
  \fontspec[Color=red,Opacity=0.7]{Verdana} ...
 \end{Verbatim}
 It is still possible to specify a colour in six-char hexadecimal form
 while defining opacity in this way, if you like.
 
+\subsubsection{Color models}
+
+With \XeTeX\ color are always written in the rgb color model into the PDF. 
+When using \LuaTeX, colors with the commands of the L3 layer can be written 
+as rgb or cmyk or as spot color depending on their definition and of the 
+value of the variable \verb+\l_color_fixed_model_tl+. 
+ 
+\subsubsection{Spot colors} 
+With \LuaTeX\ it is possible to use spot colors. This requires the use of the 
+PDF management:
+\begin{Verbatim}
+\DocumentMetadata{}
+\documentclass{article}
+\usepackage{fontspec}
+\ExplSyntaxOn
+ \color_model_new:nnn { sepblue } { Separation }
+    {
+      name = PANTONE~3005~U ,
+      alternative-model = cmyk ,
+      alternative-values = {1, 0.56, 0,0},
+    }
+ \color_set:nnn{spotblue}{sepblue}{1}
+\ExplSyntaxOff
+...
+\fontspec[Color=spotblue]{texgyreheros}
+\end{Verbatim}
+
+ 
+
 \subsection{Scale}
 
 \cmdbox{
  \feat{Scale} = \meta{number} \\
  \feat{Scale} = \opt{MatchLowercase} \\
- \feat{Scale} = \opt{MatchUppercase}
+ \feat{Scale} = \opt{MatchUppercase} \\
+ \feat{Scale} = \opt{MatchAveragecase}
 }
 
 In its explicit form, \feat{Scale} takes a single
@@ -377,18 +420,21 @@
 in \exref{fontload}.
 
 As well as a numerical argument, the \feat{Scale} feature
-also accepts options \opt{MatchLowercase}
-and \opt{MatchUppercase}, which will scale the font being selected to match
-the current default roman font to either the height of the lowercase or
-uppercase letters, respectively; these features are shown in \exref{scale}.
+also accepts options \opt{MatchLowercase}, \opt{MatchUppercase},
+and \opt{MatchAveragecase}, which will scale the font being selected to match
+the current default roman font to either the height of the lowercase,
+the height of the uppercase letters, or the average of the two,
+respectively; these features are shown in \exref{scale}.
 The amount of scaling used in each instance is reported in the \texttt{.log} file.
 
 \begin{Xexample}{scale}{Automatically calculated scale values.}
-  \setmainfont{Georgia}
-  \newfontfamily\lc[Scale=MatchLowercase]{Verdana}
+  \setmainfont{texgyrepagella-regular.otf}
+  \newfontfamily\lc[Scale=MatchLowercase]{texgyreadventor-regular.otf}
    The perfect match {\lc is hard to find.}\\
-  \newfontfamily\uc[Scale=MatchUppercase]{Arial}
-   L O G O \uc F O N T
+  \newfontfamily\uc[Scale=MatchUppercase]{texgyreheros-regular.otf}
+   L O G O {\uc F O N T}\\
+  \newfontfamily\ac[Scale=MatchAveragecase]{FiraMath-Regular.otf}
+   Lower {\ac and UPPER} CASE
 \end{Xexample}
 
 Additional calls to the \feat{Scale} feature overwrite the settings of the former.
@@ -400,7 +446,8 @@
   [ Scale = 1.1 , ScaleAgain = 1.2 ] % -> scale of 1.32
 \end{Verbatim}
 
-Note that when |Scale=MatchLowercase| is used with |\setmainfont|, the new `main'
+Note that when |Scale=MatchLowercase|, |Scale=MatchUppercase|, or |Scale=MatchAverageCase|
+is used with |\setmainfont|, the new `main'
 font of the document will be scaled to match the old default.
 If you wish to automatically scale all fonts except have the main font use `natural'
 scaling, you may write
@@ -608,6 +655,90 @@
 In particular, small amounts of letter spacing can be very useful, when setting small caps or all caps titles.
 Also see the OpenType \opt{Uppercase} option of the \feat{Letters} feature (\vref{sec:letters}).
 
+
+\section{Variable fonts} \label{sec:variable}
+
+OpenType variable fonts and Multiple Master fonts are parameterised over
+orthogonal font axes, allowing continuous selection along such features
+as weight, width, and optical size.
+
+Currently OpenType variable fonts are only supported in \LuaTeX, while
+Multiple Master fonts only work with \XeTeX.
+
+\subsection{Optical font sizes} \label{sec:aat-opticalsize}
+Whereas traditional OpenType fonts will have only a few separate
+optical sizes, a Variable or Multiple Master font's optical size can be
+specified over a continuous range. Unfortunately, this flexibility makes
+it harder to create an automatic interface through \LaTeX, and the
+optical size for a Variable or Multiple Master font must always be specified
+explicitly.
+\begin{Verbatim}
+  \fontspec{Minion MM Roman}[OpticalSize=11]
+   MM optical size test                    \\
+  \fontspec{Minion MM Roman}[OpticalSize=47]
+   MM optical size test                    \\
+  \fontspec{Minion MM Roman}[OpticalSize=71]
+   MM optical size test                    \\
+\end{Verbatim}
+
+
+\subsection{Weight} \label{sec:variable-weight}
+For fonts with a variable weight axis, the weight can be specified through the
+\feat{Weight} feature. The value should be between 0 and 1000, where typically
+400 corresponds to regular wight and 700 is a bold font.
+\begin{Verbatim}
+  \fontspec{Source Serif Variable}[Weight=700]
+  Bold                                     \\
+  \fontspec{Source Serif Variable}[Weight=200]
+  Extra Light                              \\
+\end{Verbatim}
+
+
+\subsection{Width} \label{sec:variable-width}
+Similarly, the \feat{Width} feature allows specifying the value of the width axis,
+where the value is a percentage of normal width.
+\begin{Verbatim}
+  \fontspec{Noto Serif}[Width=100]
+  Normal Width                             \\
+  \fontspec{Noto Serif}[Width=75]
+  Condensed                                \\
+\end{Verbatim}
+
+\subsection{Slant} \label{sec:variable-slant}
+Also fonts with a slant axis can be controlled with the \feat{Slant} feature.
+In a standard compliant font the value should specify the clockwise angle in degree
+the glyphs are slanted. Therefore for a typical forward leaning slanted font, a
+negative value should be passed.
+
+Many fonts use this feature in non-standard ways, so you might have to experiment
+a bit with the value.
+\begin{Verbatim}
+  \fontspec{Roboto Flex}[Slant=0]
+  Upright                            \\
+  \fontspec{Roboto Flex}[Slant=-5]
+  Slanted                            \\
+\end{Verbatim}
+
+\subsection{Other axes} \label{sec:variable-raw}
+For OpenType variable fonts, additional axis values can be specified
+if the four letter tag of these axes is known.
+Than their value can be set with the \feat{RawAxis} feature:
+\begin{Verbatim}
+  \fontspec{Noto Serif}[RawAxis={CTGR=100}]
+  Maximal contrast                        \\
+  \fontspec{Noto Serif}[RawAxis={CTGR=0}]
+  Regular contrast                        \\
+\end{Verbatim}
+
+\subsection{Instances} \label{sec:variable-instances}
+Instead of manually setting axis values, many fonts contain named instances which are predefined settings of all axes.
+
+To select such an instance, the \feat{Instance} feature can be used:
+\begin{Verbatim}
+  \fontspec{Noto Serif}[Instance=ExtraCondensed Bold]
+  This is in extra condensed bold.
+\end{Verbatim}
+
 \end{document}
 
 % /©
@@ -614,6 +745,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -129,6 +129,7 @@
 In this case, it is more convenient to load them from a different location on your disk.
 This technique is also necessary in \XeTeX\ when loading OpenType fonts that are present within your \TeX\ distribution, such as \path{/usr/local/texlive/2013/texmf-dist/fonts/opentype/public}.
 Fonts in such locations are visible to \XeTeX\ but cannot be loaded by font name, only file name; \LuaTeX\ does not have this restriction.
+(If you for some reason want to restrict the fonts to the ones provided by your \TeX\ distribution even though you are using \LuaTeX\ you can use the \texttt{KpseOnly} option)
 
 When selecting fonts by file name, any font that can be found in the default
 search paths may be used directly (including in the current directory)
@@ -641,6 +642,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -75,17 +75,19 @@
   \usepackage{fontspec}
 \end{Verbatim}
 Package options will be introduced below; some preliminary details are discussed first.
+Package options are setup with the in-built \LaTeX{} keyval options handler. This means
+that the package can be loaded more than once with different options without triggering
+an option clash error. The \texttt{config} and \texttt{no-config} option must be used in
+the first loading and are ignored later.
 
-
 \subsection{Font encodings}
 
-The (default) \texttt{tuenc} package option switches the \textsc{nfss} font encoding to \texttt{TU}.
+The package switches the \textsc{nfss} font encoding to \texttt{TU}.
 \texttt{TU} is a new Unicode font encoding, intended for both \XeTeX\ and \LuaTeX\ engines, and automatically contains support for symbols covered by \LaTeX's traditional \texttt{T1} and \texttt{TS1} font encodings (for example, |\%|, |\textbullet|, |\"u|, and so on).
 Some additional features are provided by \pkg{fontspec} to customise some encoding details; see Part~\vref{part:enc} for further details.
 
-Pre-2017 behaviour can be achieved with the \texttt{euenc} package option.
-This selects the \texttt{EU1} or \texttt{EU2} encoding (\XeTeX/\LuaTeX, resp.) and loads the \pkg{xunicode} package for symbol support.
-Package authors and users who have referred explicitly to the encoding names \texttt{EU1} or \texttt{EU2} should update their code or documents.
+Pre-2017 behaviour is now obsolete. The \texttt{euenc} and \texttt{tuenc} package options are
+ignored. Package authors and users who have referred explicitly to the encoding names \texttt{EU1} or \texttt{EU2} should update their code or documents.
 (See internal variable names described in \vref{sec:api} for how to do this properly.)
 
 
@@ -108,7 +110,7 @@
 To customise \pkg{fontspec} to your liking, use the standard |.cfg| file as a starting point or write your own from scratch, then either place it in the same folder as the main document for isolated cases, or in a location
 that \XeTeX\ or \LuaTeX\ searches by default; \eg\ in Mac\TeX: \path{~/Library/texmf/tex/latex/}.
 
-The package option |no-config| will suppress the loading of the |fontspec.cfg| file under all circumstances.
+The package option |no-config| will suppress the loading of the |fontspec.cfg| file under all circumstances. Both options must be used the first time \pkg{fontspec} is loaded and are ignored in later calls.
 
 
 \subsection{Warnings}
@@ -121,8 +123,8 @@
 Use the |silent| package option to completely suppress these warnings if you
 don't even want the |.log| file cluttered up.
 
+Both options can also be used with \cs{Setkeys} in the document. Use the |verbose| option to get activate the warnings again.
 
-
 \section{Interaction with \LaTeXe\ and other packages}
 
 This section documents some areas of adjustment that \pkg{fontspec} makes
@@ -184,6 +186,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -81,6 +81,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -1467,6 +1467,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex	2024-02-13 23:46:54 UTC (rev 69833)
@@ -58,27 +58,6 @@
 select the \opt{OpenType} renderer.}
 
 
-\subsection{Optical font sizes} \label{sec:aat-opticalsize}
-
-Multiple Master fonts are parameterised over
-orthogonal font axes, allowing continuous selection along such
-features as weight, width, and optical size.
-Whereas an OpenType font will have only a few separate
-optical sizes, a Multiple Master font's optical size can be
-specified over a continuous range. Unfortunately, this flexibility makes
-it harder to create an automatic interface through \LaTeX, and the
-optical size for a Multiple Master font must always be specified
-explicitly.
-\begin{Verbatim}
-  \fontspec{Minion MM Roman}[OpticalSize=11]
-   MM optical size test                    \\
-  \fontspec{Minion MM Roman}[OpticalSize=47]
-   MM optical size test                    \\
-  \fontspec{Minion MM Roman}[OpticalSize=71]
-   MM optical size test                    \\
-\end{Verbatim}
-
-
 \subsection{Vertical typesetting}
 
 \XeTeX\ provides for vertical typesetting simply with the ability to rotate
@@ -282,6 +261,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -89,6 +89,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -70,7 +70,7 @@
 \ProvidesExplFile{fontspec.dtx}
 %</dtx>
 %<*fontspec>
-  {2022/01/15}{2.8a}{Font selection for XeLaTeX and LuaLaTeX}
+  {2024/02/13}{2.9a}{Font selection for XeLaTeX and LuaLaTeX}
 %</fontspec>
 %    \end{macrocode}
 %
@@ -89,8 +89,8 @@
 %<lua>local fontspec    = fontspec
 %<lua>fontspec.module   = {
 %<lua>    name          = "fontspec",
-%<lua>    version       = "2.8a",
-%<lua>    date          = "2022/01/15",
+%<lua>    version       = "2.9a",
+%<lua>    date          = "2024/02/13",
 %<lua>    description   = "Font selection for XeLaTeX and LuaLaTeX",
 %<lua>    author        = "Khaled Hosny, Philipp Gesang, Will Robertson",
 %<lua>    copyright     = "Khaled Hosny, Philipp Gesang, Will Robertson",
@@ -104,6 +104,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins	2024-02-13 23:46:54 UTC (rev 69833)
@@ -32,6 +32,9 @@
 
 \generate{\file{fontspec.sty}{
   \from{fontspec.dtx}{fontspec,load\FSDEBUG}
+  \from{fontspec-code-vars.dtx}{options}
+  \from{fontspec-code-msg.dtx}{options}
+  \from{fontspec-code-opening.dtx}{options}
   \from{fontspec-code-load.dtx}{fontspec,load\FSDEBUG}
 }}
 
@@ -48,6 +51,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx	2024-02-13 23:46:54 UTC (rev 69833)
@@ -28,6 +28,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
+% Copyright  2022-2023  The LaTeX project
 % Copyright  2004-2022  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2024-02-13 23:46:54 UTC (rev 69833)
@@ -40,7 +40,7 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-luatex}%
-  {2022/01/15}{2.8a}{Font selection for XeLaTeX and LuaLaTeX}
+  {2024/02/13}{2.9a}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -60,9 +60,6 @@
 \bool_new:N \g__fontspec_math_euler_bool
 \bool_new:N \g__fontspec_math_lucida_bool
 \bool_new:N \g__fontspec_pkg_euler_loaded_bool
-\bool_new:N \g__fontspec_cfg_bool
-\bool_new:N \g__fontspec_math_bool
-\bool_new:N \g__fontspec_euenc_bool
 \bool_new:N \l__fontspec_tmpa_bool
 \bool_new:N \l__fontspec_disable_defaults_bool
 \bool_new:N \l__fontspec_alias_bool
@@ -70,6 +67,7 @@
 \bool_new:N \l__fontspec_defining_encoding_bool
 \bool_new:N \l__fontspec_scriptlang_exist_bool
 \bool_new:N \g__fontspec_em_normalise_slant_bool
+\bool_new:N \l__fontspec_external_kpse_bool
 \bool_new:N \l__fontspec_proceed_bool
 \bool_new:N \l__fontspec_never_check_bool
 \int_new:N \l__fontspec_script_int
@@ -122,6 +120,7 @@
 \prop_new:N \g__fontspec_strong_prop
 \prop_new:N \g__fontspec_fontid_family_prop
 \prop_new:N \g__fontspec_family_int_prop
+\prop_new:N \g__fontspec_rawvariations_prop
 \tl_new:N \l_fontspec_family_tl
 \tl_new:N \g_fontspec_encoding_tl
 \tl_new:N \l_fontspec_fontname_tl
@@ -197,8 +196,9 @@
 \tl_new:N \l__fontspec_punctspace_adjust_tl
 \tl_new:N \l__fontspec_wordspace_adjust_tl
 \tl_new:N \l__fontspec_postadjust_tl
+\tl_new:N \g__fontspec_instance_tl
 \tl_const:Nn \c__fontspec_hexcol_tl {000000}
-\tl_const:Nn \c__fontspec_opacity_tl {FF~}
+ \tl_const:Nn \c__fontspec_opacity_tl {}
 \tl_const:Nn \c__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl }
 \tl_new:N \g__fontspec_rawfeatures_sclist
 \tl_new:N \l__fontspec_pre_feat_sclist
@@ -213,6 +213,7 @@
 \cs_new:Npn \__fontspec_error:n     { \msg_error:nn     {fontspec} }
 \cs_new:Npn \__fontspec_error:nn    { \msg_error:nnn    {fontspec} }
 \cs_new:Npn \__fontspec_error:nx    { \msg_error:nnx    {fontspec} }
+\cs_new:Npn \__fontspec_error:nxx   { \msg_error:nnxx    {fontspec} }
 \cs_new:Npn \__fontspec_warning:n   { \msg_warning:nn   {fontspec} }
 \cs_new:Npn \__fontspec_warning:nx  { \msg_warning:nnx  {fontspec} }
 \cs_new:Npn \__fontspec_warning:nxx { \msg_warning:nnxx {fontspec} }
@@ -374,10 +375,6 @@
   Input mapping not supported in LuaTeX.\\
   Use "Ligatures=TeX" instead of "Mapping=tex-text".
  }
-\__fontspec_msg_new:nn {cm-default-obsolete}
- {
-  The "cm-default" package option is obsolete.
- }
 \__fontspec_msg_new:nn {font-index-needs-ttc}
  {
   The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
@@ -432,49 +429,13 @@
 \char_set_catcode_ignore:n {32}
 
 %%^^A%%  fontspec-code-opening.dtx -- part of FONTSPEC <wspr.io/fontspec>
-\DeclareOption{cm-default}
+\cs_if_exist:cF {T at TU}
   {
-    \__fontspec_warning:n {cm-default-obsolete}
+    \__fontspec_warning:n {tu-clash}
+    \DeclareFontEncoding{TU}{}{}
+    \DeclareFontSubstitution{TU}{lmr}{m}{n}
   }
-\DeclareOption {math}     { \bool_gset_true:N  \g__fontspec_math_bool  }
-\DeclareOption {no-math}  { \bool_gset_false:N \g__fontspec_math_bool  }
-\DeclareOption {config}   { \bool_gset_true:N  \g__fontspec_cfg_bool   }
-\DeclareOption {no-config}{ \bool_gset_false:N \g__fontspec_cfg_bool   }
-\DeclareOption {euenc}    { \bool_gset_true:N  \g__fontspec_euenc_bool }
-\DeclareOption {tuenc}    { \bool_gset_false:N \g__fontspec_euenc_bool }
-\DeclareOption {quiet}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { info }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
-\DeclareOption{silent}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { none }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
-\ExecuteOptions{config,math,tuenc}
-\ProcessOptions*
-\bool_if:NF \g__fontspec_euenc_bool
-  {
-    \file_if_exist:nTF {tuenc.def}
-      {
-        \cs_if_exist:cF {T at TU}
-          {
-            \__fontspec_warning:n {tu-clash}
-            \DeclareFontEncoding{TU}{}{}
-            \DeclareFontSubstitution{TU}{lmr}{m}{n}
-          }
-      }
-      {
-        \__fontspec_warning:n {tu-missing}
-        \bool_gset_true:N \g__fontspec_euenc_bool
-      }
-  }
-\bool_if:NTF \g__fontspec_euenc_bool
-  {
-    \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
-  }
-  { \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
+\tl_gset:Nn \g_fontspec_encoding_tl { TU }
 \tl_set:Nn \rmdefault {lmr}
 \tl_set:Nn \sfdefault {lmss}
 \tl_set:Nn \ttdefault {lmtt}
@@ -488,13 +449,6 @@
     \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
     \tl_set_eq:NN \latinencoding    \g_fontspec_encoding_tl
   }
-\bool_if:NT \g__fontspec_euenc_bool
-  {
-    \cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
-    \cs_set:Npn \XeTeXpicfile {}
-    \RequirePackage{xunicode}
-    \cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
-  }
 \cs_new:Npn \FontspecSetCheckBoolTrue  { \bool_set_true:N  \l__fontspec_check_bool }
 \cs_new:Npn \FontspecSetCheckBoolFalse { \bool_set_false:N \l__fontspec_check_bool }
 \cs_new:Nn \__fontspec_keys_set_known:nnN
@@ -541,7 +495,7 @@
   {
     \int_set:Nn \suppressfontnotfounderror {1}
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_if_null:N {p,TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_if_null:N {p,TF,T,F}
   {
     \ifx #1 \nullfont
       \prg_return_true:
@@ -549,12 +503,12 @@
       \prg_return_false:
     \fi
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_set:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_set:Nnn {TF,T,F}
   {
     \__fontspec_primitive_font_set:Nnn #1 {#2} {#3}
     \__fontspec_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_gset:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_gset:Nnn {TF,T,F}
   {
     \__fontspec_primitive_font_gset:Nnn #1 {#2} {#3}
     \__fontspec_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
@@ -563,7 +517,7 @@
 \cs_set:Npn \__fontspec_primitive_font_set:OnnF  { \exp_last_unbraced:No \__fontspec_primitive_font_set:NnnF }
 \cs_set:Npn \__fontspec_primitive_font_gset:Onn  { \exp_last_unbraced:No \__fontspec_primitive_font_gset:Nnn }
 \cs_set:Npn \__fontspec_primitive_font_gset:OnnF { \exp_last_unbraced:No \__fontspec_primitive_font_gset:NnnF }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_if_exist:n {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_if_exist:n {TF,T,F}
   {
     \group_begin:
       \__fontspec_font_suppress_not_found_error:
@@ -1386,12 +1340,16 @@
   }
 \cs_new:Nn \__fontspec_font_is_name:
   {
-    \cs_set_eq:NN \__fontspec_fontname_wrap:n \use:n
+  \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { name: ##1 }
   }
 \cs_new:Nn \__fontspec_font_is_file:
   {
     \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { [ \l__fontspec_font_path_tl ##1 ] }
   }
+\cs_new:Nn \__fontspec_font_is_kpse:
+  {
+    \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { kpse: ##1 }
+  }
 \cs_new:Nn \__fontspec_set_scriptlang:
   {
     \bool_if:NT \l__fontspec_firsttime_bool
@@ -1416,7 +1374,7 @@
 
     \str_if_eq:eeF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl }
                      { \c__fontspec_hexcol_tl \c__fontspec_opacity_tl }
-      { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } }
+       { \__fontspec_update_featstr:n { color = {\l__fontspec_hexcol_tl\l__fontspec_opacity_tl} } }
   }
 \prg_new_conditional:Nnn \__fontspec_save_family_needed:n { TF }
   {
@@ -1471,7 +1429,7 @@
     \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {fontdef}
       {
         \__fontspec_construct_font_call:nn {\l_fontspec_fontname_tl}
-          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
+          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist \__fontspec_get_variations: }
       }
     \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-num} \l__fontspec_script_int
     \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-num}   \l__fontspec_language_int
@@ -1560,7 +1518,7 @@
     \group_begin:
     \__fontspec_primitive_font_set:Nnn \l__fontspec_tmpa_font { \__fontspec_construct_font_call:nn {#1}   { \l__fontspec_pre_feat_sclist } } { \f at size pt + 1sp }
     \__fontspec_primitive_font_set:Nnn \l__fontspec_tmpb_font { \__fontspec_construct_font_call:nn {#1#2} { \l__fontspec_pre_feat_sclist } } { \f at size pt + 1sp }
-    \str_if_eq:eeTF { \__fontspec_primitive_font_get_name:N \l__fontspec_tmpa_font } { \__fontspec_primitive_font_get_name:N \l__fontspec_tmpb_font }
+    \cs_if_eq:NNTF \l__fontspec_tmpa_font \l__fontspec_tmpb_font
       { \group_end: \prg_return_false: }
       { \group_end: \prg_return_true: }
   }
@@ -1657,7 +1615,7 @@
       {
         <\l__fontspec_size_tl> \l__fontspec_scale_tl
         \__fontspec_construct_font_call:nn { \l_fontspec_fontname_tl }
-          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
+          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist \__fontspec_get_variations: }
       }
   }
 \cs_new:Nn \__fontspec_declare_shapes_normal:nn
@@ -1802,6 +1760,26 @@
       }
   }
 \cs_generate_variant:Nn \__fontspec_remove_clashing_featstr:n {x}
+\cs_generate_variant:Nn \tl_tail:n { e }
+\cs_new:Nn \__fontspec_format_axis:nn
+  {
+    , #1 = #2
+  }
+\cs_new:Nn \__fontspec_get_variations:
+  {
+    \tl_if_empty:NF \g__fontspec_instance_tl
+      {
+        instance = { \g__fontspec_instance_tl };
+      }
+      \prop_if_empty:NF \g__fontspec_rawvariations_prop
+      {
+        axis = {
+          \tl_tail:e {
+            \prop_map_function:NN \g__fontspec_rawvariations_prop \__fontspec_format_axis:nn
+          }
+        };
+      }
+  }
 \cs_set:Npn \__fontspec_init:
   {
     \bool_set_false:N \l__fontspec_ot_bool
@@ -1823,6 +1801,8 @@
 \cs_new:Nn \__fontspec_init_fontface:
   {
     \tl_gclear:N \g__fontspec_rawfeatures_sclist
+    \prop_gclear:N \g__fontspec_rawvariations_prop
+    \tl_gclear:N \g__fontspec_instance_tl
     \tl_clear:N \l__fontspec_scale_tl
     \tl_set_eq:NN \l__fontspec_opacity_tl \c__fontspec_opacity_tl
     \tl_set_eq:NN \l__fontspec_hexcol_tl \c__fontspec_hexcol_tl
@@ -1849,6 +1829,17 @@
 
 %%^^A%%  fontspec-code-opentype.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
+\cs_new:Nn \__fontspec_define_opentype_variation_axis:nn
+  {
+    \keys_define:nn {fontspec-opentype}
+      {
+        #1 .code:n = {
+          \prop_gput:Nnn \g__fontspec_rawvariations_prop { #2 } { ##1 }
+        },
+        #1 .value_required:n = true,
+        #1 .groups:n = {opentype},
+      }
+  }
 \cs_new:Nn \__fontspec_define_opentype_feature_group:n
   {
     \keys_define:nn {fontspec-opentype} { #1 .multichoice: , .groups:n = {opentype} }
@@ -2147,7 +2138,13 @@
     \bool_set_true:N \l__fontspec_noit_bool
     \bool_set_true:N \l__fontspec_external_bool
     \tl_set:Nn \l__fontspec_font_path_tl {#1}
-    \__fontspec_font_is_file:
+    \bool_lazy_and:nnTF { \l__fontspec_external_kpse_bool } { \tl_if_empty_p:N \l__fontspec_font_path_tl }
+      {
+        \__fontspec_font_is_kpse:
+      }
+      {
+        \__fontspec_font_is_file:
+      }
   }
 \aliasfontfeature{Path}{ExternalLocation}
 \__fontspec_keys_define_code:nnn {fontspec} {Path} {}
@@ -2161,6 +2158,15 @@
   }
 \tl_clear:N \l__fontspec_extension_tl
 \__fontspec_keys_define_code:nnn {fontspec} {Extension} {}
+\__fontspec_keys_define_code:nnn {fontspec-preparse-external} {KpseOnly}
+  {
+    \bool_set_true:N \l__fontspec_external_kpse_bool
+    \bool_if:NT \l__fontspec_external_bool
+      {
+        \__fontspec_font_is_kpse:
+      }
+  }
+\__fontspec_keys_define_code:nnn {fontspec} {KpseOnly} {}
 \keys_define:nn {fontspec-renderer}
   {
     Renderer .choices:nn =
@@ -2391,8 +2397,10 @@
       {
         {MatchLowercase} { \__fontspec_calc_scale:n {5} }
         {MatchUppercase} { \__fontspec_calc_scale:n {8} }
+        {MatchAveragecase} { \__fontspec_calc_scale:nn {5} {8} }
       }
       { \tl_set:Nx \l__fontspec_scale_tl {#1} }
+      \__fontspec_info:n {set-scale}
   }
 \__fontspec_keys_define_code:nnn {fontspec} {ScaleAgain}
   {
@@ -2417,11 +2425,24 @@
                        \dim_to_fp:n {\l__fontspec_tmpb_dim}   }
         }
 
-      \__fontspec_info:n {set-scale}
       \exp_args:NNNx
     \group_end:
     \tl_set:Nx \l__fontspec_scale_tl { \l__fontspec_scale_tl }
   }
+\cs_new:Nn \__fontspec_calc_scale:nn
+{
+    \group_begin:
+      \__fontspec_calc_scale:n {#1}
+      \tl_set_eq:NN \l__fontspec_tmp_tl \l__fontspec_scale_tl
+      \__fontspec_calc_scale:n {#2}
+      \tl_set:Nx \l__fontspec_scale_tl
+        {
+          \fp_eval:n { (\l__fontspec_tmp_tl + \l__fontspec_scale_tl)/2 }
+        }
+      \exp_args:NNNx
+    \group_end:
+    \tl_set:Nx \l__fontspec_scale_tl { \l__fontspec_scale_tl }
+  }
 \cs_new:Nn \__fontspec_set_font_dimen:NnN
   {
     \dim_set:Nn #1 { \fontdimen #2 #3 }
@@ -2519,19 +2540,25 @@
 \__fontspec_aff_error:n {HyphenChar}
 \__fontspec_keys_define_code:nnn {fontspec} {Color}
   {
-    \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+    \color_if_exist:nTF {#1}
       {
-        \convertcolorspec{named}{#1}{HTML}\l__fontspec_hexcol_tl
+        \tl_set:Nn \l__fontspec_hexcol_tl {#1}
       }
       {
-        \int_compare:nTF { \tl_count:n {#1} == 6 }
-          { \tl_set:Nn \l__fontspec_hexcol_tl {#1} }
+        \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
           {
-            \int_compare:nTF { \tl_count:n {#1} == 8 }
-              { \fontspec_parse_colour:viii #1 }
+            \convertcolorspec{named}{#1}{HTML}\l__fontspec_hexcol_tl
+          }
+          {
+            \int_compare:nTF { \tl_count:n {#1} == 6 }
+              { \tl_set:Nn \l__fontspec_hexcol_tl {#1} }
               {
-                \bool_if:NF \l__fontspec_firsttime_bool
-                  { \__fontspec_warning:nx {bad-colour} {#1} }
+                \int_compare:nTF { \tl_count:n {#1} == 8 }
+                  { \fontspec_parse_colour:viii #1 }
+                  {
+                    \bool_if:NF \l__fontspec_firsttime_bool
+                      { \__fontspec_warning:nx {bad-colour} {#1} }
+                  }
               }
           }
       }
@@ -2558,6 +2585,7 @@
       }
     \tl_set:Nx \l__fontspec_opacity_tl
       {
+      ,
         \int_compare:nT { \l__fontspec_tmp_int <= "F } {0} % zero pad
         \int_to_hex:n { \l__fontspec_tmp_int }
       }
@@ -2572,17 +2600,20 @@
       }
       { \__fontspec_warning:n {no-mapping} }
   }
-\__fontspec_keys_define_code:nnn {fontspec} {Weight}
+\__fontspec_define_opentype_variation_axis:nn {Weight} {wght}
+\__fontspec_define_opentype_variation_axis:nn {Width} {wdth}
+\__fontspec_define_opentype_variation_axis:nn {Slant} {slnt}
+\__fontspec_keys_define_code:nnn {fontspec} {OpticalSize}
   {
-    \__fontspec_update_featstr:n{weight=#1}
+    \tl_set:Nn \l__fontspec_optical_size_tl {/ S = #1}
   }
-\__fontspec_keys_define_code:nnn {fontspec} {Width}
+\__fontspec_keys_define_code:nnn {fontspec-opentype} {RawAxis}
   {
-    \__fontspec_update_featstr:n{width=#1}
+    \prop_gput_from_keyval:Nn \g__fontspec_rawvariations_prop {#1}
   }
-\__fontspec_keys_define_code:nnn {fontspec} {OpticalSize}
+\__fontspec_keys_define_code:nnn {fontspec-opentype} {Instance}
   {
-    \tl_set:Nn \l__fontspec_optical_size_tl {/ S = #1}
+    \tl_gset:Nn \g__fontspec_instance_tl {#1}
   }
 \keys_define:nn {fontspec}
   {
@@ -3061,7 +3092,7 @@
 \newfontscript{CJK~Ideographic}{hani}
 \newfontscript{Coptic}{copt}
 \newfontscript{Cypriot~Syllabary}{cprt}
-\newfontscript{Cypro~Minoan}{cpmn}
+\newfontscript{Cypro-Minoan}{cpmn}
 \newfontscript{Cyrillic}{cyrl}
 \newfontscript{Default}{DFLT}
 \newfontscript{CustomDefault}{latn,DFLT}
@@ -3095,6 +3126,7 @@
 \newfontscript{Javanese}{java}
 \newfontscript{Kaithi}{kthi}
 \newfontscript{Kannada}{knd2,knda}
+\newfontscript{Kawi}{kawi}
 \newfontscript{Kayah~Li}{kali}
 \newfontscript{Kharosthi}{khar}
 \newfontscript{Khitan~Small~Script}{kits}
@@ -3116,7 +3148,7 @@
 \newfontscript{Mandaic}{mand}
 \newfontscript{Manichaean}{mani}
 \newfontscript{Marchen}{marc}
-\newfontscript{Masaram Gondi}{gonm}
+\newfontscript{Masaram~Gondi}{gonm}
 \newfontscript{Math}{math}
 \newfontscript{Medefaidrin}{medf}
 \newfontscript{Meitei~Mayek}{mtei}
@@ -3132,6 +3164,7 @@
 \newfontscript{Myanmar}{mym2,mymr}
 \newfontscript{N'Ko}{nko~}
 \newfontscript{Nabataean}{nbat}
+\newfontscript{Nag~Mundari}{nagm}
 \newfontscript{Nandinagari}{nand}
 \newfontscript{Newa}{newa}
 \newfontscript{Nushu}{nshu}

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2024-02-13 23:46:54 UTC (rev 69833)
@@ -40,7 +40,7 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-xetex}%
-  {2022/01/15}{2.8a}{Font selection for XeLaTeX and LuaLaTeX}
+  {2024/02/13}{2.9a}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -60,9 +60,6 @@
 \bool_new:N \g__fontspec_math_euler_bool
 \bool_new:N \g__fontspec_math_lucida_bool
 \bool_new:N \g__fontspec_pkg_euler_loaded_bool
-\bool_new:N \g__fontspec_cfg_bool
-\bool_new:N \g__fontspec_math_bool
-\bool_new:N \g__fontspec_euenc_bool
 \bool_new:N \l__fontspec_tmpa_bool
 \bool_new:N \l__fontspec_disable_defaults_bool
 \bool_new:N \l__fontspec_alias_bool
@@ -70,6 +67,7 @@
 \bool_new:N \l__fontspec_defining_encoding_bool
 \bool_new:N \l__fontspec_scriptlang_exist_bool
 \bool_new:N \g__fontspec_em_normalise_slant_bool
+\bool_new:N \l__fontspec_external_kpse_bool
 \bool_new:N \l__fontspec_proceed_bool
 \bool_new:N \l__fontspec_never_check_bool
 \int_new:N \l__fontspec_script_int
@@ -122,6 +120,7 @@
 \prop_new:N \g__fontspec_strong_prop
 \prop_new:N \g__fontspec_fontid_family_prop
 \prop_new:N \g__fontspec_family_int_prop
+\prop_new:N \g__fontspec_rawvariations_prop
 \tl_new:N \l_fontspec_family_tl
 \tl_new:N \g_fontspec_encoding_tl
 \tl_new:N \l_fontspec_fontname_tl
@@ -197,8 +196,9 @@
 \tl_new:N \l__fontspec_punctspace_adjust_tl
 \tl_new:N \l__fontspec_wordspace_adjust_tl
 \tl_new:N \l__fontspec_postadjust_tl
+\tl_new:N \g__fontspec_instance_tl
 \tl_const:Nn \c__fontspec_hexcol_tl {000000}
-\tl_const:Nn \c__fontspec_opacity_tl {FF~}
+ \tl_const:Nn \c__fontspec_opacity_tl {FF~}
 \tl_const:Nn \c__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl }
 \tl_new:N \g__fontspec_rawfeatures_sclist
 \tl_new:N \l__fontspec_pre_feat_sclist
@@ -213,6 +213,7 @@
 \cs_new:Npn \__fontspec_error:n     { \msg_error:nn     {fontspec} }
 \cs_new:Npn \__fontspec_error:nn    { \msg_error:nnn    {fontspec} }
 \cs_new:Npn \__fontspec_error:nx    { \msg_error:nnx    {fontspec} }
+\cs_new:Npn \__fontspec_error:nxx   { \msg_error:nnxx    {fontspec} }
 \cs_new:Npn \__fontspec_warning:n   { \msg_warning:nn   {fontspec} }
 \cs_new:Npn \__fontspec_warning:nx  { \msg_warning:nnx  {fontspec} }
 \cs_new:Npn \__fontspec_warning:nxx { \msg_warning:nnxx {fontspec} }
@@ -374,10 +375,6 @@
   Input mapping not supported in LuaTeX.\\
   Use "Ligatures=TeX" instead of "Mapping=tex-text".
  }
-\__fontspec_msg_new:nn {cm-default-obsolete}
- {
-  The "cm-default" package option is obsolete.
- }
 \__fontspec_msg_new:nn {font-index-needs-ttc}
  {
   The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
@@ -432,49 +429,13 @@
 \char_set_catcode_ignore:n {32}
 
 %%^^A%%  fontspec-code-opening.dtx -- part of FONTSPEC <wspr.io/fontspec>
-\DeclareOption{cm-default}
+\cs_if_exist:cF {T at TU}
   {
-    \__fontspec_warning:n {cm-default-obsolete}
+    \__fontspec_warning:n {tu-clash}
+    \DeclareFontEncoding{TU}{}{}
+    \DeclareFontSubstitution{TU}{lmr}{m}{n}
   }
-\DeclareOption {math}     { \bool_gset_true:N  \g__fontspec_math_bool  }
-\DeclareOption {no-math}  { \bool_gset_false:N \g__fontspec_math_bool  }
-\DeclareOption {config}   { \bool_gset_true:N  \g__fontspec_cfg_bool   }
-\DeclareOption {no-config}{ \bool_gset_false:N \g__fontspec_cfg_bool   }
-\DeclareOption {euenc}    { \bool_gset_true:N  \g__fontspec_euenc_bool }
-\DeclareOption {tuenc}    { \bool_gset_false:N \g__fontspec_euenc_bool }
-\DeclareOption {quiet}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { info }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
-\DeclareOption{silent}
-  {
-    \msg_redirect_module:nnn { fontspec } { warning } { none }
-    \msg_redirect_module:nnn { fontspec } { info } { none }
-  }
-\ExecuteOptions{config,math,tuenc}
-\ProcessOptions*
-\bool_if:NF \g__fontspec_euenc_bool
-  {
-    \file_if_exist:nTF {tuenc.def}
-      {
-        \cs_if_exist:cF {T at TU}
-          {
-            \__fontspec_warning:n {tu-clash}
-            \DeclareFontEncoding{TU}{}{}
-            \DeclareFontSubstitution{TU}{lmr}{m}{n}
-          }
-      }
-      {
-        \__fontspec_warning:n {tu-missing}
-        \bool_gset_true:N \g__fontspec_euenc_bool
-      }
-  }
-\bool_if:NTF \g__fontspec_euenc_bool
-  {
-    \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
-  }
-  { \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
+\tl_gset:Nn \g_fontspec_encoding_tl { TU }
 \tl_set:Nn \rmdefault {lmr}
 \tl_set:Nn \sfdefault {lmss}
 \tl_set:Nn \ttdefault {lmtt}
@@ -488,10 +449,6 @@
     \tl_set_eq:NN \cyrillicencoding \g_fontspec_encoding_tl
     \tl_set_eq:NN \latinencoding    \g_fontspec_encoding_tl
   }
-\bool_if:NT \g__fontspec_euenc_bool
-  {
-    \RequirePackage{xunicode}
-  }
 \cs_new:Npn \FontspecSetCheckBoolTrue  { \bool_set_true:N  \l__fontspec_check_bool }
 \cs_new:Npn \FontspecSetCheckBoolFalse { \bool_set_false:N \l__fontspec_check_bool }
 \cs_new:Nn \__fontspec_keys_set_known:nnN
@@ -534,7 +491,7 @@
   {
     \int_set:Nn \suppressfontnotfounderror {1}
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_if_null:N {p,TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_if_null:N {p,TF,T,F}
   {
     \ifx #1 \nullfont
       \prg_return_true:
@@ -542,12 +499,12 @@
       \prg_return_false:
     \fi
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_set:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_set:Nnn {TF,T,F}
   {
     \__fontspec_primitive_font_set:Nnn #1 {#2} {#3}
     \__fontspec_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
   }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_gset:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_gset:Nnn {TF,T,F}
   {
     \__fontspec_primitive_font_gset:Nnn #1 {#2} {#3}
     \__fontspec_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
@@ -556,7 +513,7 @@
 \cs_set:Npn \__fontspec_primitive_font_set:OnnF  { \exp_last_unbraced:No \__fontspec_primitive_font_set:NnnF }
 \cs_set:Npn \__fontspec_primitive_font_gset:Onn  { \exp_last_unbraced:No \__fontspec_primitive_font_gset:Nnn }
 \cs_set:Npn \__fontspec_primitive_font_gset:OnnF { \exp_last_unbraced:No \__fontspec_primitive_font_gset:NnnF }
-\prg_set_conditional:Nnn \__fontspec_primitive_font_if_exist:n {TF,T,F}
+\prg_new_conditional:Nnn \__fontspec_primitive_font_if_exist:n {TF,T,F}
   {
     \group_begin:
       \__fontspec_font_suppress_not_found_error:
@@ -1378,12 +1335,13 @@
   }
 \cs_new:Nn \__fontspec_font_is_name:
   {
-    \cs_set_eq:NN \__fontspec_fontname_wrap:n \use:n
+  \cs_set_eq:NN \__fontspec_fontname_wrap:n \use:n
   }
 \cs_new:Nn \__fontspec_font_is_file:
   {
     \cs_set:Npn \__fontspec_fontname_wrap:n ##1 { [ \l__fontspec_font_path_tl ##1 ] }
   }
+\cs_new_eq:NN \__fontspec_font_is_kpse: \__fontspec_font_is_file:
 \cs_new:Nn \__fontspec_set_scriptlang:
   {
     \bool_if:NT \l__fontspec_firsttime_bool
@@ -1415,7 +1373,7 @@
 
     \str_if_eq:eeF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl }
                      { \c__fontspec_hexcol_tl \c__fontspec_opacity_tl }
-      { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } }
+       { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } }
   }
 \prg_new_conditional:Nnn \__fontspec_save_family_needed:n { TF }
   {
@@ -1470,7 +1428,7 @@
     \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {fontdef}
       {
         \__fontspec_construct_font_call:nn {\l_fontspec_fontname_tl}
-          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
+          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist \__fontspec_get_variations: }
       }
     \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-num} \l__fontspec_script_int
     \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-num}   \l__fontspec_language_int
@@ -1577,7 +1535,7 @@
     \group_begin:
     \__fontspec_primitive_font_set:Nnn \l__fontspec_tmpa_font { \__fontspec_construct_font_call:nn {#1}   { \l__fontspec_pre_feat_sclist } } { \f at size pt + 1sp }
     \__fontspec_primitive_font_set:Nnn \l__fontspec_tmpb_font { \__fontspec_construct_font_call:nn {#1#2} { \l__fontspec_pre_feat_sclist } } { \f at size pt + 1sp }
-    \str_if_eq:eeTF { \__fontspec_primitive_font_get_name:N \l__fontspec_tmpa_font } { \__fontspec_primitive_font_get_name:N \l__fontspec_tmpb_font }
+    \cs_if_eq:NNTF \l__fontspec_tmpa_font \l__fontspec_tmpb_font
       { \group_end: \prg_return_false: }
       { \group_end: \prg_return_true: }
   }
@@ -1674,7 +1632,7 @@
       {
         <\l__fontspec_size_tl> \l__fontspec_scale_tl
         \__fontspec_construct_font_call:nn { \l_fontspec_fontname_tl }
-          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
+          { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist \__fontspec_get_variations: }
       }
   }
 \cs_new:Nn \__fontspec_declare_shapes_normal:nn
@@ -1832,6 +1790,26 @@
       }
   }
 \cs_generate_variant:Nn \__fontspec_remove_clashing_featstr:n {x}
+\cs_generate_variant:Nn \tl_tail:n { e }
+\cs_new:Nn \__fontspec_format_axis:nn
+  {
+    , #1 = #2
+  }
+\cs_new:Nn \__fontspec_get_variations:
+  {
+    \tl_if_empty:NF \g__fontspec_instance_tl
+      {
+        instance = { \g__fontspec_instance_tl };
+      }
+      \prop_if_empty:NF \g__fontspec_rawvariations_prop
+      {
+        axis = {
+          \tl_tail:e {
+            \prop_map_function:NN \g__fontspec_rawvariations_prop \__fontspec_format_axis:nn
+          }
+        };
+      }
+  }
 \cs_set:Npn \__fontspec_init:
   {
     \bool_set_false:N \l__fontspec_ot_bool
@@ -1848,6 +1826,8 @@
 \cs_new:Nn \__fontspec_init_fontface:
   {
     \tl_gclear:N \g__fontspec_rawfeatures_sclist
+    \prop_gclear:N \g__fontspec_rawvariations_prop
+    \tl_gclear:N \g__fontspec_instance_tl
     \tl_clear:N \l__fontspec_scale_tl
     \tl_set_eq:NN \l__fontspec_opacity_tl \c__fontspec_opacity_tl
     \tl_set_eq:NN \l__fontspec_hexcol_tl \c__fontspec_hexcol_tl
@@ -1882,6 +1862,17 @@
 
 %%^^A%%  fontspec-code-opentype.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
+\cs_new:Nn \__fontspec_define_opentype_variation_axis:nn
+  {
+    \keys_define:nn {fontspec-opentype}
+      {
+        #1 .code:n = {
+          \prop_gput:Nnn \g__fontspec_rawvariations_prop { #2 } { ##1 }
+        },
+        #1 .value_required:n = true,
+        #1 .groups:n = {opentype},
+      }
+  }
 \cs_new:Nn \__fontspec_define_opentype_feature_group:n
   {
     \keys_define:nn {fontspec-opentype} { #1 .multichoice: , .groups:n = {opentype} }
@@ -2270,7 +2261,13 @@
     \bool_set_true:N \l__fontspec_noit_bool
     \bool_set_true:N \l__fontspec_external_bool
     \tl_set:Nn \l__fontspec_font_path_tl {#1}
-    \__fontspec_font_is_file:
+    \bool_lazy_and:nnTF { \l__fontspec_external_kpse_bool } { \tl_if_empty_p:N \l__fontspec_font_path_tl }
+      {
+        \__fontspec_font_is_kpse:
+      }
+      {
+        \__fontspec_font_is_file:
+      }
     \keys_set:nn {fontspec-renderer} {Renderer=OpenType}
   }
 \aliasfontfeature{Path}{ExternalLocation}
@@ -2285,6 +2282,15 @@
   }
 \tl_clear:N \l__fontspec_extension_tl
 \__fontspec_keys_define_code:nnn {fontspec} {Extension} {}
+\__fontspec_keys_define_code:nnn {fontspec-preparse-external} {KpseOnly}
+  {
+    \bool_set_true:N \l__fontspec_external_kpse_bool
+    \bool_if:NT \l__fontspec_external_bool
+      {
+        \__fontspec_font_is_kpse:
+      }
+  }
+\__fontspec_keys_define_code:nnn {fontspec} {KpseOnly} {}
 \keys_define:nn {fontspec-renderer}
   {
     Renderer .choices:nn =
@@ -2502,8 +2508,10 @@
       {
         {MatchLowercase} { \__fontspec_calc_scale:n {5} }
         {MatchUppercase} { \__fontspec_calc_scale:n {8} }
+        {MatchAveragecase} { \__fontspec_calc_scale:nn {5} {8} }
       }
       { \tl_set:Nx \l__fontspec_scale_tl {#1} }
+      \__fontspec_info:n {set-scale}
   }
 \__fontspec_keys_define_code:nnn {fontspec} {ScaleAgain}
   {
@@ -2528,11 +2536,24 @@
                        \dim_to_fp:n {\l__fontspec_tmpb_dim}   }
         }
 
-      \__fontspec_info:n {set-scale}
       \exp_args:NNNx
     \group_end:
     \tl_set:Nx \l__fontspec_scale_tl { \l__fontspec_scale_tl }
   }
+\cs_new:Nn \__fontspec_calc_scale:nn
+{
+    \group_begin:
+      \__fontspec_calc_scale:n {#1}
+      \tl_set_eq:NN \l__fontspec_tmp_tl \l__fontspec_scale_tl
+      \__fontspec_calc_scale:n {#2}
+      \tl_set:Nx \l__fontspec_scale_tl
+        {
+          \fp_eval:n { (\l__fontspec_tmp_tl + \l__fontspec_scale_tl)/2 }
+        }
+      \exp_args:NNNx
+    \group_end:
+    \tl_set:Nx \l__fontspec_scale_tl { \l__fontspec_scale_tl }
+  }
 \cs_new:Nn \__fontspec_set_font_dimen:NnN
   {
     \dim_set:Nn #1 { \fontdimen #2 #3 }
@@ -2629,19 +2650,25 @@
 \__fontspec_aff_error:n {HyphenChar}
 \__fontspec_keys_define_code:nnn {fontspec} {Color}
   {
-    \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+    \color_if_exist:nTF {#1}
       {
-        \convertcolorspec{named}{#1}{HTML}\l__fontspec_hexcol_tl
+        \color_export:nnN {#1} {HTML}\l__fontspec_hexcol_tl
       }
       {
-        \int_compare:nTF { \tl_count:n {#1} == 6 }
-          { \tl_set:Nn \l__fontspec_hexcol_tl {#1} }
+        \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
           {
-            \int_compare:nTF { \tl_count:n {#1} == 8 }
-              { \fontspec_parse_colour:viii #1 }
+            \convertcolorspec{named}{#1}{HTML}\l__fontspec_hexcol_tl
+          }
+          {
+            \int_compare:nTF { \tl_count:n {#1} == 6 }
+              { \tl_set:Nn \l__fontspec_hexcol_tl {#1} }
               {
-                \bool_if:NF \l__fontspec_firsttime_bool
-                  { \__fontspec_warning:nx {bad-colour} {#1} }
+                \int_compare:nTF { \tl_count:n {#1} == 8 }
+                  { \fontspec_parse_colour:viii #1 }
+                  {
+                    \bool_if:NF \l__fontspec_firsttime_bool
+                      { \__fontspec_warning:nx {bad-colour} {#1} }
+                  }
               }
           }
       }
@@ -2688,6 +2715,7 @@
   {
     \__fontspec_update_featstr:n{width=#1}
   }
+\__fontspec_define_opentype_variation_axis:nn {Slant} {slnt}
 \__fontspec_keys_define_code:nnn {fontspec} {OpticalSize}
   {
     \bool_if:NTF \l__fontspec_ot_bool
@@ -2706,6 +2734,14 @@
         { \__fontspec_warning:nx {no-opticals} {\l_fontspec_fontname_tl} }
       }
   }
+\__fontspec_keys_define_code:nnn {fontspec-opentype} {RawAxis}
+  {
+    \prop_gput_from_keyval:Nn \g__fontspec_rawvariations_prop {#1}
+  }
+\__fontspec_keys_define_code:nnn {fontspec-opentype} {Instance}
+  {
+    \tl_gset:Nn \g__fontspec_instance_tl {#1}
+  }
 \keys_define:nn {fontspec}
   {
     FakeSlant .code:n =
@@ -3182,7 +3218,7 @@
 \newfontscript{CJK~Ideographic}{hani}
 \newfontscript{Coptic}{copt}
 \newfontscript{Cypriot~Syllabary}{cprt}
-\newfontscript{Cypro~Minoan}{cpmn}
+\newfontscript{Cypro-Minoan}{cpmn}
 \newfontscript{Cyrillic}{cyrl}
 \newfontscript{Default}{DFLT}
 \newfontscript{CustomDefault}{latn,DFLT}
@@ -3216,6 +3252,7 @@
 \newfontscript{Javanese}{java}
 \newfontscript{Kaithi}{kthi}
 \newfontscript{Kannada}{knd2,knda}
+\newfontscript{Kawi}{kawi}
 \newfontscript{Kayah~Li}{kali}
 \newfontscript{Kharosthi}{khar}
 \newfontscript{Khitan~Small~Script}{kits}
@@ -3237,7 +3274,7 @@
 \newfontscript{Mandaic}{mand}
 \newfontscript{Manichaean}{mani}
 \newfontscript{Marchen}{marc}
-\newfontscript{Masaram Gondi}{gonm}
+\newfontscript{Masaram~Gondi}{gonm}
 \newfontscript{Math}{math}
 \newfontscript{Medefaidrin}{medf}
 \newfontscript{Meitei~Mayek}{mtei}
@@ -3253,6 +3290,7 @@
 \newfontscript{Myanmar}{mym2,mymr}
 \newfontscript{N'Ko}{nko~}
 \newfontscript{Nabataean}{nbat}
+\newfontscript{Nag~Mundari}{nagm}
 \newfontscript{Nandinagari}{nand}
 \newfontscript{Newa}{newa}
 \newfontscript{Nushu}{nshu}

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2024-02-13 23:46:54 UTC (rev 69833)
@@ -23,8 +23,8 @@
 local fontspec    = fontspec
 fontspec.module   = {
     name          = "fontspec",
-    version       = "2.8a",
-    date          = "2022/01/15",
+    version       = "2.9a",
+    date          = "2024/02/13",
     description   = "Font selection for XeLaTeX and LuaLaTeX",
     author        = "Khaled Hosny, Philipp Gesang, Will Robertson",
     copyright     = "Khaled Hosny, Philipp Gesang, Will Robertson",

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2024-02-13 23:46:40 UTC (rev 69832)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2024-02-13 23:46:54 UTC (rev 69833)
@@ -5,6 +5,9 @@
 %% The original source files were:
 %%
 %% fontspec.dtx  (with options: `fontspec,load')
+%% fontspec-code-vars.dtx  (with options: `options')
+%% fontspec-code-msg.dtx  (with options: `options')
+%% fontspec-code-opening.dtx  (with options: `options')
 %% fontspec-code-load.dtx  (with options: `fontspec,load')
 %% ------------------------------------------------
 %% The FONTSPEC package  <wspr.io/fontspec>
@@ -21,19 +24,66 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec}%
-  {2022/01/15}{2.8a}{Font selection for XeLaTeX and LuaLaTeX}
+  {2024/02/13}{2.9a}{Font selection for XeLaTeX and LuaLaTeX}
 
+%%^^A%%  fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
+\bool_new:N \g__fontspec_cfg_bool
+\bool_new:N \g__fontspec_math_bool
+
+%%^^A%%  fontspec-code-msg.dtx -- part of FONTSPEC <wspr.io/fontspec>
+\msg_new:nnn {fontspec} {cm-default-obsolete}
+ {
+  The~"cm-default"~package~option~is~obsolete.
+ }
+\msg_new:nnn {fontspec} {enc-obsolete}
+ {
+  The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
+ }
+
+%%^^A%%  fontspec-code-opening.dtx -- part of FONTSPEC <wspr.io/fontspec>
+\DeclareKeys
+  {
+    cm-default  .code:n = { \msg_warning:nn   {fontspec} {cm-default-obsolete} }
+    ,math    .bool_gset:N = \g__fontspec_math_bool
+    ,math    .usage:n     =  preamble
+    ,no-math .bool_gset_inverse:N = \g__fontspec_math_bool
+    ,no-math .usage:n             =  preamble
+    ,config  .bool_gset:N = \g__fontspec_cfg_bool
+    ,config  .usage:n     = load
+    ,no-config  .bool_gset_inverse:N = \g__fontspec_cfg_bool
+    ,no-config  .usage:n             = load
+    ,euenc  .code:n = { \msg_warning:nnn   {fontspec} {enc-obsolete}{euenc} }
+    ,tuenc  .code:n = { \msg_warning:nnn   {fontspec} {enc-obsolete}{tuenc} }
+    ,quiet .code:n =
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { info }
+        \msg_redirect_module:nnn { fontspec } { info } { none }
+      }
+    ,silent .code:n =
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { none }
+        \msg_redirect_module:nnn { fontspec } { info } { none }
+      }
+    ,verbose .code:n =
+      {
+        \msg_redirect_module:nnn { fontspec } { warning } { warning }
+        \msg_redirect_module:nnn { fontspec } { info } { info }
+      }
+  }
+\SetKeys{config,math}
+\ProcessKeyOptions
+
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \sys_if_engine_luatex:T
   {
     \RequirePackage{luaotfload}
     \lua_now:e{require("fontspec")}
-    \RequirePackageWithOptions{fontspec-luatex}
+    \RequirePackage{fontspec-luatex}
     \endinput
   }
 \sys_if_engine_xetex:T
   {
-    \RequirePackageWithOptions{fontspec-xetex}
+    \RequirePackage{fontspec-xetex}
     \endinput
   }
 \msg_new:nnn {fontspec} {cannot-use-pdftex}



More information about the tex-live-commits mailing list.