texlive[48307] Master/texmf-dist: fontspec (29jul18)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 29 23:15:34 CEST 2018


Revision: 48307
          http://tug.org/svn/texlive?view=revision&revision=48307
Author:   karl
Date:     2018-07-29 23:15:34 +0200 (Sun, 29 Jul 2018)
Log Message:
-----------
fontspec (29jul18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.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-api.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.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-enc.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-graphite.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lang.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-math.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-msg.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-scripts.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.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.cfg
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/fontspec/LICENSE

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2018-07-29 21:15:34 UTC (rev 48307)
@@ -1,16 +1,21 @@
-
 Change history
 ==============
 
-- v2.6g (2017-11-09)
+## v2.6h (2018/07/29)
 
+    * `expl3` internals updated so loading `expl3` with the `check-declarations` option will run without error.
+    * Fix bug with `FontFace` in which spaces weren't being ignored.
+
+
+## v2.6g (2017-11-09)
+
     * Bugfix for clash introduced with last version. When loading `babel`
       before `fontspec` the following error arose:
-      
+
           ! Control sequence \latinencoding already defined.
 
 
-- v2.6f (2017-11-05)
+## v2.6f (2017-11-05)
 
     * Fix loading of Graphite fonts and add a little documentation (a better interface is needed, though)
     * Correct and simplify some internal code that fixes a bug in the way some fonts are displayed in `\tracingoutput` mode.
@@ -19,7 +24,7 @@
     * This package now complies with the `expl3` option `check-declarations`.
 
 
-- v2.6e (2017/09/22)
+## v2.6e (2017/09/22)
 
     * Re-enable use of `HyphenChar=None` in LuaLaTeX. (Hyphenation and font choice are
       decoupled in LuaTeX, except for this one setting.)
@@ -26,7 +31,7 @@
     * Some internal changes needed by `unicode-math` to fix some cross-over code.
 
 
-- v2.6d (2017/08/14)
+## v2.6d (2017/08/14)
 
     * Update Scripts to Unicode 1.8.2 (thanks Werner)
     * Remove `HyphenChar` feature when running LuaTeX — use `\prehyphenchar` LuaTeX primitive instead.
@@ -33,12 +38,12 @@
     * Rewrite test suite so that automated testing actually functions correctly and automatically. Thanks to Joseph for introducing me to Travis CI.
 
 
-- v2.6c (2017/07/23)
+## v2.6c (2017/07/23)
 
     * Emergency bug-fix.
 
 
-- v2.6b (2017/07/16)
+## v2.6b (2017/07/16)
 
     * Fix conflict with Polyglossia and `Scale=MatchLowercase`.
     * New feature `IgnoreFontspecFile` to avoid loading the `.fontspec` file for a font.
@@ -46,12 +51,12 @@
       (which broke `realscripts`, oops — must improve my test suite)
 
 
-- v2.6a (2017/03/31)
+## v2.6a (2017/03/31)
 
     * Fix crashing bug with `..Reset` and `ResetAll` keys.
     * Fix crashing bug with `\newfontface`.
 
-- v2.6 (2017/02/12)
+## v2.6 (2017/02/12)
 
     * Change the new behaviour of `\emph` (and `\emfontdeclare`) to act only on the NFSS font shape; using the series as well was too fragile.
     * Add `\strong` as the "weight" analogy to `\emph`. This will need some extra syntactic sugar from `fontspec` before it becomes truly useful.
@@ -65,12 +70,12 @@
 
     * N.B. There is currently a known issue with TTC fonts and LuaTeX; currently they cannot be loaded through the `fontspec` interface, but this issue should soon be addressed by the `luaotfload` package.
 
-- v2.5d (2017/01/24) "oops"
+## v2.5d (2017/01/24) "oops"
 
     * Add `\fontspec_if_small_caps:TF`
     * Fix bug in `\emph` (!!)
 
-- v2.5c (2017/01/20) "Christmas 2016 release"
+## v2.5c (2017/01/20) "Christmas 2016 release"
 
     * `TU` font encoding now default, with encoding files provided by the kernel.
     * Experimental interface added for customising encodings.
@@ -86,7 +91,7 @@
     * Big table of OpenType feature tags to help cross-reference which fontspec feature (if any) corresponds to which OpenType feature.
     * Bug fixed for `Script` selection.
 
-- v2.5b (2016/05/14) "More bugs" (somehow never released)
+## v2.5b (2016/05/14) "More bugs" (somehow never released)
 
     * Fixed bug with garbage text printed in certain "verbatim" situations under LuaTeX.
     * Improve interaction between optical sizes and small caps.
@@ -94,7 +99,7 @@
       (there are other methods to perform the same thing, but no "easy" user interface that `fontspec` can provide at this stage).
     * Fix regression causing an error message if `fontspec` loaded before `\documentclass'.
 
-- v2.5a (2016/02/01) "Bugs fixed"
+## v2.5a (2016/02/01) "Bugs fixed"
 
     * Rather embarrassing bug fix! (`unicode-math` was broken.)
     * Remember to add the `fontspec.cfg` file to the distribution.
@@ -102,7 +107,7 @@
     * Add some basic tests using `l3build`; more to come.
     * Simplify some internal Lua code and package loading code.
 
-- v2.5 (2016/01/30) "TL2016 release"
+## v2.5 (2016/01/30) "TL2016 release"
 
     * Provide a new Unicode font encoding ("TU") to replace EU1/EU2 and xunicode.
     * Activate with package option `[tuenc]'; once it becomes the default (later this year), `[euenc]` option will revert to the old behaviour.
@@ -116,16 +121,16 @@
     * Improvement to some warnings/info messages.
     * Improve structure of code.
 
-- v2.4e (2015/09/24)
+## v2.4e (2015/09/24)
 
     * Allow `[Path=...]` to be specified for individual font faces.
     * Continue to normalise naming with expl3. (Ongoing.)
 
-- v2.4d (2015/07/22)
+## v2.4d (2015/07/22)
 
     * Rename an internal expl3 function or two.
 
-- v2.4c (2015/03/14)
+## v2.4c (2015/03/14)
 
     * v2.4b was never released, sorry!
     * This time *really* fix `\@fnsymbol` and avoid overwriting it if already fixed.
@@ -132,7 +137,7 @@
     * Fix "`Renderer=Graphite`" (off-by-one error).
     * Fix some edge cases for `\aliasfontfeature`.
 
-- v2.4b (2014/08/23)
+## v2.4b (2014/08/23)
 
     * Improve backwards compatibility w.r.t. recent argument order change;
       specifically, if an optional argument is presented before the font name
@@ -142,13 +147,13 @@
       mixed-case ".fontspec" files.
     * Fixed some documentation typos/inconsistencies related to recent changes.
 
-- v2.4a (2014/06/21)
+## v2.4a (2014/06/21)
 
     * No longer load fixltx2e.sty -- this package should really be loaded before \documentclass.
     * Avoid deprecated l3fp code.
     * A couple of bugs introduced with v2.4 fixed.
 
-- v2.4 (2014/06/01)
+## v2.4 (2014/06/01)
 
     * Significant change to the user interface: instead of `\setmainfont[features]{font}`, you now write `\setmainfont{font}[features]`.
       Backwards compatibility is of course preserved.
@@ -190,26 +195,26 @@
 
     * Setting the `SmallCapsFont` using the `*`-replacement notation has been improved/fixed.
 
-- v2.3c (2013/05/20)
+## v2.3c (2013/05/20)
 
     * Compatbility with luaotfload 2013/05/20 2.2c, support for older version
       removed.
 
-- v2.3b (2013/05/12)
+## v2.3b (2013/05/12)
 
     * Compatibility with new (and future) version of luaotfload
 
-- v2.3a (2013/03/16)
+## v2.3a (2013/03/16)
 
     * Bug fix update to retain compatibility with new expl3
 
-- v2.3 (2013/02/25)
+## v2.3 (2013/02/25)
 
     * Add support for per-font options in `\defaultfontfeatures`
     * Add support for `<fontname>.fontspec` per-font configuration files
     * Keep up-to-date with expl3 changes
 
-- v2.2b (2012/05/06) "TL2012 version"
+## v2.2b (2012/05/06) "TL2012 version"
 
     * Fix error with AutoFakeSlant/Bold (#113) and when used with external fonts (#128)
     * Add warning when using FakeBold in LuaLaTeX, where it's not supported
@@ -219,12 +224,12 @@
     * Avoid using the calc package now that it's no longer loaded by expl3
     * Allow multiple values to StylisticSet and Alternate font options
 
-- v2.2a (2011/09/14)
+## v2.2a (2011/09/14)
 
     * Bug fix: improve backwards compatibility for packages that use old
       fontspec internals such as mathspec.
 
-- v2.2  (2011/09/13)
+## v2.2  (2011/09/13)
 
     * Support alternate selections in CharacterVariant (cvxx in OpenType)
       using new syntax `[CharacterVariant=5:2]`.
@@ -251,11 +256,11 @@
         same information
       - Update `expl3` support to latest CTAN version.
 
-- v2.1g (2011/08/02)
+## v2.1g (2011/08/02)
 
     * No longer uses the binhex package, avoiding some name clashes with TIPA
 
-- v2.1f (2011/02/26)
+## v2.1f (2011/02/26)
 
     * Finally add a real error message when a font cannot be found!
     * Add "Letters=Random" feature.
@@ -263,17 +268,17 @@
       were shown in the log file.
     * Some small documentation improvements.
 
-- v2.1e (2010/11/17)
+## v2.1e (2010/11/17)
 
     * Internal changes for luatexbase v0.3.
 
-- v2.1d (2010/11/07)
+## v2.1d (2010/11/07)
 
     * Bug fix when \itdefault is "sl" rather than "it".
       E.g., when using the "slides" class.
     * Minor internal changes, including merging some code from unicode-math.
 
-- v2.1c (2010/10/13)
+## v2.1c (2010/10/13)
 
     * New documentation for defining custom kerning and ligatures
       when using LuaLaTeX.
@@ -282,12 +287,12 @@
       that does not contain it. TODO: a suitable fallback script should be
       chosen; right now we just ignore the script selection.
 
-- v2.1b (2010/09/29)
+## v2.1b (2010/09/29)
 
     * Fix for bug introduced in the last release:
       small caps weren't being automatically selected correctly
 
-- v2.1a (2010/09/27)
+## v2.1a (2010/09/27)
 
     * Fix for colours bug introduced in the last update
     * Fix for for bad interaction with LuaLaTeX and fallback fonts
@@ -306,7 +311,7 @@
     * Lots of internal changes to bring the implementation closer
       to being "native expl3".
 
-- v2.1 (2010/09/19)
+## v2.1 (2010/09/19)
 
     * Now load xunicode internally for consistent behaviour in
       XeLaTeX and LuaLaTeX.
@@ -318,7 +323,7 @@
       in the transition to v2.
     * Bug fix for a problem triggered after counters got too high.
 
-- v2.0c (2010/08/01)
+## v2.0c (2010/08/01)
   Bug fix and documentation tune-up.
 
     * Significant bug fix reported simultaneously by Enrico Gregorio and
@@ -326,7 +331,7 @@
     * Many documentation improvements and additions due to David Perry.
     * Documentation typo thanks to John McChesney-Young
 
-- v2.0b (2010/07/14)
+## v2.0b (2010/07/14)
   *Actually* the final release before TeX Live 2010.
 
     * Improved examples in the documentation, with fewer proprietary fonts
@@ -336,7 +341,7 @@
     * New OpenType feature `CharacterVariant` now supported
     * Minor change: `Ligatures=Historical` is now `Ligatures=Historic` for consistency
 
-- v2.0a (2010/07/11)
+## v2.0a (2010/07/11)
   Final release before TeX Live 2010.
 
     * Bug fix for the Language setting being ignored

Added: trunk/Master/texmf-dist/doc/latex/fontspec/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontspec/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/fontspec/LICENSE	2018-07-29 21:15:34 UTC (rev 48307)
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c  2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+    Everyone is allowed to distribute verbatim copies of this
+    license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute.  This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but 
+it is written in such a way that you can use it even if your work is 
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work.  If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+   `Work'
+    Any work being distributed under this License.
+    
+   `Derived Work'
+    Any work that under any applicable law is derived from the Work.
+
+   `Modification' 
+    Any procedure that produces a Derived Work under any applicable
+    law -- for example, the production of a file containing an
+    original file associated with the Work or a significant portion of
+    such a file, either verbatim or with modifications and/or
+    translated into another language.
+
+   `Modify'
+    To apply any procedure that produces a Derived Work under any
+    applicable law.
+    
+   `Distribution'
+    Making copies of the Work available from one person to another, in
+    whole or in part.  Distribution includes (but is not limited to)
+    making any electronic components of the Work accessible by
+    file transfer protocols such as FTP or HTTP or by shared file
+    systems such as Sun's Network File System (NFS).
+
+   `Compiled Work'
+    A version of the Work that has been processed into a form where it
+    is directly usable on a computer system.  This processing may
+    include using installation facilities provided by the Work,
+    transformations of the Work, copying of components of the Work, or
+    other activities.  Note that modification of any installation
+    facilities provided by the Work constitutes modification of the Work.
+
+   `Current Maintainer'
+    A person or persons nominated as such within the Work.  If there is
+    no such explicit nomination then it is the `Copyright Holder' under
+    any applicable law.
+
+   `Base Interpreter' 
+    A program or process that is normally needed for running or
+    interpreting a part or the whole of the Work.    
+
+    A Base Interpreter may depend on external components but these
+    are not considered part of the Base Interpreter provided that each
+    external component clearly identifies itself whenever it is used
+    interactively.  Unless explicitly specified when applying the
+    license to the Work, the only applicable Base Interpreter is a
+    `LaTeX-Format' or in the case of files belonging to the 
+    `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1.  Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope.  In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2.  You may distribute a complete, unmodified copy of the Work as you
+received it.  Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3.  You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4.  If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work.  You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work.  Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5.  If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6.  If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition.  Only
+the Current Maintainer is allowed to add such statements of exemption 
+to a component of the Work. 
+
+  a. If a component of this Derived Work can be a direct replacement
+     for a component of the Work when that component is used with the
+     Base Interpreter, then, wherever this component of the Work
+     identifies itself to the user when used interactively with that
+     Base Interpreter, the replacement component of this Derived Work
+     clearly and unambiguously identifies itself as a modified version
+     of this component to the user when used interactively with that
+     Base Interpreter.
+     
+  b. Every component of the Derived Work contains prominent notices
+     detailing the nature of the changes to that component, or a
+     prominent reference to another file that is distributed as part
+     of the Derived Work and that contains a complete and accurate log
+     of the changes.
+  
+  c. No information in the Derived Work implies that any persons,
+     including (but not limited to) the authors of the original version
+     of the Work, provide any support, including (but not limited to)
+     the reporting and handling of errors, to recipients of the
+     Derived Work unless those persons have stated explicitly that
+     they do provide such support for the Derived Work.
+
+  d. You distribute at least one of the following with the Derived Work:
+
+       1. A complete, unmodified copy of the Work; 
+          if your distribution of a modified component is made by
+          offering access to copy the modified component from a
+          designated place, then offering equivalent access to copy
+          the Work from the same or some similar place meets this
+          condition, even though third parties are not compelled to
+          copy the Work along with the modified component;
+
+       2. Information that is sufficient to obtain a complete,
+          unmodified copy of the Work.
+
+7.  If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8.  The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9.  Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+     
+10. a. A Derived Work may be distributed under a different license
+       provided that license itself honors the conditions listed in
+       Clause 6 above, in regard to the Work, though it does not have
+       to honor the rest of the conditions in this license.
+      
+    b. If a Derived Work is distributed under a different license, that
+       Derived Work must provide sufficient documentation as part of
+       itself to allow each recipient of that Derived Work to honor the 
+       restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12.  Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work.  Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose.  The entire risk as to the quality and performance
+of the Work is with you.  Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1.  Make a reasonable attempt to trace the Current Maintainer (and
+     the Copyright Holder, if the two differ) through the means of
+     an Internet or similar search.
+
+ 2.  If this search is successful, then enquire whether the Work
+     is still maintained.
+
+  a. If it is being maintained, then ask the Current Maintainer
+     to update their communication data within one month.
+     
+  b. If the search is unsuccessful or no action to resume active
+     maintenance is taken by the Current Maintainer, then announce
+     within the pertinent community your intention to take over
+     maintenance.  (If the Work is a LaTeX work, this could be
+     done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+     maintenance of the Work to you, then this takes effect
+     immediately upon announcement.
+     
+  b. If the Current Maintainer is not reachable and the Copyright
+     Holder agrees that maintenance of the Work be passed to you,
+     then this takes effect immediately upon announcement.  
+    
+ 4.  If you make an `intention announcement' as described in 2b. above
+     and after three months your intention is challenged neither by
+     the Current Maintainer nor by the Copyright Holder nor by other
+     people, then you may arrange for the Work to be changed so as
+     to name you as the (new) Current Maintainer.
+     
+ 5.  If the previously unreachable Current Maintainer becomes
+     reachable once more within three months of a change completed
+     under the terms of 3b) or 4), then that Current Maintainer must
+     become or remain the Current Maintainer upon request provided
+     they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer.  You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license.  These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license.  You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license.  It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate.  Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component.  While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community.  It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one.  Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified.  Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+  %% pig.dtx
+  %% Copyright 2005 M. Y. Name
+  %
+  % This work may be distributed and/or modified under the
+  % conditions of the LaTeX Project Public License, either version 1.3
+  % of this license or (at your option) any later version.
+  % The latest version of this license is in
+  %   http://www.latex-project.org/lppl.txt
+  % and version 1.3 or later is part of all distributions of LaTeX
+  % version 2005/12/01 or later.
+  %
+  % This work has the LPPL maintenance status `maintained'.
+  % 
+  % The Current Maintainer of this work is M. Y. Name.
+  %
+  % This work consists of the files pig.dtx and pig.ins
+  % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.  
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+   The LPPL requires that distributions of the Work contain all the
+   files of the Work.  It is therefore important that you provide a
+   way for the licensee to determine which files constitute the Work.
+   This could, for example, be achieved by explicitly listing all the
+   files of the Work near the copyright notice of each file or by
+   using a line such as:
+
+    % This work consists of all files listed in manifest.txt.
+   
+   in that place.  In the absence of an unequivocal list it might be
+   impossible for the licensee to determine what is considered by you
+   to comprise the Work and, in such a case, the licensee would be
+   entitled to make reasonable conjectures as to which files comprise
+   the Work.
+

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-api.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-api.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -27,9 +27,9 @@
 % Test whether the currently selected font has been loaded by fontspec.
 %    \begin{macrocode}
 \prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F}
- {
-  \cs_if_exist:cTF {g_@@_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
- }
+  {
+    \cs_if_exist:cTF {g_@@_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -39,23 +39,23 @@
 % feature (|#1|,|#2|).
 %    \begin{macrocode}
 \prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \@@_set_font_type:N \font
-    \bool_if:NTF \l_@@_atsui_bool
-     {
-      \@@_make_AAT_feature_string:NnnTF \font {#1} {#2}
-        \prg_return_true: \prg_return_false:
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \@@_set_font_type:N \font
+        \bool_if:NTF \l_@@_atsui_bool
+          {
+            \@@_make_AAT_feature_string:NnnTF \font {#1} {#2}
+              \prg_return_true: \prg_return_false:
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -65,16 +65,16 @@
 % Always true for LuaTeX fonts.
 %    \begin{macrocode}
 \prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \@@_set_font_type:N \font
-    \bool_if:NTF \l_@@_ot_bool \prg_return_true: \prg_return_false:
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \@@_set_font_type:N \font
+        \bool_if:NTF \l_@@_ot_bool \prg_return_true: \prg_return_false:
+      }
+      {
+        \prg_return_false:
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -85,31 +85,31 @@
 % font.
 %    \begin{macrocode}
 \prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \@@_set_font_type:N \font
-    \bool_if:NTF \l_@@_ot_bool
-     {
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {script-num} \l_@@_tmp_tl
-      \int_set:Nn \l_@@_script_int {\l_@@_tmp_tl}
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \@@_set_font_type:N \font
+        \bool_if:NTF \l_@@_ot_bool
+          {
+            \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {script-num} \l_@@_tmp_tl
+            \int_set:Nn \l_@@_script_int {\l_@@_tmp_tl}
 
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {lang-num} \l_@@_tmp_tl
-      \int_set:Nn \l_@@_language_int {\l_@@_tmp_tl}
+            \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {lang-num} \l_@@_tmp_tl
+            \int_set:Nn \l_@@_language_int {\l_@@_tmp_tl}
 
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
+            \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
+            \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
 
-      \@@_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+            \@@_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -268,16 +268,16 @@
 % We want to store the actual name of the font family within the \meta{family}
 % variable because the actual \LaTeX\ family name is automatically generated
 % by fontspec and it's easier to keep it that way.
+%    \begin{macrocode}
+\cs_new:Nn \fontspec_set_family:Nnn
+  {
+    \tl_set:Nn \l_@@_family_label_tl {#1}
+    \@@_select_font_family:nn {#2} {#3}
+    \tl_set_eq:NN #1 \l_fontspec_family_tl
+  }
+%    \end{macrocode}
 %
-% Please use |\fontspec_set_family:Nnn| instead of |\@@_select_font_family:nn|,
-% which may change in the future.
 %    \begin{macrocode}
-\cs_new:Nn \fontspec_set_family:Nnn
- {
-  \tl_set:Nn \l_@@_family_label_tl { #1 }
-  \@@_select_font_family:nn {#2}{#3}
-  \tl_set_eq:NN #1 \l_fontspec_family_tl
- }
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {c}
 %    \end{macrocode}
 % \end{macro}
@@ -284,14 +284,17 @@
 %
 %
 % \begin{macro}{\fontspec_set_fontface:NNnn}
+% TODO: the round-about approach of using \cs{fontname}
+% means that settings such as fontdimens will be lost.
+% (Discovered in unicode-math.) Investigate!
 %    \begin{macrocode}
-\cs_new:Nn \fontspec_set_fontface:NNnn
- {
-  \tl_set:Nn \l_@@_family_label_tl { #1 }
-  \@@_select_font_family:nn {#3}{#4}
-  \font #1 = \fontname \l_fontspec_font \scan_stop:
-  \tl_set_eq:NN #2 \l_fontspec_family_tl
- }
+ \cs_new:Nn \fontspec_set_fontface:NNnn
+  {
+    \tl_set:Nn \l_@@_family_label_tl {#1}
+    \@@_select_font_family:nn {#3}{#4}
+    \global \font #1 = \fontname \l_fontspec_font \scan_stop:
+    \tl_set_eq:NN #2 \l_fontspec_family_tl
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -308,6 +311,9 @@
         { \group_end: \prg_return_true: }
         { \group_end: \prg_return_false:  }
   }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \cs_set_eq:NN \IfFontExistsTF \fontspec_font_if_exist:nTF
 %    \end{macrocode}
 % \end{macro}
@@ -363,7 +369,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -32,7 +32,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -60,7 +60,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code.ltx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -30,7 +30,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-api.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -184,6 +184,9 @@
 \cs{fontfamily}\marg{family}\cs{selectfont}.
 See the standard \pkg{fontspec} user commands for applications of this
 function.
+
+Previously this function set the \meta{family} variable locally, but this was inconsistent
+with how the NFSS assigns families. It is now a \textbf{global} operation.
 \end{macro}
 
 \begin{macro}{\fontspec_set_fontface:NNnn}
@@ -197,6 +200,9 @@
 command will only select the regular face.
 This feature is designed for \LaTeX\ programmers who need to
 perform subsequent font-related tests on the \meta{primitive font}.
+
+Previously this function set the \meta{family} variable locally, but this was inconsistent
+with how the NFSS assigns families. It is now a \textbf{global} operation.
 \end{macro}
 
 
@@ -318,7 +324,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-enc.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -204,7 +204,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -143,7 +143,8 @@
  \feat{BoldItalicFeatures}\texttt=\marg{features} \\
  \feat{SlantedFeatures}\texttt=\marg{features} \\
  \feat{BoldSlantedFeatures}\texttt=\marg{features} \\
- \feat{SmallCapsFeatures}\texttt=\marg{features}
+ \feat{SmallCapsFeatures}\texttt=\marg{features} \\
+ \feat{UprightFeatures}\texttt=\marg{features}
 }
 
 It is entirely possible that separate fonts in a family will require
@@ -504,37 +505,34 @@
 sizes the serifs and other small details may be more delicately
 rendered.
 
-OpenType fonts with optical scaling will exist in
-several discrete sizes, and these will be selected by \XeTeX\
-and Lua\TeX\
-\emph{automatically} determined by the current font size as in
-\exref{optsize}, in which we've scaled down some large text in order to be
-able to compare the difference for equivalent font sizes.
+OpenType fonts with optical scaling can exist in
+several discrete sizes (in separate font files).
+When loading fonts by name, \XeTeX\ and Lua\TeX\ engines will attempt to
+\emph{automatically} load the appropriate font as determined by the current font size.
+An example of this behaviour is shown in \exref{optsize}, in which some larger text is
+mechanically scaled down to compare the difference for equivalent font sizes.
 
-The
-\feat{OpticalSize} feature may be used to specify a different optical
-size.
-With \feat{OpticalSize} set
-to zero, no optical size font substitution is performed, as shown in
-\exref{optsize0}.
+The \feat{OpticalSize} feature may be used to specify a different optical size.
+With \feat{OpticalSize} set (\exref{optsize0})
+to zero, no optical size font substitution is performed.
 
-\begin{Xexample}{optsize}{A demonstration of automatic optical size selection.}
+\begin{Lexample}{optsize}{A demonstration of automatic optical size selection.}
   \fontspec{Latin Modern Roman}
    Automatic optical size                  \\
   \scalebox{0.4}{\Huge
    Automatic optical size}
-\end{Xexample}
+\end{Lexample}
 
-\begin{Xexample}{optsize0}{Optical size substitution is suppressed when set to zero.}
-  \fontspec{Latin Modern Roman 5 Regular}[OpticalSize=0]
+\begin{Lexample}{optsize0}{Explicit optical size substitution for the Latin Modern Roman family.}
+  \fontspec{Latin Modern Roman}[OpticalSize=5]
    Latin Modern optical sizes                \\
-  \fontspec{Latin Modern Roman 8 Regular}[OpticalSize=0]
+  \fontspec{Latin Modern Roman}[OpticalSize=8]
    Latin Modern optical sizes                \\
-  \fontspec{Latin Modern Roman 12 Regular}[OpticalSize=0]
+  \fontspec{Latin Modern Roman}[OpticalSize=12]
    Latin Modern optical sizes                \\
-  \fontspec{Latin Modern Roman 17 Regular}[OpticalSize=0]
+  \fontspec{Latin Modern Roman}[OpticalSize=17]
    Latin Modern optical sizes
-\end{Xexample}
+\end{Lexample}
 
 The \feat{SizeFeatures} feature (\vref*{sec:sizefeature}) can be
 used to specify exactly which optical sizes will be used for ranges
@@ -604,7 +602,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-fontsel.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -7,20 +7,20 @@
 
 \part{General font selection}
 
+\section{Main commands}
+\label{sec:main-cmd}
+
 This section concerns the variety of commands that can be used to select
 fonts.
 
+\bigskip
 \cmdbox{%
-  \CMD{\string\fontspec}\marg{font name}\oarg{font features}\\
-  \CMD{\string\setmainfont}\marg{font name}\oarg{font features}\\
-  \CMD{\string\setsansfont}\marg{font name}\oarg{font features}\\
-  \CMD{\string\setmonofont}\marg{font name}\oarg{font features}\\
-  \CMD{\string\newfontfamily}\meta{cmd}\marg{font name}\oarg{font features}
+  \CMD{\string\setmainfont}\marg{font}\oarg{font features}\\
+  \CMD{\string\setsansfont}{\color[gray]{0.5}\marg{font}\oarg{font features}}\\
+  \CMD{\string\setmonofont}{\color[gray]{0.5}\marg{font}\oarg{font features}}
 }
 
-These are the main font-selecting commands of this package.
-The \cs{fontspec} command selects a font for one-time use only; all
-others should be used to define the standard fonts used in a document, as shown in \exref{fontload}.
+These are the main font-selecting commands of this package which select the standard fonts used in a document, as shown in \exref{fontload}.
 Here, the scales of the fonts have been chosen to equalise their
 lowercase letter heights. The \feat{Scale} font feature will be discussed
 further in \vref{sec:font-ind-features}, including methods for automatic
@@ -28,22 +28,36 @@
 Note that further options may need to be added to select appropriate bold/italic fonts,
 but this shows the main idea.
 
-\begin{Lexample}{fontload}{Loading the default, sans serif, and monospaced fonts.}
-  \setmainfont{texgyrebonum-regular.otf}
-  \setsansfont{lmsans10-regular.otf}[Scale=MatchLowercase]
-  \setmonofont{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase]
-
-  \rmfamily Pack my box with five dozen liquor jugs\par
-  \sffamily Pack my box with five dozen liquor jugs\par
-  \ttfamily Pack my box with five dozen liquor jugs
-\end{Lexample}
-
 Note that while these commands all look and behave largely identically, the default setup for font loading automatically adds the |Ligatures=TeX| feature for the \cs{setmainfont} and \cs{setsansfont} commands.
 These defaults (and further customisations possible) are discussed in \vref{sec:defaults}.
 
-The font features argument accepts comma separated
+\bigskip
+\cmdbox{%
+  \CMD{\string\newfontfamily}\meta{cmd}\marg{font}\oarg{font features}\\
+  \CMD{\string\setfontfamily}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}\\
+  \CMD{\string\renewfontfamily}{\color[gray]{0.5}\meta{cmd}\marg{font}\oarg{font features}}
+}
+
+These commands define new font family commands (like \cs{rmfamily}).
+The |new| command checks if \meta{cmd} has been defined, and issues an error if so.
+The |renew| command checks if \meta{cmd} has been defined, and issues an error if not.
+The |set| command never checks; use at your own risk.
+
+\textbf{NEW:} In previous versions of \pkg{fontspec}, only \cs{newfontfamily} was provided, but it behaved
+like \cs{setfontfamily}. You'll have to update your code slightly if this now causes problems; apologies.
+
+
+\bigskip
+\cmdbox{%
+  \CMD{\string\fontspec}\marg{font}\oarg{font features}
+}
+
+The plain \cs{fontspec} command is not generally recommended for document use. It is an
+ad hoc commands best suited for testing and loading fonts on a one-off basis.
+
+All of the commands listed above accept comma-separated
 \meta{font feature}=\meta{option} lists; these are described later:
-\begin{itemize}
+\begin{itemize}[nosep]
 \item For general font features, see \vref{sec:font-ind-features}
 \item For OpenType fonts, see Part~\vref{sec:opentype-features}
 \item For \XeTeX-only general font features, see Part~\vref{sec:xetex-features}
@@ -51,10 +65,19 @@
 \item For features for \AAT\ fonts in \XeTeX, see \vref{sec:aat-features}
 \end{itemize}
 
+\begin{Lexample}{fontload}{Loading the default, sans serif, and monospaced fonts.}
+  \setmainfont{texgyrebonum-regular.otf}
+  \setsansfont{lmsans10-regular.otf}[Scale=MatchLowercase]
+  \setmonofont{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase]
+
+  \rmfamily Pack my box with five dozen liquor jugs\par
+  \sffamily Pack my box with five dozen liquor jugs\par
+  \ttfamily Pack my box with five dozen liquor jugs
+\end{Lexample}
+
 \section{Font selection}
 
-In both \LuaTeX\ and \XeTeX, fonts can be selected either by `font name' or
-by `file name', but there are some differences in how each engine finds and selects fonts --- don't be too surprised if a font invocation in one engine needs correction to work in the other.
+In both \LuaTeX\ and \XeTeX, fonts can be selected (using the \meta{font} argument in \ref{sec:main-cmd}) either by `font name' or by `file name', but there are some differences in how each engine finds and selects fonts --- don't be too surprised if a font invocation in one engine needs correction to work in the other.
 
 
 \subsection{By font name}
@@ -299,7 +322,8 @@
  \feat{~BoldItalicFont} = \meta{font name} \\
  \feat{SlantedFont} = \meta{font name} \\
  \feat{BoldSlantedFont} = \meta{font name} \\
- \feat{SmallCapsFont} = \meta{font name}
+ \feat{SmallCapsFont} = \meta{font name} \\
+ \feat{UprightFont} = \meta{font name}
 }
 
 The automatic bold, italic, and bold italic font selections will not be
@@ -569,7 +593,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -240,7 +240,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -46,7 +46,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -586,7 +586,7 @@
 
 \begin{Xexample}[firstline=2]{kernup}{Adding extra kerning for uppercase letters. (The difference is usually very small.)}
   \large
-  \fontspec{Romande ADF Std Bold}
+  \fontspec{RomandeADFStd-DemiBold.otf}
    UPPERCASE EXAMPLE \\
   \addfontfeature{Kerning=Uppercase}
    UPPERCASE EXAMPLE
@@ -856,7 +856,7 @@
 \begin{Xexample}[firstline=14,lastline=23]{script-lang}{An example of various Scripts and Languages.}
 \def\testfeature#1#2{%^^A
   \fontspec{\examplefont}#2 & \fontspec[#1]{\examplefont}#2\\[1ex]}
-\def \examplefont{Code2000}
+\def \examplefont{CODE2000.TTF}
 \def \arabictext{العربي}
 \def \devanagaritext{हिन्दी}
 \def \bengalitext{লেখ}
@@ -875,7 +875,7 @@
   \testfeature{Script=Gurmukhi}{\gurmukhitext}
   \testfeature{Script=Tamil}{\tamiltext}
   \testfeature{Script=Hebrew}{\hebrewtext}
-  \def\examplefont{Doulos SIL}
+  \def\examplefont{DoulosSILR.ttf}
   \testfeature{Language=Vietnamese}{\vietnamesetext}
 \end{tabular}
 \end{Xexample}
@@ -1446,7 +1446,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-xetex.tex	2018-07-29 21:15:34 UTC (rev 48307)
@@ -368,7 +368,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-enc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-enc.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-enc.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -161,7 +161,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-aat.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -231,7 +231,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-feat-opentype.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -547,7 +547,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -93,7 +93,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-graphite.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-graphite.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-graphite.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -111,7 +111,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -17,6 +17,7 @@
 \NewDocumentCommand \fontspec { O{} m O{} }
   {
     \@@_main_fontspec:nn {#1,#3} {#2}
+    \ignorespaces
   }
 %    \end{macrocode}
 %
@@ -24,6 +25,7 @@
 \NewDocumentCommand \setmainfont { O{} m O{} }
   {
     \@@_main_setmainfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 %    \end{macrocode}
 %
@@ -31,6 +33,7 @@
 \NewDocumentCommand \setsansfont { O{} m O{} }
   {
     \@@_main_setsansfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 %    \end{macrocode}
 %
@@ -38,6 +41,7 @@
 \NewDocumentCommand \setmonofont { O{} m O{} }
   {
     \@@_main_setmonofont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 %    \end{macrocode}
 %
@@ -83,11 +87,25 @@
 %    \begin{macrocode}
 \NewDocumentCommand \newfontfamily { m O{} m O{} }
   {
-    \@@_main_newfontfamily:nnn {#1} {#2,#4} {#3}
+    \@@_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \NewDocumentCommand
   }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\NewDocumentCommand \renewfontfamily { m O{} m O{} }
+  {
+    \@@_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \RenewDocumentCommand
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\NewDocumentCommand \setfontfamily { m O{} m O{} }
+  {
+    \@@_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \DeclareDocumentCommand
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \NewDocumentCommand \newfontface { m O{} m O{} }
   {
     \@@_main_newfontface:nnn {#1} {#2,#4} {#3}
@@ -94,12 +112,19 @@
   }
 %    \end{macrocode}
 %
+% \begin{macro}{\defaultfontfeatures}
+%   This macro takes one argument that consists of all of feature
+%   options that will be applied by default to all subsequent \cs{fontspec} commands.
 %    \begin{macrocode}
 \NewDocumentCommand \defaultfontfeatures { t+ o m }
   {
-    \@@_main_defaultfontfeatures:nnn {#1} {#2} {#3}
+    \IfNoValueTF {#2}
+      { \@@_set_default_features:nn {#1} {#3} }
+      { \@@_set_font_default_features:nnn {#1} {#2} {#3} }
+    \ignorespaces
   }
 %    \end{macrocode}
+% \end{macro}
 %
 %    \begin{macrocode}
 \NewDocumentCommand \addfontfeatures {m}
@@ -106,6 +131,9 @@
   {
     \@@_main_addfontfeatures:n {#1}
   }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \NewDocumentCommand \addfontfeature  {m}
   {
     \@@_main_addfontfeatures:n {#1}
@@ -180,9 +208,9 @@
 % \end{macro}
 %
 %    \begin{macrocode}
-\NewDocumentCommand \DeclareFontsExtensions {m}
+\NewDocumentCommand \DeclareFontExtensions {m}
   {
-    \@@_main_DeclareFontsExtensions:n {#1}
+    \@@_main_DeclareFontExtensions:n {#1}
   }
 %    \end{macrocode}
 %
@@ -206,7 +234,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -57,7 +57,7 @@
   \@@_preparse_features:
   \@@_load_font:
   \@@_set_scriptlang:
-  \@@_get_features:Nn \l_@@_rawfeatures_sclist {}
+  \@@_get_features:n {}
   \bool_set_false:N \l_@@_firsttime_bool
 
   \@@_save_family_needed:nTF {#2}
@@ -69,6 +69,8 @@
 %<debug>  \typeout{Font~ family~ already~ defined.}
    }
   \group_end:
+
+  \tl_set_eq:NN \l_fontspec_family_tl \g_@@_nfss_family_tl
  }
 %    \end{macrocode}
 % \end{macro}
@@ -337,11 +339,11 @@
 % Do not set the colour if not explicitly spec'd else \verb|\color| (using
 % specials) will not work.
 %    \begin{macrocode}
-\cs_new:Nn \@@_get_features:Nn
+\cs_new:Nn \@@_get_features:n
  {
-%<debug>  \typeout{:: @@_get_features:Nn \exp_not:N #1 { \exp_not:n {#2} } }
+%<debug>  \typeout{:: @@_get_features:Nn { \exp_not:n {#1} } }
   \@@_init_fontface:
-  \@@_keys_set_known:nxN {fontspec-renderer} {\l_@@_fontfeat_clist,#2}
+  \@@_keys_set_known:nxN {fontspec-renderer} {\l_@@_fontfeat_clist,#1}
     \l_@@_keys_leftover_clist
   \@@_keys_set_known:nxN {fontspec} {\l_@@_keys_leftover_clist} \l_@@_keys_leftover_clist
 %<*XE>
@@ -367,10 +369,8 @@
     { \@@_update_featstr:n { mapping = \l_@@_mapping_tl } }
 
   \str_if_eq_x:nnF { \l_@@_hexcol_tl \l_@@_opacity_tl }
-                   { \g_@@_hexcol_tl \g_@@_opacity_tl }
+                   { \c_@@_hexcol_tl \c_@@_opacity_tl }
     { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
-
-  \tl_set_eq:NN #1 \l_@@_rawfeatures_sclist
  }
 %    \end{macrocode}
 % \end{macro}
@@ -386,41 +386,45 @@
 % selecting.
 %
 %    \begin{macrocode}
-\prg_new_conditional:Nnn \@@_save_family_needed:n {TF}
- {
+\prg_new_conditional:Nnn \@@_save_family_needed:n { TF }
+  {
 
 %<debug>  \typeout{save~ family:~ #1}
 %<debug>  \typeout{== fontid_tl: "\l_@@_fontid_tl".}
 
-  \tl_if_exist:cF {g_@@_UID_\l_@@_fontid_tl}
+  \tl_if_empty:NTF \l_@@_nfss_fam_tl
     {
-      \tl_new:c {g_@@_UID_\l_@@_fontid_tl}
+      \prop_get:NVNTF \g_@@_fontid_family_prop \l_@@_fontid_tl \l_@@_tmp_tl
+        {
+          \tl_gset_eq:NN \g_@@_nfss_family_tl \l_@@_tmp_tl
+          \prg_return_false:
+        }
+        {
+          \tl_set:Nx \l_@@_tmp_tl {#1}
+          \tl_remove_all:Nn \l_@@_tmp_tl { ~ }
+          \@@_save_fontid_family:VV \l_@@_fontid_tl \l_@@_tmp_tl
+          \prg_return_true:
+        }
     }
-
-  \tl_if_exist:NT \l_@@_nfss_fam_tl
     {
-      \tl_set_eq:cN {g_@@_UID_\l_@@_fontid_tl} \l_@@_nfss_fam_tl
+      \tl_gset_eq:NN \g_@@_nfss_family_tl \l_@@_nfss_fam_tl
+      \cs_undefine:c { g_@@_fontinfo_ \g_@@_nfss_family_tl _prop }
+      \prg_return_true:
     }
-
-  \tl_if_empty:cT {g_@@_UID_\l_@@_fontid_tl}
-   {
-    % The font name is fully expanded, in case it's defined in terms of macros, before having its spaces zapped:
-    \tl_set:Nx \l_@@_tmp_tl {#1}
-    \tl_remove_all:Nn \l_@@_tmp_tl {~}
-
-    \cs_if_exist:cTF {g_@@_family_ \l_@@_tmp_tl _int}
-     { \int_gincr:c  {g_@@_family_ \l_@@_tmp_tl _int} }
-     { \int_new:c    {g_@@_family_ \l_@@_tmp_tl _int} }
-
-    \tl_gset:cx {g_@@_UID_\l_@@_fontid_tl}
-     {
-      \l_@@_tmp_tl ( \int_use:c {g_@@_family_ \l_@@_tmp_tl _int} )
-     }
-   }
-  \tl_gset:Nv \l_fontspec_family_tl {g_@@_UID_\l_@@_fontid_tl}
-  \cs_if_exist:cTF {g_@@_fontinfo_ \l_fontspec_family_tl _prop}
-    \prg_return_false: \prg_return_true:
- }
+  }
+\cs_new:Nn \@@_save_fontid_family:nn
+  {
+    \prop_get:NnNTF \g_@@_family_int_prop {#2} \l_@@_tmp_tl
+      {
+        \tl_set:Nx \l_@@_tmp_tl
+          { \int_eval:n { \l_@@_tmp_tl + 1 } }
+      }
+      { \tl_set:Nn \l_@@_tmp_tl { 0 } }
+    \prop_gput:NnV \g_@@_family_int_prop {#2} \l_@@_tmp_tl
+    \tl_gset:Nx \g_@@_nfss_family_tl { #2 ( \l_@@_tmp_tl ) }
+    \prop_gput:NnV \g_@@_fontid_family_prop {#1} \g_@@_nfss_family_tl
+  }
+\cs_generate_variant:Nn \@@_save_fontid_family:nn { VV }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -431,7 +435,7 @@
   {
     \@@_save_fontinfo:n {#2}
     \@@_find_autofonts:
-    \DeclareFontFamily{\l_@@_nfss_enc_tl}{\l_fontspec_family_tl}{}
+    \DeclareFontFamily{\g_@@_nfss_enc_tl}{\g_@@_nfss_family_tl}{}
     \@@_set_faces:
     \@@_info:nxx {defining-font} {#1} {#2}
   }
@@ -443,18 +447,18 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_save_fontinfo:n
  {
-  \prop_new:c    {g_@@_fontinfo_ \l_fontspec_family_tl _prop}
-  \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {fontname} { #1 }
-  \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {options}  { \l_@@_all_features_clist }
-  \prop_gput:cnx {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {fontdef}
+  \prop_new:c    {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop}
+  \prop_gput:cnx {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {fontname} { #1 }
+  \prop_gput:cnx {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {options}  { \l_@@_all_features_clist }
+  \prop_gput:cnx {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {fontdef}
    {
     \@@_construct_font_call:nn {\l_fontspec_fontname_tl}
-      { \l_@@_pre_feat_sclist \l_@@_rawfeatures_sclist }
+      { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
    }
-  \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {script-num} \l_@@_script_int
-  \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {lang-num} \l_@@_language_int
-  \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
-  \prop_gput:cnV {g_@@_fontinfo_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+  \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
+  \prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {script-tag} \l_fontspec_script_tl
+  \prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
  }
 %    \end{macrocode}
 % \end{macro}
@@ -761,14 +765,14 @@
  {
 %<debug>\typeout{====~Setup~NFSS~shape:~<\l_@@_size_tl>~\l_fontspec_fontname_tl}
 
-  \@@_get_features:Nn \l_@@_rawfeatures_sclist { #2 , #3 , #4 }
-%<debug>\typeout{====~Gathered~features:~\l_@@_rawfeatures_sclist}
+  \@@_get_features:n { #2 , #3 , #4 }
+%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist}
 
   \tl_put_right:Nx #1
    {
     <\l_@@_size_tl> \l_@@_scale_tl
       \@@_construct_font_call:nn { \l_fontspec_fontname_tl }
-        { \l_@@_pre_feat_sclist \l_@@_rawfeatures_sclist }
+        { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
    }
  }
 %    \end{macrocode}
@@ -778,7 +782,7 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_declare_shapes_normal:nn
   {
-    \@@_DeclareFontShape:xxxxxx {\l_@@_nfss_enc_tl} {\l_fontspec_family_tl}
+    \@@_DeclareFontShape:xxxxxx {\g_@@_nfss_enc_tl} {\g_@@_nfss_family_tl}
       {#1} {#2} {\l_@@_nfss_tl}{\l_@@_postadjust_tl}
   }
 %    \end{macrocode}
@@ -790,7 +794,7 @@
   {
     \tl_if_empty:NF \l_@@_nfss_sc_tl
      {
-      \@@_DeclareFontShape:xxxxxx {\l_@@_nfss_enc_tl} {\l_fontspec_family_tl} {#1}
+      \@@_DeclareFontShape:xxxxxx {\g_@@_nfss_enc_tl} {\g_@@_nfss_family_tl} {#1}
         { \@@_combo_sc_shape:n {#2} } {\l_@@_nfss_sc_tl} {\l_@@_postadjust_tl}
      }
   }
@@ -833,8 +837,8 @@
     !(\str_if_eq_x_p:nn {\itdefault} {\sldefault})
    }
    {
-    \@@_DeclareFontShape:xxxxxx {\l_@@_nfss_enc_tl}{\l_fontspec_family_tl}{#1}{\sldefault}
-      {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l_@@_postadjust_tl}
+    \@@_DeclareFontShape:xxxxxx {\g_@@_nfss_enc_tl}{\g_@@_nfss_family_tl}{#1}{\sldefault}
+      {<->ssub*\g_@@_nfss_family_tl/#1/\itdefault}{\l_@@_postadjust_tl}
    }
  }
 %    \end{macrocode}
@@ -845,7 +849,7 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_declare_shape_loginfo:nn
  {
-  \tl_gput_right:Nx \l_fontspec_defined_shapes_tl
+  \tl_gput_right:Nx \g_@@_defined_shapes_tl
    {
     \exp_not:n { \\ }
     -~ \exp_not:N \str_case:nn {#1/#2}
@@ -939,7 +943,7 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_update_featstr:n}
-% \cmd{\l_@@_rawfeatures_sclist} is the string used to define the list of specific
+% \cmd{\g_@@_rawfeatures_sclist} is the string used to define the list of specific
 % font features. Each time another font feature is requested, this
 % macro is used to add that feature to the list. Font features are
 % separated by semicolons.
@@ -951,7 +955,7 @@
       {
         \tl_gset:Nx \g_@@_single_feat_tl { #1 }
 %<debug>            \typeout{::::~ Adding~ feature.}
-        \tl_gput_right:Nx  \l_@@_rawfeatures_sclist {#1;}
+        \tl_gput_right:Nx  \g_@@_rawfeatures_sclist {#1;}
       }
   }
 %    \end{macrocode}
@@ -965,7 +969,7 @@
     \clist_map_inline:nn {#1}
       {
 %<debug>        \typeout{::::~ Removing~ feature~ "##1;"}
-        \tl_gremove_all:Nn \l_@@_rawfeatures_sclist {##1;}
+        \tl_gremove_all:Nn \g_@@_rawfeatures_sclist {##1;}
       }
   }
 %    \end{macrocode}
@@ -988,9 +992,9 @@
   \tl_clear:N \l_@@_optical_size_tl
   \tl_clear:N \l_@@_ttc_index_tl
   \tl_clear:N \l_fontspec_renderer_tl
-  \tl_clear:N \l_fontspec_defined_shapes_tl
-  \tl_clear:N \g_@@_curr_series_tl
-  \tl_gset_eq:NN \l_@@_nfss_enc_tl \g_fontspec_encoding_tl
+  \tl_gclear:N \g_@@_defined_shapes_tl
+  \tl_gclear:N \g_@@_curr_series_tl
+  \tl_gset_eq:NN \g_@@_nfss_enc_tl \g_fontspec_encoding_tl
 
 %<*LU>
   \tl_set:Nn \l_fontspec_mode_tl {node}
@@ -1008,11 +1012,11 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_init_fontface:
   {
-    \tl_clear:N \l_@@_rawfeatures_sclist
+    \tl_gclear:N \g_@@_rawfeatures_sclist
     \tl_clear:N \l_@@_scale_tl
-    \tl_set_eq:NN \l_@@_opacity_tl \g_@@_opacity_tl
-    \tl_set_eq:NN \l_@@_hexcol_tl \g_@@_hexcol_tl
-    \tl_set_eq:NN \l_@@_postadjust_tl \g_@@_postadjust_tl
+    \tl_set_eq:NN \l_@@_opacity_tl \c_@@_opacity_tl
+    \tl_set_eq:NN \l_@@_hexcol_tl \c_@@_hexcol_tl
+    \tl_set_eq:NN \l_@@_postadjust_tl \c_@@_postadjust_tl
     \tl_clear:N \l_@@_wordspace_adjust_tl
     \tl_clear:N \l_@@_punctspace_adjust_tl
   }
@@ -1074,7 +1078,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -13,7 +13,7 @@
 %
 %
 %    \begin{macrocode}
-\clist_set:Nn \g_@@_all_keyval_modules_clist
+\clist_gset:Nn \g_@@_all_keyval_modules_clist
   {
     fontspec, fontspec-opentype, fontspec-aat,
     fontspec-preparse, fontspec-preparse-cfg, fontspec-preparse-external, fontspec-preparse-nested,
@@ -24,7 +24,7 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_keys_define_code:nnn
   {
-   \keys_define:nn {#1} { #2 .code:n = {#3} }
+    \keys_define:nn {#1} { #2 .code:n = {#3} }
   }
 %    \end{macrocode}
 %
@@ -210,7 +210,7 @@
     \seq_if_empty:NT \g_@@_bf_series_seq
      {
       \tl_gset:Nx \g_@@_curr_series_tl {\bfdefault}
-      \seq_put_right:Nx \g_@@_bf_series_seq {\bfdefault}
+      \seq_gput_right:Nx \g_@@_bf_series_seq {\bfdefault}
      }
     \tl_if_eq:oxT \g_@@_curr_series_tl {\bfdefault}
      { \tl_set_eq:NN \l_@@_fontname_bf_tl \l_@@_curr_bfname_tl }
@@ -357,7 +357,7 @@
 %    \begin{macrocode}
 \@@_keys_define_code:nnn {fontspec-preparse} {NFSSEncoding}
  {
-  \tl_gset:Nx \l_@@_nfss_enc_tl { #1 }
+  \tl_gset:Nx \g_@@_nfss_enc_tl { #1 }
  }
 %    \end{macrocode}
 %
@@ -368,9 +368,6 @@
 \@@_keys_define_code:nnn {fontspec-preparse} {NFSSFamily}
  {
   \tl_set:Nx \l_@@_nfss_fam_tl { #1 }
-  \cs_undefine:c {g_@@_UID_\l_@@_fontid_tl}
-  \tl_if_exist:NT \l_fontspec_family_tl
-   { \cs_undefine:c {g_@@_fontinfo_ \l_fontspec_family_tl _prop} }
  }
 %    \end{macrocode}
 %
@@ -378,28 +375,24 @@
 % This option looks similar in name but has a very different function.
 %    \begin{macrocode}
 \@@_keys_define_code:nnn {fontspec} {FontFace}
- {
-  \tl_set:No \l_@@_arg_tl { \use_iii:nnn #1 }
-  \tl_set_eq:NN \l_@@_this_feat_tl \l_@@_arg_tl
-  \tl_clear:N \l_@@_this_font_tl
-  \int_compare:nT { \clist_count:N \l_@@_arg_tl = 1 }
-   {
-%<*debug>
-    \typeout{FontFace~ parsing:~ one~ clist~ item}
-%</debug>
-    \tl_if_in:NnF \l_@@_arg_tl {=}
-     {
-%<*debug>
-      \typeout{FontFace~ parsing:~ no~ equals~ =>~ font~ name~ only}
-%</debug>
-      \tl_set_eq:NN \l_@@_this_font_tl \l_@@_arg_tl
-      \tl_clear:N \l_@@_this_feat_tl
-     }
-   }
+  {
+    \tl_clear:N \l_@@_this_font_tl
+    \clist_set:No \l_@@_arg_clist { \use_iii:nnn #1 }
+    \clist_set_eq:NN \l_@@_this_feat_clist \l_@@_arg_clist
+    \int_compare:nT { \clist_count:N \l_@@_arg_clist = 1 }
+      {
+%<debug>\typeout{FontFace~ parsing:~ one~ clist~ item}
+        \tl_if_in:NnF \l_@@_arg_clist {=}
+          {
+%<debug>\typeout{FontFace~ parsing:~ no~ equals~ =>~ font~ name~ only}
+            \tl_set_eq:NN \l_@@_this_font_tl \l_@@_arg_clist
+            \tl_clear:N \l_@@_this_feat_clist
+          }
+      }
 
-  \@@_add_nfssfont:nnnn
-   {\use_i:nnn #1}{\use_ii:nnn #1}{\l_@@_this_font_tl}{\l_@@_this_feat_tl}
- }
+    \@@_add_nfssfont:nnnn
+      {\use_i:nnn #1} {\use_ii:nnn #1} {\l_@@_this_font_tl} {\l_@@_this_feat_clist}
+  }
 %    \end{macrocode}
 %
 %
@@ -634,7 +627,7 @@
 \cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8
  {
   \tl_set:Nn \l_@@_hexcol_tl {#1#2#3#4#5#6}
-  \tl_if_eq:NNF \l_@@_opacity_tl \g_@@_opacity_tl
+  \tl_if_eq:NNF \l_@@_opacity_tl \c_@@_opacity_tl
    {
     \bool_if:NF \l_@@_firsttime_bool
      { \@@_warning:nx {opa-twice-col} {#7#8} }
@@ -648,7 +641,7 @@
  {
   \int_set:Nn \l_@@_tmp_int {255}
   \@@_int_mult_truncate:Nn \l_@@_tmp_int { #1 }
-  \tl_if_eq:NNF \l_@@_opacity_tl \g_@@_opacity_tl
+  \tl_if_eq:NNF \l_@@_opacity_tl \c_@@_opacity_tl
    {
     \bool_if:NF \l_@@_firsttime_bool
      { \@@_warning:nx {opa-twice} {#1} }
@@ -854,7 +847,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lang.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lang.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lang.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -406,7 +406,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-lua.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -16,6 +16,7 @@
 %    \end{macrocode}
 %
 % We need a catcode table for tex.sprint(). See issue \#230.
+% TODO: probably time to get rid of the backwards compatibility here:
 %    \begin{macrocode}
 local latex
 if luatexbase.registernumber then
@@ -71,10 +72,10 @@
 function fontspec.mathfontdimen(fnt, str)
     local mathdimens = luaotfload.aux.get_math_dimension(fnt, str)
     if mathdimens then
-        tex.sprint(mathdimens)
-        tex.sprint("sp")
+        tex.sprint(-2,mathdimens)
+        tex.sprint(-2,"sp")
     else
-        tex.sprint("0pt")
+        tex.sprint(-2,"0pt")
     end
 end
 %    \end{macrocode}
@@ -88,7 +89,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-math.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-math.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-math.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -24,24 +24,23 @@
 %
 %    \begin{macrocode}
 \@ifpackageloaded{euler}
- {
-  \bool_set_true:N \g_@@_pkg_euler_loaded_bool
- }
- {
-  \bool_set_false:N \g_@@_pkg_euler_loaded_bool
- }
+  { \bool_gset_true:N  \g_@@_pkg_euler_loaded_bool }
+  { \bool_gset_false:N \g_@@_pkg_euler_loaded_bool }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \cs_new:Nn \fontspec_setup_maths:
  {
   \@ifpackageloaded{euler}
    {
     \bool_if:NTF \g_@@_pkg_euler_loaded_bool
-     { \bool_set_true:N \g_@@_math_euler_bool }
+     { \bool_gset_true:N \g_@@_math_euler_bool }
      { \@@_error:n {euler-too-late} }
    }
    {}
-  \@ifpackageloaded{lucbmath}{\bool_set_true:N \g_@@_math_lucida_bool}{}
-  \@ifpackageloaded{lucidabr}{\bool_set_true:N \g_@@_math_lucida_bool}{}
-  \@ifpackageloaded{lucimatx}{\bool_set_true:N \g_@@_math_lucida_bool}{}
+  \@ifpackageloaded{lucbmath}{ \bool_gset_true:N \g_@@_math_lucida_bool }{}
+  \@ifpackageloaded{lucidabr}{ \bool_gset_true:N \g_@@_math_lucida_bool }{}
+  \@ifpackageloaded{lucimatx}{ \bool_gset_true:N \g_@@_math_lucida_bool }{}
 %    \end{macrocode}
 % Knuth's CM fonts fonts are all squashed together, combining letters,
 % accents, text symbols and maths symbols all in the one font,
@@ -192,34 +191,34 @@
  {
   \@ifpackageloaded{anttor}
    {
-    \ifx\define at antt@mathversions a\bool_set_false:N \g_@@_math_bool\fi
+    \ifx\define at antt@mathversions a\bool_gset_false:N \g_@@_math_bool\fi
    }{}
-  \@ifpackageloaded{arevmath}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{eulervm}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{mathdesign}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{concmath}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{cmbright}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{mathesf}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{arevmath}       {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{eulervm}        {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{mathdesign}     {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{concmath}       {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{cmbright}       {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{mathesf}        {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{gfsartemisia}   {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{gfsneohellenic} {\bool_gset_false:N \g_@@_math_bool}{}
   \@ifpackageloaded{iwona}
    {
     \ifx\define at iwona@mathversions a\bool_set_false:N \g_@@_math_bool\fi
    }{}
-  \@ifpackageloaded{kpfonts}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{kmath}{\bool_set_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{kpfonts}{\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{kmath}  {\bool_gset_false:N \g_@@_math_bool}{}
   \@ifpackageloaded{kurier}
    {
     \ifx\define at kurier@mathversions a\bool_set_false:N \g_@@_math_bool\fi
    }{}
-  \@ifpackageloaded{fouriernc}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{fourier}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{lmodern}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{mathpazo}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{mathptmx}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{MinionPro}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{unicode-math}{\bool_set_false:N \g_@@_math_bool}{}
-  \@ifpackageloaded{breqn}{\bool_set_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{fouriernc}    {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{fourier}      {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{lmodern}      {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{mathpazo}     {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{mathptmx}     {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{MinionPro}    {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{unicode-math} {\bool_gset_false:N \g_@@_math_bool}{}
+  \@ifpackageloaded{breqn}        {\bool_gset_false:N \g_@@_math_bool}{}
   \bool_if:NT \g_@@_math_bool
    {
     \@@_info:n {setup-math}
@@ -243,7 +242,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-msg.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-msg.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-msg.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -214,11 +214,11 @@
 %    \begin{macrocode}
 \@@_msg_new:nnn {fontspec} {defining-font}
  {
-  Font family '\l_fontspec_family_tl' created for font '#2'
+  Font family '\g_@@_nfss_family_tl' created for font '#2'
   with options [\l_@@_all_features_clist].\\
   \\
   This font family consists of the following NFSS series/shapes:\\
-  \l_fontspec_defined_shapes_tl
+  \g_@@_defined_shapes_tl
  }
 \@@_msg_new:nnn {fontspec} {no-font-shape}
  {
@@ -274,7 +274,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opening.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -12,23 +12,34 @@
 %
 %    \begin{macrocode}
 \DeclareOption{cm-default}
- { \@@_warning:n {cm-default-obsolete} }
-\DeclareOption{math}{\bool_set_true:N \g_@@_math_bool}
-\DeclareOption{no-math}{\bool_set_false:N \g_@@_math_bool}
-\DeclareOption{config}{\bool_set_true:N \g_@@_cfg_bool}
-\DeclareOption{no-config}{\bool_set_false:N \g_@@_cfg_bool}
-\DeclareOption{euenc}{\bool_set_true:N  \g_@@_euenc_bool}
-\DeclareOption{tuenc}{\bool_set_false:N \g_@@_euenc_bool}
-\DeclareOption{quiet}
- {
-  \msg_redirect_module:nnn { fontspec } { warning } { info }
-  \msg_redirect_module:nnn { fontspec } { info } { none }
- }
+  {
+    \@@_warning:n {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 }
+%    \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 }
- }
+  {
+    \msg_redirect_module:nnn { fontspec } { warning } { none }
+    \msg_redirect_module:nnn { fontspec } { info } { none }
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \ExecuteOptions{config,math,tuenc}
 \ProcessOptions*
 %    \end{macrocode}
@@ -53,15 +64,15 @@
       }
       {
         \@@_warning:n {tu-missing}
-        \bool_set_true:N \g_@@_euenc_bool
+        \bool_gset_true:N \g_@@_euenc_bool
       }
   }
 \bool_if:NTF \g_@@_euenc_bool
   {
-%<XE>    \tl_set:Nn \g_fontspec_encoding_tl {EU1}
-%<LU>    \tl_set:Nn \g_fontspec_encoding_tl {EU2}
+%<XE>    \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
+%<LU>    \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
   }
-  { \tl_set:Nn \g_fontspec_encoding_tl { TU } }
+  { \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -172,7 +183,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -426,7 +426,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-patches.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -196,7 +196,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-scripts.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-scripts.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-scripts.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -171,7 +171,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -11,19 +11,19 @@
 %
 %
 % \subsection{Font selection}
-% \begin{macro}{\fontspec}
+%
+% \begin{macro}{\@@_main_fontspec:nn}
 %   This is the main command of the package that
 %   selects fonts with various features. It takes two arguments: the
 %   font name and the optional requested features of that
-%   font. Then this new font family is selected.
+%   font.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_fontspec:nn
- {
-  \fontspec_set_family:Nnn \f at family {#1} {#2}
-  \fontencoding { \l_@@_nfss_enc_tl }
-  \selectfont
-  \ignorespaces
- }
+  {
+    \fontspec_set_family:Nnn \f at family {#1} {#2}
+    \fontencoding { \g_@@_nfss_enc_tl }
+    \selectfont
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -36,22 +36,23 @@
 %     used in the document, the change registers immediately.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setmainfont:nn
- {
-  \fontspec_set_family:Nnn \g_@@_rmfamily_family {#1} {#2}
-  \tl_set_eq:NN \rmdefault \g_@@_rmfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
-   {
-    \exp_not:N \fontencoding { \l_@@_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g_@@_rmfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l_@@_rmfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \rmdefault \l_@@_rmfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \rmfamily }
+          {
+            \exp_not:N \fontencoding { \g_@@_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l_@@_rmfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\rmdefault}
+      { \tl_set_eq:NN \encodingdefault \g_@@_nfss_enc_tl }
+    \@@_setmainfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\rmdefault}
-    { \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
-  \@@_setmainfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -59,22 +60,23 @@
 % Same as above.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setsansfont:nn
- {
-  \fontspec_set_family:Nnn \g_@@_sffamily_family {#1} {#2}
-  \tl_set_eq:NN \sfdefault \g_@@_sffamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
-   {
-    \exp_not:N \fontencoding { \l_@@_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g_@@_sffamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l_@@_sffamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \sfdefault \l_@@_sffamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \sffamily }
+          {
+            \exp_not:N \fontencoding { \g_@@_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l_@@_sffamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\sfdefault}
+      { \tl_set_eq:NN \encodingdefault \g_@@_nfss_enc_tl }
+    \@@_setsansfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\sfdefault}
-    { \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
-  \@@_setsansfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -82,22 +84,23 @@
 % Same as above.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setmonofont:nn
- {
-  \fontspec_set_family:Nnn \g_@@_ttfamily_family {#1} {#2}
-  \tl_set_eq:NN \ttdefault \g_@@_ttfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
-   {
-    \exp_not:N \fontencoding { \l_@@_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g_@@_ttfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l_@@_ttfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \ttdefault \l_@@_ttfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \ttfamily }
+          {
+            \exp_not:N \fontencoding { \g_@@_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l_@@_ttfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\ttdefault}
+      { \tl_set_eq:NN \encodingdefault \g_@@_nfss_enc_tl }
+    \@@_setmonofont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\ttdefault}
-    { \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
-  \@@_setmonofont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -113,8 +116,8 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setmathrm:nn
   {
-%<XE>    \fontspec_set_family:Nnn \g_@@_mathrm_tl {#1} {#2}
-%<LU>    \fontspec_set_family:Nnn \g_@@_mathrm_tl {Renderer=Basic,#1} {#2}
+%<XE> \fontspec_set_family:Nnn \g_@@_mathrm_tl {#1} {#2}
+%<LU> \fontspec_set_family:Nnn \g_@@_mathrm_tl {Renderer=Basic,#1} {#2}
     \@@_setmathrm_hook:nn {#1} {#2}
   }
 %    \end{macrocode}
@@ -124,8 +127,8 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setboldmathrm:nn
   {
-%<XE>    \fontspec_set_family:Nnn \g_@@_bfmathrm_tl {#1} {#2}
-%<LU>    \fontspec_set_family:Nnn \g_@@_bfmathrm_tl {Renderer=Basic,#1} {#2}
+%<XE> \fontspec_set_family:Nnn \g_@@_bfmathrm_tl {#1} {#2}
+%<LU> \fontspec_set_family:Nnn \g_@@_bfmathrm_tl {Renderer=Basic,#1} {#2}
     \@@_setboldmathrm_hook:nn {#1} {#2}
   }
 %    \end{macrocode}
@@ -135,8 +138,8 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setmathsf:nn
   {
-%<XE>    \fontspec_set_family:Nnn \g_@@_mathsf_tl {#1} {#2}
-%<LU>    \fontspec_set_family:Nnn \g_@@_mathsf_tl {Renderer=Basic,#1} {#2}
+%<XE> \fontspec_set_family:Nnn \g_@@_mathsf_tl {#1} {#2}
+%<LU> \fontspec_set_family:Nnn \g_@@_mathsf_tl {Renderer=Basic,#1} {#2}
     \@@_setmathsf_hook:nn {#1} {#2}
   }
 %    \end{macrocode}
@@ -146,8 +149,8 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_setmathtt:nn
   {
-%<XE>    \fontspec_set_family:Nnn \g_@@_mathtt_tl {#1} {#2}
-%<LU>    \fontspec_set_family:Nnn \g_@@_mathtt_tl {Renderer=Basic,#1} {#2}
+%<XE> \fontspec_set_family:Nnn \g_@@_mathtt_tl {#1} {#2}
+%<LU> \fontspec_set_family:Nnn \g_@@_mathtt_tl {Renderer=Basic,#1} {#2}
     \@@_setmathtt_hook:nn {#1} {#2}
   }
 %    \end{macrocode}
@@ -175,101 +178,82 @@
 % If the commands above are not executed, then \cmd\rmdefault\ (\etc)
 % will be used.
 %    \begin{macrocode}
-\tl_set:Nn \g_@@_mathrm_tl {\rmdefault}
-\tl_set:Nn \g_@@_mathsf_tl {\sfdefault}
-\tl_set:Nn \g_@@_mathtt_tl {\ttdefault}
+\tl_gset:Nn \g_@@_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g_@@_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g_@@_mathtt_tl {\ttdefault}
 %    \end{macrocode}
 %
-% \begin{macro}{\newfontfamily}
-%   This macro takes the arguments of \cs{fontspec} with a prepended
-%   \meta{instance cmd}. This command is used
-%   when a specific font instance needs to be referred to repetitively
-%   (\eg, in a section heading) since continuously calling
-%   \cs{fontspec_select:nn} is inefficient because it must parse the
-%   option arguments every time.
-%
-%   \cs{fontspec_select:nn} defines a font family and saves its name in
-%   \cs{l_fontspec_family_tl}. This family is then used in a typical NFSS \cmd\fontfamily\
-%   declaration, saved in the macro name specified.
+% \begin{macro}{\@@_main_newfontfamily:nnnN}
+%   The inner fontspec workings define a font family, which is then used in a typical
+%   NFSS \cmd\fontfamily\ declaration, saved in the macro name specified.
+%   The fourth argument determines which xparse function to set the macro with (new/renew/etc).
 %    \begin{macrocode}
-\cs_new:Nn \@@_main_newfontfamily:nnn
- {
-  \fontspec_set_family:cnn { g_@@_ \cs_to_str:N #1 _family } {#2} {#3}
-  \use:x
-   {
-    \exp_not:N \DeclareRobustCommand \exp_not:N #1
-     {
-      \exp_not:N \fontfamily { \use:c {g_@@_ \cs_to_str:N #1 _family} }
-      \exp_not:N \fontencoding { \l_@@_nfss_enc_tl }
-      \exp_not:N \selectfont
-     }
-   }
- }
+\cs_new:Nn \@@_main_newfontfamily:nnnN
+  {
+    \fontspec_set_family:cnn { l_@@_ \cs_to_str:N #1 _family_tl } {#2} {#3}
+    \use:x
+      {
+        \exp_not:N #4 \exp_not:N #1 {}
+          {
+            \exp_not:N \fontfamily { \use:c { l_@@_ \cs_to_str:N #1 _family_tl } }
+            \exp_not:N \fontencoding { \g_@@_nfss_enc_tl }
+            \exp_not:N \selectfont
+          }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\newfontface}
+% \begin{macro}{\@@_main_newfontface:nnn}
 % \cmd\newfontface\ uses the fact that if the argument to \feat{BoldFont}, etc., is empty (\ie, |BoldFont={}|), then no bold font is searched for.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_newfontface:nnn
- {
-  \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
- }
+  {
+    \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 % \subsection{Font feature selection}
 %
-% \begin{macro}{\defaultfontfeatures}
-%   This macro takes one argument that consists of all of feature
-%   options that will be applied by default to all subsequent
-%   \cs{fontspec}, et al., commands. It stores its value in
-%   \cs{g_fontspec_default_fontopts_tl} (initialised empty), which is
-%   concatenated with the individual macro choices in the
-%   [...] macro.
+% \begin{macro}{\@@_set_default_features:nn}
 %    \begin{macrocode}
-\cs_new:Nn \@@_main_defaultfontfeatures:nnn
-  {
-    \IfNoValueTF {#2}
-     { \@@_set_default_features:nn {#1} {#3} }
-     { \@@_set_font_default_features:nnn {#1} {#2} {#3} }
-    \ignorespaces
-  }
-%    \end{macrocode}
-%
-%    \begin{macrocode}
 \cs_new:Nn \@@_set_default_features:nn
   {
-    \IfBooleanTF {#1} \clist_put_right:Nn \clist_set:Nn
+    \IfBooleanTF {#1} \clist_gput_right:Nn \clist_gset:Nn
       \g_@@_default_fontopts_clist {#2}
   }
 %    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_set_font_default_features:nnn}
 % The optional argument |#2| specifies font identifier(s).
 % Branch for either (a)~single token input such as \verb|\rmdefault|, or (b)~otherwise assume its a fontname.
 % In that case, strip spaces and file extensions and lower-case to ensure consistency.
 %    \begin{macrocode}
 \cs_new:Nn \@@_set_font_default_features:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \tl_if_single:nTF {##1}
-     { \tl_set:No \l_@@_tmp_tl { \cs:w g_@@_ \cs_to_str:N ##1 _family\cs_end: } }
-     { \@@_sanitise_fontname:Nn \l_@@_tmp_tl {##1} }
+  {
+%<debug> \typeout{\unexpanded{_set_font_default_features:nnn:{#1}{#2}{#3}}}
+    \clist_map_inline:nn {#2}
+      {
+        \tl_if_single:nTF {##1}
+          { \tl_set:No \l_@@_tmp_tl { \cs:w l_@@_ \cs_to_str:N ##1 _family_tl\cs_end: } }
+          { \@@_sanitise_fontname:Nn \l_@@_tmp_tl {##1} }
 
-    \IfBooleanTF {#1}
-     {
-      \prop_get:NVNF \g_@@_fontopts_prop \l_@@_tmp_tl \l_@@_tmpb_tl
-       { \tl_clear:N \l_@@_tmpb_tl }
-      \tl_put_right:Nn \l_@@_tmpb_tl {#3,}
-      \prop_gput:NVV   \g_@@_fontopts_prop \l_@@_tmp_tl \l_@@_tmpb_tl
-     }
-     {
-      \tl_if_empty:nTF {#3}
-       { \prop_gremove:NV \g_@@_fontopts_prop \l_@@_tmp_tl }
-       { \prop_put:NVn    \g_@@_fontopts_prop \l_@@_tmp_tl {#3,} }
-     }
-   }
- }
+        \IfBooleanTF {#1}
+          {
+            \prop_get:NVNF \g_@@_fontopts_prop \l_@@_tmp_tl \l_@@_tmpb_tl
+              { \tl_clear:N \l_@@_tmpb_tl }
+            \tl_put_right:Nn \l_@@_tmpb_tl {#3,}
+            \prop_gput:NVV   \g_@@_fontopts_prop \l_@@_tmp_tl \l_@@_tmpb_tl
+          }
+          {
+            \tl_if_empty:nTF {#3}
+              { \prop_gremove:NV \g_@@_fontopts_prop \l_@@_tmp_tl }
+              { \prop_gput:NVn    \g_@@_fontopts_prop \l_@@_tmp_tl {#3,} }
+          }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -296,29 +280,29 @@
 %   often typed this instead when adding only a single font feature.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_addfontfeatures:n
- {
-%<debug>  \typeout{^^J::::::::::::::::::::::::::::::::::^^J: addfontfeatures}
-  \fontspec_if_fontspec_font:TF
-   {
-    \group_begin:
-      \keys_set_known:nnN {fontspec-addfeatures} {#1} \l_@@_tmp_tl
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {options}  \l_@@_options_tl
-      \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {fontname} \l_@@_fontname_tl
-      \bool_set_true:N \l_@@_disable_defaults_bool
-%<debug>          \typeout{ \@@_select_font_family:nn { \l_@@_options_tl , #1 } {\l_@@_fontname_tl} }
-      \use:x
-       {
-        \@@_select_font_family:nn
-          { \l_@@_options_tl , #1 } {\l_@@_fontname_tl}
-       }
-    \group_end:
-    \fontfamily\l_fontspec_family_tl\selectfont
-   }
-   {
-    \@@_warning:nx {addfontfeatures-ignored} {#1}
-   }
-  \ignorespaces
- }
+  {
+%<debug> \typeout{^^J::::::::::::::::::::::::::::::::::^^J: addfontfeatures}
+    \fontspec_if_fontspec_font:TF
+      {
+        \group_begin:
+          \keys_set_known:nnN {fontspec-addfeatures} {#1} \l_@@_tmp_tl
+          \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {options}  \l_@@_options_tl
+          \prop_get:cnN {g_@@_fontinfo_ \f at family _prop} {fontname} \l_@@_fontname_tl
+          \bool_set_true:N \l_@@_disable_defaults_bool
+%<debug> \typeout{ \@@_select_font_family:nn { \l_@@_options_tl , #1 } {\l_@@_fontname_tl} }
+          \use:x
+            {
+              \@@_select_font_family:nn
+                { \l_@@_options_tl , #1 } {\l_@@_fontname_tl}
+            }
+        \group_end:
+        \fontfamily \g_@@_nfss_family_tl \selectfont
+      }
+      {
+        \@@_warning:nx {addfontfeatures-ignored} {#1}
+      }
+    \ignorespaces
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -330,15 +314,12 @@
 %   select the font feature.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_newfontfeature:nn
- {
-  \keys_define:nn { fontspec }
-   {
-    #1 .code:n =
-     {
-      \@@_update_featstr:n {#2}
-     }
-   }
- }
+  {
+    \keys_define:nn { fontspec }
+      {
+        #1 .code:n = { \@@_update_featstr:n {#2} }
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -349,15 +330,15 @@
 % font it's being used for.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_newAATfeature:nnnn
- {
-  \keys_if_exist:nnF { fontspec } {#1}
-    { \@@_define_aat_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec } {#1}
+      { \@@_define_aat_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \@@_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
- }
+    \@@_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -367,16 +348,16 @@
 % font it's being used for.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_newopentypefeature:nnn
- {
-  \keys_if_exist:nnF { fontspec / options } {#1}
-    { \@@_define_opentype_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec / options } {#1}
+      { \@@_define_opentype_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \exp_args:Nnnx \@@_define_opentype_feature:nnnnn
-    {#1} {#2} { \@@_strip_plus_minus:n {#3} } {#3} {}
- }
+    \exp_args:Nnnx \@@_define_opentype_feature:nnnnn
+      {#1} {#2} { \@@_strip_plus_minus:n {#3} } {#3} {}
+  }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -394,24 +375,24 @@
 % User commands for renaming font features and font feature options.
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_aliasfontfeature:nn
- {
+  {
 %<debug> \typeout{::::::::::::::::::::^^J:: aliasfontfeature{#1}{#2}}
-  \bool_set_false:N \l_@@_alias_bool
+    \bool_set_false:N \l_@@_alias_bool
 
-  \clist_map_inline:Nn \g_@@_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT {##1} {#1}
+    \clist_map_inline:Nn \g_@@_all_keyval_modules_clist
       {
+        \keys_if_exist:nnT {##1} {#1}
+          {
 %<debug> \typeout{:::: Key~exists~##1~/~#1}
-        \bool_set_true:N \l_@@_alias_bool
-        \keys_define:nn {##1}
-          { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+            \bool_set_true:N \l_@@_alias_bool
+            \keys_define:nn {##1}
+              { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+          }
       }
-   }
 
-  \bool_if:NF \l_@@_alias_bool
-    { \@@_warning:nx {rename-feature-not-exist} {#1} }
- }
+    \bool_if:NF \l_@@_alias_bool
+      { \@@_warning:nx {rename-feature-not-exist} {#1} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -418,53 +399,51 @@
 % \begin{macro}{\aliasfontfeatureoption}
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_aliasfontfeatureoption:nnn
- {
-  \bool_set_false:N \l_@@_alias_bool
+  {
+    \bool_set_false:N \l_@@_alias_bool
 
-  \clist_map_inline:Nn \g_@@_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT { ##1 / #1 } {#2}
+    \clist_map_inline:Nn \g_@@_all_keyval_modules_clist
       {
+        \keys_if_exist:nnT { ##1 / #1 } {#2}
+          {
 %<debug> \typeout{:::: Keyval~exists~##1~/~#1~=~#2}
-        \bool_set_true:N \l_@@_alias_bool
-        \keys_define:nn { ##1 / #1 }
-          { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
-      }
+            \bool_set_true:N \l_@@_alias_bool
+            \keys_define:nn { ##1 / #1 }
+              { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
+          }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
-      {
+       \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
+         {
 %<debug> \typeout{:::: Keyval~exists~##1~/~#1~=~#2Reset}
-        \keys_define:nn { ##1 / #1 }
-          { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
-      }
+            \keys_define:nn { ##1 / #1 }
+              { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
+         }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Off}
-      {
+       \keys_if_exist:nnT { ##1 / #1 } {#2Off}
+         {
 %<debug> \typeout{:::: Keyval~exists~##1~/~#1~=~#2Off}
-        \keys_define:nn { ##1 / #1 }
-          { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
-      }
-   }
+            \keys_define:nn { ##1 / #1 }
+              { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
+         }
+     }
 
-  \bool_if:NF \l_@@_alias_bool
-    { \@@_warning:nx {rename-feature-not-exist} {#1/#2} }
- }
+    \bool_if:NF \l_@@_alias_bool
+      { \@@_warning:nx {rename-feature-not-exist} {#1/#2} }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
 %
-% \begin{macro}{\DeclareFontsExtensions}
-% \texttt{dfont} would never be uppercase, right?
+% \begin{macro}{\@@_main_DeclareFontExtensions:n}
 %    \begin{macrocode}
-\cs_new:Nn \@@_main_DeclareFontsExtensions:n
- {
-  \clist_set:Nn \l_@@_extensions_clist { #1 }
-  \tl_remove_all:Nn \l_@@_extensions_clist {~}
- }
+\cs_new:Nn \@@_main_DeclareFontExtensions:n
+  {
+    \clist_set:Nn \l_@@_extensions_clist { #1 }
+  }
 %    \end{macrocode}
-%
+% Defaults:
 %    \begin{macrocode}
-\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
+\@@_main_DeclareFontExtensions:n {.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -473,8 +452,8 @@
 %    \begin{macrocode}
 \cs_new:Nn \@@_main_IfFontFeatureActiveTF:nnn
   {
-%<debug>    \typeout{^^J:::::::::::::::::::::::::::::::::::::::::::::::}
-%<debug>    \typeout{:IfFontFeatureActiveTF \exp_not:n{{#1}{#2}{#3}}}
+%<debug> \typeout{^^J:::::::::::::::::::::::::::::::::::::::::::::::}
+%<debug> \typeout{:IfFontFeatureActiveTF \exp_not:n{{#1}{#2}{#3}}}
     \@@_if_font_feature:nTF {#1} {#2} {#3}
   }
 %    \end{macrocode}
@@ -490,11 +469,11 @@
       \bool_set_true:N \l_@@_never_check_bool
       \bool_set_false:N \l_@@_firsttime_bool
       \clist_clear:N \l_@@_fontfeat_clist
-      \@@_get_features:Nn \l_@@_rawfeatures_sclist {#1}
+      \@@_get_features:n {#1}
     \group_end:
 
-%<debug>    \typeout{:::> \exp_not:N\l_@@_rawfeatures_sclist->~{\l_@@_rawfeatures_sclist}}
-%<debug>    \typeout{:::> \exp_not:N\g_@@_single_feat_tl->~{\g_@@_single_feat_tl}}
+%<debug> \typeout{:::> \exp_not:N\g_@@_rawfeatures_sclist->~{\g_@@_rawfeatures_sclist}}
+%<debug> \typeout{:::> \exp_not:N\g_@@_single_feat_tl->~{\g_@@_single_feat_tl}}
 
     \tl_if_empty:NTF \g_@@_single_feat_tl { \prg_return_false: }
       {
@@ -518,7 +497,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-vars.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -13,7 +13,7 @@
 % In time I would like to move these initialisations
 %
 % \paragraph{Booleans}
-% 
+%
 % \begin{macro}{\l_@@_firsttime_bool}
 % As \cs{keys_set:nn} is run multiple times, some of its
 % information storing only occurs once while we decide if the font family
@@ -63,6 +63,8 @@
 \bool_new:N \l_@@_defining_encoding_bool
 \bool_new:N \l_@@_script_exist_bool
 \bool_new:N \g_@@_em_normalise_slant_bool
+\bool_new:N \l_@@_proceed_bool
+\bool_new:N \l_@@_check_feat_bool
 %    \end{macrocode}
 %
 % \paragraph{Counters}
@@ -110,16 +112,18 @@
 \clist_new:N \l_@@_sizing_leftover_clist
 \clist_new:N \l_@@_fontfeat_clist
 \clist_new:N \l_@@_fontfeat_curr_clist
+\clist_new:N \l_@@_arg_clist
+\clist_new:N \l_@@_this_feat_clist
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\tl_new:N \l_@@_fontfeat_up_clist
-\tl_new:N \l_@@_fontfeat_bf_clist
-\tl_new:N \l_@@_fontfeat_it_clist
-\tl_new:N \l_@@_fontfeat_bfit_clist
-\tl_new:N \l_@@_fontfeat_sl_clist
-\tl_new:N \l_@@_fontfeat_bfsl_clist
-\tl_new:N \l_@@_fontfeat_sc_clist
+\clist_new:N \l_@@_fontfeat_up_clist
+\clist_new:N \l_@@_fontfeat_bf_clist
+\clist_new:N \l_@@_fontfeat_it_clist
+\clist_new:N \l_@@_fontfeat_bfit_clist
+\clist_new:N \l_@@_fontfeat_sl_clist
+\clist_new:N \l_@@_fontfeat_bfsl_clist
+\clist_new:N \l_@@_fontfeat_sc_clist
 %    \end{macrocode}
 %
 % \paragraph{Property lists}
@@ -131,6 +135,8 @@
 \prop_new:N \g_@@_all_opentype_feature_names_prop
 \prop_new:N \g_@@_em_prop
 \prop_new:N \g_@@_strong_prop
+\prop_new:N \g_@@_fontid_family_prop
+\prop_new:N \g_@@_family_int_prop
 %    \end{macrocode}
 %
 % \paragraph{Token lists}
@@ -139,7 +145,6 @@
 \tl_new:N \g_fontspec_encoding_tl
 \tl_new:N \l_fontspec_renderer_tl
 \tl_new:N \l_fontspec_fontname_tl
-\tl_new:N \l_fontspec_defined_shapes_tl
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -149,29 +154,34 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\tl_new:N \l_fontspec_mode_tl
+\tl_new:N \g_@@_curr_series_tl
+\tl_new:N \g_@@_defined_shapes_tl
+\tl_new:N \g_@@_nfss_enc_tl
+\tl_new:N \g_@@_nfss_family_tl
 \tl_new:N \g_@@_single_feat_tl
-\tl_new:N \l_@@_tmp_tl
+\tl_new:N \l_@@_basename_tl
+\tl_new:N \l_@@_curr_fontname_tl
+\tl_new:N \l_@@_curr_bfname_tl
+\tl_new:N \l_@@_ext_filename_tl
+\tl_new:N \l_@@_extension_tl
+\tl_new:N \l_@@_font_path_tl
+\tl_new:N \l_@@_fontid_tl
+\tl_new:N \l_@@_fontname_tl
+\tl_new:N \l_@@_hexcol_tl
+\tl_new:N \l_@@_nfss_sc_tl
+\tl_new:N \l_@@_nfss_tl
+\tl_new:N \l_@@_nfss_fam_tl
+\tl_new:N \l_@@_opacity_tl
+\tl_new:N \l_@@_optical_size_tl
+\tl_new:N \l_@@_options_tl
+\tl_new:N \l_@@_saved_fontname_tl
+\tl_new:N \l_@@_scale_tl
 \tl_new:N \l_@@_size_tl
 \tl_new:N \l_@@_sizedfont_tl
-\tl_new:N \l_@@_nfss_tl
-\tl_new:N \l_@@_nfss_sc_tl
 \tl_new:N \l_@@_this_font_tl
-\tl_new:N \l_@@_scale_tl
-\tl_new:N \l_@@_opacity_tl
-\tl_new:N \l_@@_hexcol_tl
-\tl_new:N \l_@@_fontid_tl
-\tl_new:N \l_@@_extension_tl
-\tl_new:N \l_@@_ext_filename_tl
-\tl_new:N \l_@@_font_path_tl
-\tl_new:N \l_@@_basename_tl
-\tl_new:N \l_@@_curr_fontname_tl
-\tl_new:N \l_@@_saved_fontname_tl
-\tl_new:N \l_@@_optical_size_tl
+\tl_new:N \l_@@_tmp_tl
 \tl_new:N \l_@@_ttc_index_tl
-\tl_new:N \l_@@_nfss_enc_tl
-\tl_new:N \g_@@_curr_series_tl
-\tl_new:N \l_@@_options_tl
-\tl_new:N \l_@@_fontname_tl
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -181,7 +191,14 @@
 \tl_new:N \g_@@_mathtt_tl
 %    \end{macrocode}
 %
+% Defaults:
 %    \begin{macrocode}
+\tl_gset:Nn \g_@@_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g_@@_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g_@@_mathtt_tl {\ttdefault}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \tl_new:N \l_@@_family_label_tl
 \tl_new:N \l_@@_fake_slant_tl
 \tl_new:N \l_@@_fake_embolden_tl
@@ -206,21 +223,21 @@
 %
 %    \begin{macrocode}
 \tl_new:N  \l_@@_mapping_tl
-\tl_new:N  \g_@@_hexcol_tl
-\tl_new:N  \g_@@_opacity_tl
-\tl_set:Nn \g_@@_hexcol_tl {000000}
-\tl_set:Nn \g_@@_opacity_tl {FF~}
 \tl_new:N  \l_@@_punctspace_adjust_tl
 \tl_new:N  \l_@@_wordspace_adjust_tl
 \tl_new:N  \l_@@_postadjust_tl
-\tl_new:N  \g_@@_postadjust_tl
-\tl_set:Nn \g_@@_postadjust_tl { \l_@@_wordspace_adjust_tl \l_@@_punctspace_adjust_tl }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\tl_const:Nn \c_@@_hexcol_tl {000000}
+\tl_const:Nn \c_@@_opacity_tl {FF~}
+\tl_const:Nn \c_@@_postadjust_tl { \l_@@_wordspace_adjust_tl \l_@@_punctspace_adjust_tl }
+%    \end{macrocode}
+%
 % \paragraph{Semi-colon-lists}
 % Not a real data structure but sensible to name accordingly.
 %    \begin{macrocode}
-\tl_new:N \l_@@_rawfeatures_sclist
+\tl_new:N \g_@@_rawfeatures_sclist
 \tl_new:N \l_@@_pre_feat_sclist
 %    \end{macrocode}
 %
@@ -227,9 +244,9 @@
 % \paragraph{Font families}
 % Again not a real data structure, and also probably poorly named.
 %    \begin{macrocode}
-\tl_new:N \g_@@_rmfamily_family
-\tl_new:N \g_@@_sffamily_family
-\tl_new:N \g_@@_ttfamily_family
+\tl_new:N \l_@@_rmfamily_family_tl
+\tl_new:N \l_@@_sffamily_family_tl
+\tl_new:N \l_@@_ttfamily_family_tl
 %    \end{macrocode}
 %
 %
@@ -247,7 +264,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-xfss.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -106,15 +106,15 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \emfontdeclare #1
   {
-    \prop_clear:N    \g_@@_em_prop
-    \int_zero:N      \l_@@_emdef_int
-    \bool_set_true:N \g_@@_em_normalise_slant_bool
+    \prop_gclear:N    \g_@@_em_prop
+    \int_zero:N       \l_@@_emdef_int
+    \bool_gset_true:N \g_@@_em_normalise_slant_bool
 
     \tl_if_in:nnT {#1} {\slshape}
       {
         \tl_if_in:nnT {#1} {\itshape}
           {
-            \bool_set_false:N \g_@@_em_normalise_slant_bool
+            \bool_gset_false:N \g_@@_em_normalise_slant_bool
           }
       }
 
@@ -187,7 +187,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \strongfontdeclare #1
   {
-    \prop_clear:N    \g_@@_strong_prop
+    \prop_gclear:N   \g_@@_strong_prop
     \int_zero:N      \l_@@_strongdef_int
 
     \group_begin:
@@ -274,7 +274,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -1,4 +1,5 @@
 %%^^A%%  fontspec.dtx -- part of FONTSPEC <wspr.io/fontspec>
+%%^^A%%  Metadata for the package, including files and versioning
 
 % \section{Package declaration}
 %
@@ -32,7 +33,7 @@
 }
 %</dtx>
 %    \end{macrocode}
-% 
+%
 % Now exit if we're using plain \TeX; this would usually be the case when
 % loading this file with \texttt{fontspec.ins}.
 %    \begin{macrocode}
@@ -41,7 +42,7 @@
 \ifx\tmpa\fmtname\expandafter\endinput\fi
 %</dtx>
 %    \end{macrocode}
-% 
+%
 % Metadata for documentation; the official title and authors of the package.
 %    \begin{macrocode}
 %<*dtx>
@@ -57,7 +58,7 @@
 }
 %</dtx>
 %    \end{macrocode}
-% 
+%
 % Declare the package version and date for each of the \texttt{.sty} files generated.
 % In addition, declare the version and date for this \texttt{.dtx} file.
 %    \begin{macrocode}
@@ -70,10 +71,10 @@
 \ProvidesExplFile{fontspec.dtx}
 %</dtx>
 %<*fontspec>
-  {2017/11/09}{2.6g}{Font selection for XeLaTeX and LuaLaTeX}
+  {2018/07/29}{v2.6h}{Font selection for XeLaTeX and LuaLaTeX}
 %</fontspec>
 %    \end{macrocode}
-% 
+%
 % Here the version and date are setup for typesetting the documentation.
 %    \begin{macrocode}
 %<*dtx>
@@ -81,7 +82,7 @@
 \date{\filedate \qquad \fileversion}
 %</dtx>
 %    \end{macrocode}
-% 
+%
 % \subsection{\textsf{Lua} header}
 %
 %    \begin{macrocode}
@@ -104,7 +105,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ins	2018-07-29 21:15:34 UTC (rev 48307)
@@ -48,7 +48,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.ltx	2018-07-29 21:15:34 UTC (rev 48307)
@@ -28,7 +28,7 @@
 % ------------------------------------------------
 % The FONTSPEC package  <wspr.io/fontspec>
 % ------------------------------------------------
-% Copyright  2004-2017  Will Robertson, LPPL "maintainer"
+% Copyright  2004-2018  Will Robertson, LPPL "maintainer"
 % Copyright  2009-2015  Khaled Hosny
 % Copyright  2013       Philipp Gesang
 % Copyright  2013-2016  Joseph Wright

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2018-07-29 21:15:34 UTC (rev 48307)
@@ -37,10 +37,11 @@
 %% (your choice): <http://www.latex-project.org/lppl/>.
 %% ------------------------------------------------
 %%^^A%%  fontspec.dtx -- part of FONTSPEC <wspr.io/fontspec>
+%%^^A%%  Metadata for the package, including files and versioning
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-luatex}%
-  {2017/11/09}{2.6g}{Font selection for XeLaTeX and LuaLaTeX}
+  {2018/07/29}{v2.6h}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -70,6 +71,8 @@
 \bool_new:N \l__fontspec_defining_encoding_bool
 \bool_new:N \l__fontspec_script_exist_bool
 \bool_new:N \g__fontspec_em_normalise_slant_bool
+\bool_new:N \l__fontspec_proceed_bool
+\bool_new:N \l__fontspec_check_feat_bool
 \int_new:N \l__fontspec_script_int
 \int_new:N \l__fontspec_language_int
 \int_new:N \l__fontspec_strnum_int
@@ -97,13 +100,15 @@
 \clist_new:N \l__fontspec_sizing_leftover_clist
 \clist_new:N \l__fontspec_fontfeat_clist
 \clist_new:N \l__fontspec_fontfeat_curr_clist
-\tl_new:N \l__fontspec_fontfeat_up_clist
-\tl_new:N \l__fontspec_fontfeat_bf_clist
-\tl_new:N \l__fontspec_fontfeat_it_clist
-\tl_new:N \l__fontspec_fontfeat_bfit_clist
-\tl_new:N \l__fontspec_fontfeat_sl_clist
-\tl_new:N \l__fontspec_fontfeat_bfsl_clist
-\tl_new:N \l__fontspec_fontfeat_sc_clist
+\clist_new:N \l__fontspec_arg_clist
+\clist_new:N \l__fontspec_this_feat_clist
+\clist_new:N \l__fontspec_fontfeat_up_clist
+\clist_new:N \l__fontspec_fontfeat_bf_clist
+\clist_new:N \l__fontspec_fontfeat_it_clist
+\clist_new:N \l__fontspec_fontfeat_bfit_clist
+\clist_new:N \l__fontspec_fontfeat_sl_clist
+\clist_new:N \l__fontspec_fontfeat_bfsl_clist
+\clist_new:N \l__fontspec_fontfeat_sc_clist
 \prop_new:N \g__fontspec_fontopts_prop
 \prop_new:N \l__fontspec_nfss_prop
 \prop_new:N \l__fontspec_nfssfont_prop
@@ -111,41 +116,50 @@
 \prop_new:N \g__fontspec_all_opentype_feature_names_prop
 \prop_new:N \g__fontspec_em_prop
 \prop_new:N \g__fontspec_strong_prop
+\prop_new:N \g__fontspec_fontid_family_prop
+\prop_new:N \g__fontspec_family_int_prop
 \tl_new:N \l_fontspec_family_tl
 \tl_new:N \g_fontspec_encoding_tl
 \tl_new:N \l_fontspec_renderer_tl
 \tl_new:N \l_fontspec_fontname_tl
-\tl_new:N \l_fontspec_defined_shapes_tl
 \tl_clear_new:N \UTFencname
 \tl_clear_new:N \cyrillicencoding
 \tl_clear_new:N \latinencoding
+\tl_new:N \l_fontspec_mode_tl
+\tl_new:N \g__fontspec_curr_series_tl
+\tl_new:N \g__fontspec_defined_shapes_tl
+\tl_new:N \g__fontspec_nfss_enc_tl
+\tl_new:N \g__fontspec_nfss_family_tl
 \tl_new:N \g__fontspec_single_feat_tl
-\tl_new:N \l__fontspec_tmp_tl
+\tl_new:N \l__fontspec_basename_tl
+\tl_new:N \l__fontspec_curr_fontname_tl
+\tl_new:N \l__fontspec_curr_bfname_tl
+\tl_new:N \l__fontspec_ext_filename_tl
+\tl_new:N \l__fontspec_extension_tl
+\tl_new:N \l__fontspec_font_path_tl
+\tl_new:N \l__fontspec_fontid_tl
+\tl_new:N \l__fontspec_fontname_tl
+\tl_new:N \l__fontspec_hexcol_tl
+\tl_new:N \l__fontspec_nfss_sc_tl
+\tl_new:N \l__fontspec_nfss_tl
+\tl_new:N \l__fontspec_nfss_fam_tl
+\tl_new:N \l__fontspec_opacity_tl
+\tl_new:N \l__fontspec_optical_size_tl
+\tl_new:N \l__fontspec_options_tl
+\tl_new:N \l__fontspec_saved_fontname_tl
+\tl_new:N \l__fontspec_scale_tl
 \tl_new:N \l__fontspec_size_tl
 \tl_new:N \l__fontspec_sizedfont_tl
-\tl_new:N \l__fontspec_nfss_tl
-\tl_new:N \l__fontspec_nfss_sc_tl
 \tl_new:N \l__fontspec_this_font_tl
-\tl_new:N \l__fontspec_scale_tl
-\tl_new:N \l__fontspec_opacity_tl
-\tl_new:N \l__fontspec_hexcol_tl
-\tl_new:N \l__fontspec_fontid_tl
-\tl_new:N \l__fontspec_extension_tl
-\tl_new:N \l__fontspec_ext_filename_tl
-\tl_new:N \l__fontspec_font_path_tl
-\tl_new:N \l__fontspec_basename_tl
-\tl_new:N \l__fontspec_curr_fontname_tl
-\tl_new:N \l__fontspec_saved_fontname_tl
-\tl_new:N \l__fontspec_optical_size_tl
+\tl_new:N \l__fontspec_tmp_tl
 \tl_new:N \l__fontspec_ttc_index_tl
-\tl_new:N \l__fontspec_nfss_enc_tl
-\tl_new:N \g__fontspec_curr_series_tl
-\tl_new:N \l__fontspec_options_tl
-\tl_new:N \l__fontspec_fontname_tl
 \tl_new:N \g__fontspec_mathrm_tl
 \tl_new:N \g__fontspec_bfmathrm_tl
 \tl_new:N \g__fontspec_mathsf_tl
 \tl_new:N \g__fontspec_mathtt_tl
+\tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault}
 \tl_new:N \l__fontspec_family_label_tl
 \tl_new:N \l__fontspec_fake_slant_tl
 \tl_new:N \l__fontspec_fake_embolden_tl
@@ -161,20 +175,17 @@
 \tl_new:N \l__fontspec_lang_name_tl
 \tl_new:N \l_fontspec_lang_tl
 \tl_new:N  \l__fontspec_mapping_tl
-\tl_new:N  \g__fontspec_hexcol_tl
-\tl_new:N  \g__fontspec_opacity_tl
-\tl_set:Nn \g__fontspec_hexcol_tl {000000}
-\tl_set:Nn \g__fontspec_opacity_tl {FF~}
 \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_postadjust_tl
-\tl_set:Nn \g__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl }
-\tl_new:N \l__fontspec_rawfeatures_sclist
+\tl_const:Nn \c__fontspec_hexcol_tl {000000}
+\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
-\tl_new:N \g__fontspec_rmfamily_family
-\tl_new:N \g__fontspec_sffamily_family
-\tl_new:N \g__fontspec_ttfamily_family
+\tl_new:N \l__fontspec_rmfamily_family_tl
+\tl_new:N \l__fontspec_sffamily_family_tl
+\tl_new:N \l__fontspec_ttfamily_family_tl
 
 %%^^A%%  fontspec-msg.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \cs_new:Npn \__fontspec_error:n     { \msg_error:nn     {fontspec} }
@@ -362,11 +373,11 @@
  }
 \__fontspec_msg_new:nnn {fontspec} {defining-font}
  {
-  Font family '\l_fontspec_family_tl' created for font '#2'
+  Font family '\g__fontspec_nfss_family_tl' created for font '#2'
   with options [\l__fontspec_all_features_clist].\\
   \\
   This font family consists of the following NFSS series/shapes:\\
-  \l_fontspec_defined_shapes_tl
+  \g__fontspec_defined_shapes_tl
  }
 \__fontspec_msg_new:nnn {fontspec} {no-font-shape}
  {
@@ -406,23 +417,25 @@
 
 %%^^A%%  fontspec-opening.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \DeclareOption{cm-default}
- { \__fontspec_warning:n {cm-default-obsolete} }
-\DeclareOption{math}{\bool_set_true:N \g__fontspec_math_bool}
-\DeclareOption{no-math}{\bool_set_false:N \g__fontspec_math_bool}
-\DeclareOption{config}{\bool_set_true:N \g__fontspec_cfg_bool}
-\DeclareOption{no-config}{\bool_set_false:N \g__fontspec_cfg_bool}
-\DeclareOption{euenc}{\bool_set_true:N  \g__fontspec_euenc_bool}
-\DeclareOption{tuenc}{\bool_set_false:N \g__fontspec_euenc_bool}
-\DeclareOption{quiet}
- {
-  \msg_redirect_module:nnn { fontspec } { warning } { info }
-  \msg_redirect_module:nnn { fontspec } { info } { none }
- }
+  {
+    \__fontspec_warning:n {cm-default-obsolete}
+  }
+\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 }
- }
+  {
+    \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
@@ -438,14 +451,14 @@
       }
       {
         \__fontspec_warning:n {tu-missing}
-        \bool_set_true:N \g__fontspec_euenc_bool
+        \bool_gset_true:N \g__fontspec_euenc_bool
       }
   }
 \bool_if:NTF \g__fontspec_euenc_bool
   {
-    \tl_set:Nn \g_fontspec_encoding_tl {EU2}
+    \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
   }
-  { \tl_set: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}
@@ -542,18 +555,22 @@
 \NewDocumentCommand \fontspec { O{} m O{} }
   {
     \__fontspec_main_fontspec:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmainfont { O{} m O{} }
   {
     \__fontspec_main_setmainfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setsansfont { O{} m O{} }
   {
     \__fontspec_main_setsansfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmonofont { O{} m O{} }
   {
     \__fontspec_main_setmonofont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmathrm { O{} m O{} }
   {
@@ -577,8 +594,16 @@
   }
 \NewDocumentCommand \newfontfamily { m O{} m O{} }
   {
-    \__fontspec_main_newfontfamily:nnn {#1} {#2,#4} {#3}
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \NewDocumentCommand
   }
+\NewDocumentCommand \renewfontfamily { m O{} m O{} }
+  {
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \RenewDocumentCommand
+  }
+\NewDocumentCommand \setfontfamily { m O{} m O{} }
+  {
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \DeclareDocumentCommand
+  }
 \NewDocumentCommand \newfontface { m O{} m O{} }
   {
     \__fontspec_main_newfontface:nnn {#1} {#2,#4} {#3}
@@ -585,7 +610,10 @@
   }
 \NewDocumentCommand \defaultfontfeatures { t+ o m }
   {
-    \__fontspec_main_defaultfontfeatures:nnn {#1} {#2} {#3}
+    \IfNoValueTF {#2}
+      { \__fontspec_set_default_features:nn {#1} {#3} }
+      { \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} }
+    \ignorespaces
   }
 \NewDocumentCommand \addfontfeatures {m}
   {
@@ -627,9 +655,9 @@
   {
     \fontspec_new_lang:nn {#1} {#2}
   }
-\NewDocumentCommand \DeclareFontsExtensions {m}
+\NewDocumentCommand \DeclareFontExtensions {m}
   {
-    \__fontspec_main_DeclareFontsExtensions:n {#1}
+    \__fontspec_main_DeclareFontExtensions:n {#1}
   }
 \NewDocumentCommand \IfFontFeatureActiveTF {mmm}
   {
@@ -639,81 +667,83 @@
 %%^^A%%  fontspec-user.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
 \cs_new:Nn \__fontspec_main_fontspec:nn
- {
-  \fontspec_set_family:Nnn \f at family {#1} {#2}
-  \fontencoding { \l__fontspec_nfss_enc_tl }
-  \selectfont
-  \ignorespaces
- }
+  {
+    \fontspec_set_family:Nnn \f at family {#1} {#2}
+    \fontencoding { \g__fontspec_nfss_enc_tl }
+    \selectfont
+  }
 \cs_new:Nn \__fontspec_main_setmainfont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1} {#2}
-  \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_rmfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \rmfamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_rmfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\rmdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setmainfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\rmdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setmainfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setsansfont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1} {#2}
-  \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_sffamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \sffamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_sffamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\sfdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setsansfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\sfdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setsansfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setmonofont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1} {#2}
-  \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_ttfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \ttfamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_ttfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\ttdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setmonofont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\ttdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setmonofont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setmathrm:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {Renderer=Basic,#1} {#2}
     \__fontspec_setmathrm_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setboldmathrm:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {Renderer=Basic,#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {Renderer=Basic,#1} {#2}
     \__fontspec_setboldmathrm_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setmathsf:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Renderer=Basic,#1} {#2}
     \__fontspec_setmathsf_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setmathtt:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Renderer=Basic,#1} {#2}
     \__fontspec_setmathtt_hook:nn {#1} {#2}
   }
 \cs_set_eq:NN \__fontspec_setmainfont_hook:nn   \use_none:nn
@@ -727,113 +757,103 @@
 \@onlypreamble\setboldmathrm
 \@onlypreamble\setmathsf
 \@onlypreamble\setmathtt
-\tl_set:Nn \g__fontspec_mathrm_tl {\rmdefault}
-\tl_set:Nn \g__fontspec_mathsf_tl {\sfdefault}
-\tl_set:Nn \g__fontspec_mathtt_tl {\ttdefault}
-\cs_new:Nn \__fontspec_main_newfontfamily:nnn
- {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3}
-  \use:x
-   {
-    \exp_not:N \DeclareRobustCommand \exp_not:N #1
-     {
-      \exp_not:N \fontfamily { \use:c {g__fontspec_ \cs_to_str:N #1 _family} }
-      \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-      \exp_not:N \selectfont
-     }
-   }
- }
+\tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault}
+\cs_new:Nn \__fontspec_main_newfontfamily:nnnN
+  {
+    \fontspec_set_family:cnn { l__fontspec_ \cs_to_str:N #1 _family_tl } {#2} {#3}
+    \use:x
+      {
+        \exp_not:N #4 \exp_not:N #1 {}
+          {
+            \exp_not:N \fontfamily { \use:c { l__fontspec_ \cs_to_str:N #1 _family_tl } }
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \selectfont
+          }
+      }
+  }
 \cs_new:Nn \__fontspec_main_newfontface:nnn
- {
-  \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
- }
-\cs_new:Nn \__fontspec_main_defaultfontfeatures:nnn
   {
-    \IfNoValueTF {#2}
-     { \__fontspec_set_default_features:nn {#1} {#3} }
-     { \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} }
-    \ignorespaces
+    \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
   }
 \cs_new:Nn \__fontspec_set_default_features:nn
   {
-    \IfBooleanTF {#1} \clist_put_right:Nn \clist_set:Nn
+    \IfBooleanTF {#1} \clist_gput_right:Nn \clist_gset:Nn
       \g__fontspec_default_fontopts_clist {#2}
   }
 \cs_new:Nn \__fontspec_set_font_default_features:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \tl_if_single:nTF {##1}
-     { \tl_set:No \l__fontspec_tmp_tl { \cs:w g__fontspec_ \cs_to_str:N ##1 _family\cs_end: } }
-     { \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {##1} }
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \tl_if_single:nTF {##1}
+          { \tl_set:No \l__fontspec_tmp_tl { \cs:w l__fontspec_ \cs_to_str:N ##1 _family_tl\cs_end: } }
+          { \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {##1} }
 
-    \IfBooleanTF {#1}
-     {
-      \prop_get:NVNF \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
-       { \tl_clear:N \l__fontspec_tmpb_tl }
-      \tl_put_right:Nn \l__fontspec_tmpb_tl {#3,}
-      \prop_gput:NVV   \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
-     }
-     {
-      \tl_if_empty:nTF {#3}
-       { \prop_gremove:NV \g__fontspec_fontopts_prop \l__fontspec_tmp_tl }
-       { \prop_put:NVn    \g__fontspec_fontopts_prop \l__fontspec_tmp_tl {#3,} }
-     }
-   }
- }
+        \IfBooleanTF {#1}
+          {
+            \prop_get:NVNF \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
+              { \tl_clear:N \l__fontspec_tmpb_tl }
+            \tl_put_right:Nn \l__fontspec_tmpb_tl {#3,}
+            \prop_gput:NVV   \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
+          }
+          {
+            \tl_if_empty:nTF {#3}
+              { \prop_gremove:NV \g__fontspec_fontopts_prop \l__fontspec_tmp_tl }
+              { \prop_gput:NVn    \g__fontspec_fontopts_prop \l__fontspec_tmp_tl {#3,} }
+          }
+      }
+  }
 \cs_new:Nn \__fontspec_main_addfontfeatures:n
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \group_begin:
-      \keys_set_known:nnN {fontspec-addfeatures} {#1} \l__fontspec_tmp_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {options}  \l__fontspec_options_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {fontname} \l__fontspec_fontname_tl
-      \bool_set_true:N \l__fontspec_disable_defaults_bool
-      \use:x
-       {
-        \__fontspec_select_font_family:nn
-          { \l__fontspec_options_tl , #1 } {\l__fontspec_fontname_tl}
-       }
-    \group_end:
-    \fontfamily\l_fontspec_family_tl\selectfont
-   }
-   {
-    \__fontspec_warning:nx {addfontfeatures-ignored} {#1}
-   }
-  \ignorespaces
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \group_begin:
+          \keys_set_known:nnN {fontspec-addfeatures} {#1} \l__fontspec_tmp_tl
+          \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {options}  \l__fontspec_options_tl
+          \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {fontname} \l__fontspec_fontname_tl
+          \bool_set_true:N \l__fontspec_disable_defaults_bool
+          \use:x
+            {
+              \__fontspec_select_font_family:nn
+                { \l__fontspec_options_tl , #1 } {\l__fontspec_fontname_tl}
+            }
+        \group_end:
+        \fontfamily \g__fontspec_nfss_family_tl \selectfont
+      }
+      {
+        \__fontspec_warning:nx {addfontfeatures-ignored} {#1}
+      }
+    \ignorespaces
+  }
 \cs_new:Nn \__fontspec_main_newfontfeature:nn
- {
-  \keys_define:nn { fontspec }
-   {
-    #1 .code:n =
-     {
-      \__fontspec_update_featstr:n {#2}
-     }
-   }
- }
+  {
+    \keys_define:nn { fontspec }
+      {
+        #1 .code:n = { \__fontspec_update_featstr:n {#2} }
+      }
+  }
 \cs_new:Nn \__fontspec_main_newAATfeature:nnnn
- {
-  \keys_if_exist:nnF { fontspec } {#1}
-    { \__fontspec_define_aat_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec } {#1}
+      { \__fontspec_define_aat_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \__fontspec_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
- }
+    \__fontspec_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
+  }
 \cs_new:Nn \__fontspec_main_newopentypefeature:nnn
- {
-  \keys_if_exist:nnF { fontspec / options } {#1}
-    { \__fontspec_define_opentype_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec / options } {#1}
+      { \__fontspec_define_opentype_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn
-    {#1} {#2} { \__fontspec_strip_plus_minus:n {#3} } {#3} {}
- }
+    \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn
+      {#1} {#2} { \__fontspec_strip_plus_minus:n {#3} } {#3} {}
+  }
 \cs_new:Nn \__fontspec_strip_plus_minus:n { \__fontspec_strip_plus_minus_aux:Nq #1 \q_nil }
 \cs_new:Npn \__fontspec_strip_plus_minus_aux:Nq #1#2 \q_nil
   {
@@ -840,57 +860,56 @@
     \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2}
   }
 \cs_new:Nn \__fontspec_main_aliasfontfeature:nn
- {
-  \bool_set_false:N \l__fontspec_alias_bool
+  {
+    \bool_set_false:N \l__fontspec_alias_bool
 
-  \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT {##1} {#1}
+    \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
       {
-        \bool_set_true:N \l__fontspec_alias_bool
-        \keys_define:nn {##1}
-          { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+        \keys_if_exist:nnT {##1} {#1}
+          {
+            \bool_set_true:N \l__fontspec_alias_bool
+            \keys_define:nn {##1}
+              { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+          }
       }
-   }
 
-  \bool_if:NF \l__fontspec_alias_bool
-    { \__fontspec_warning:nx {rename-feature-not-exist} {#1} }
- }
+    \bool_if:NF \l__fontspec_alias_bool
+      { \__fontspec_warning:nx {rename-feature-not-exist} {#1} }
+  }
 \cs_new:Nn \__fontspec_main_aliasfontfeatureoption:nnn
- {
-  \bool_set_false:N \l__fontspec_alias_bool
+  {
+    \bool_set_false:N \l__fontspec_alias_bool
 
-  \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT { ##1 / #1 } {#2}
+    \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
       {
-        \bool_set_true:N \l__fontspec_alias_bool
-        \keys_define:nn { ##1 / #1 }
-          { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
-      }
+        \keys_if_exist:nnT { ##1 / #1 } {#2}
+          {
+            \bool_set_true:N \l__fontspec_alias_bool
+            \keys_define:nn { ##1 / #1 }
+              { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
+          }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
-      {
-        \keys_define:nn { ##1 / #1 }
-          { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
-      }
+       \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
+         {
+            \keys_define:nn { ##1 / #1 }
+              { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
+         }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Off}
-      {
-        \keys_define:nn { ##1 / #1 }
-          { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
-      }
-   }
+       \keys_if_exist:nnT { ##1 / #1 } {#2Off}
+         {
+            \keys_define:nn { ##1 / #1 }
+              { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
+         }
+     }
 
-  \bool_if:NF \l__fontspec_alias_bool
-    { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} }
- }
-\cs_new:Nn \__fontspec_main_DeclareFontsExtensions:n
- {
-  \clist_set:Nn \l__fontspec_extensions_clist { #1 }
-  \tl_remove_all:Nn \l__fontspec_extensions_clist {~}
- }
-\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
+    \bool_if:NF \l__fontspec_alias_bool
+      { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} }
+  }
+\cs_new:Nn \__fontspec_main_DeclareFontExtensions:n
+  {
+    \clist_set:Nn \l__fontspec_extensions_clist { #1 }
+  }
+\__fontspec_main_DeclareFontExtensions:n {.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
 \cs_new:Nn \__fontspec_main_IfFontFeatureActiveTF:nnn
   {
     \__fontspec_if_font_feature:nTF {#1} {#2} {#3}
@@ -905,7 +924,7 @@
       \bool_set_true:N \l__fontspec_never_check_bool
       \bool_set_false:N \l__fontspec_firsttime_bool
       \clist_clear:N \l__fontspec_fontfeat_clist
-      \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist {#1}
+      \__fontspec_get_features:n {#1}
     \group_end:
 
 
@@ -919,64 +938,64 @@
 %%^^A%%  fontspec-api.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
 \prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F}
- {
-  \cs_if_exist:cTF {g__fontspec_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
- }
+  {
+    \cs_if_exist:cTF {g__fontspec_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
+  }
 \prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_atsui_bool
-     {
-      \__fontspec_make_AAT_feature_string:NnnTF \font {#1} {#2}
-        \prg_return_true: \prg_return_false:
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_atsui_bool
+          {
+            \__fontspec_make_AAT_feature_string:NnnTF \font {#1} {#2}
+              \prg_return_true: \prg_return_false:
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_ot_bool \prg_return_true: \prg_return_false:
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_ot_bool \prg_return_true: \prg_return_false:
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_ot_bool
-     {
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-num} \l__fontspec_tmp_tl
-      \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl}
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_ot_bool
+          {
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-num} \l__fontspec_tmp_tl
+            \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl}
 
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-num} \l__fontspec_tmp_tl
-      \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl}
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-num} \l__fontspec_tmp_tl
+            \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl}
 
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
 
-      \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+            \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F}
  {
   \fontspec_if_fontspec_font:TF
@@ -1068,19 +1087,19 @@
    { \prg_return_false: }
  }
 \cs_new:Nn \fontspec_set_family:Nnn
- {
-  \tl_set:Nn \l__fontspec_family_label_tl { #1 }
-  \__fontspec_select_font_family:nn {#2}{#3}
-  \tl_set_eq:NN #1 \l_fontspec_family_tl
- }
+  {
+    \tl_set:Nn \l__fontspec_family_label_tl {#1}
+    \__fontspec_select_font_family:nn {#2} {#3}
+    \tl_set_eq:NN #1 \l_fontspec_family_tl
+  }
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {c}
-\cs_new:Nn \fontspec_set_fontface:NNnn
- {
-  \tl_set:Nn \l__fontspec_family_label_tl { #1 }
-  \__fontspec_select_font_family:nn {#3}{#4}
-  \font #1 = \fontname \l_fontspec_font \scan_stop:
-  \tl_set_eq:NN #2 \l_fontspec_family_tl
- }
+ \cs_new:Nn \fontspec_set_fontface:NNnn
+  {
+    \tl_set:Nn \l__fontspec_family_label_tl {#1}
+    \__fontspec_select_font_family:nn {#3}{#4}
+    \global \font #1 = \fontname \l_fontspec_font \scan_stop:
+    \tl_set_eq:NN #2 \l_fontspec_family_tl
+  }
 \prg_new_conditional:Nnn \fontspec_font_if_exist:n {TF,T,F}
   {
     \group_begin:
@@ -1146,7 +1165,7 @@
   \__fontspec_preparse_features:
   \__fontspec_load_font:
   \__fontspec_set_scriptlang:
-  \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist {}
+  \__fontspec_get_features:n {}
   \bool_set_false:N \l__fontspec_firsttime_bool
 
   \__fontspec_save_family_needed:nTF {#2}
@@ -1156,6 +1175,8 @@
    {
    }
   \group_end:
+
+  \tl_set_eq:NN \l_fontspec_family_tl \g__fontspec_nfss_family_tl
  }
 \cs_set_eq:NN \fontspec_select:nn \__fontspec_select_font_family:nn %% deprecated, for compatibility only
 \cs_new:Nn \__fontspec_sanitise_fontname:Nn
@@ -1306,10 +1327,10 @@
      }
    }
  }
-\cs_new:Nn \__fontspec_get_features:Nn
+\cs_new:Nn \__fontspec_get_features:n
  {
   \__fontspec_init_fontface:
-  \__fontspec_keys_set_known:nxN {fontspec-renderer} {\l__fontspec_fontfeat_clist,#2}
+  \__fontspec_keys_set_known:nxN {fontspec-renderer} {\l__fontspec_fontfeat_clist,#1}
     \l__fontspec_keys_leftover_clist
   \__fontspec_keys_set_known:nxN {fontspec} {\l__fontspec_keys_leftover_clist} \l__fontspec_keys_leftover_clist
   \keys_set:nV {fontspec-opentype} \l__fontspec_keys_leftover_clist
@@ -1318,66 +1339,68 @@
     { \__fontspec_update_featstr:n { mapping = \l__fontspec_mapping_tl } }
 
   \str_if_eq_x:nnF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl }
-                   { \g__fontspec_hexcol_tl \g__fontspec_opacity_tl }
+                   { \c__fontspec_hexcol_tl \c__fontspec_opacity_tl }
     { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } }
-
-  \tl_set_eq:NN #1 \l__fontspec_rawfeatures_sclist
  }
-\prg_new_conditional:Nnn \__fontspec_save_family_needed:n {TF}
- {
+\prg_new_conditional:Nnn \__fontspec_save_family_needed:n { TF }
+  {
 
 
-  \tl_if_exist:cF {g__fontspec_UID_\l__fontspec_fontid_tl}
+  \tl_if_empty:NTF \l__fontspec_nfss_fam_tl
     {
-      \tl_new:c {g__fontspec_UID_\l__fontspec_fontid_tl}
+      \prop_get:NVNTF \g__fontspec_fontid_family_prop \l__fontspec_fontid_tl \l__fontspec_tmp_tl
+        {
+          \tl_gset_eq:NN \g__fontspec_nfss_family_tl \l__fontspec_tmp_tl
+          \prg_return_false:
+        }
+        {
+          \tl_set:Nx \l__fontspec_tmp_tl {#1}
+          \tl_remove_all:Nn \l__fontspec_tmp_tl { ~ }
+          \__fontspec_save_fontid_family:VV \l__fontspec_fontid_tl \l__fontspec_tmp_tl
+          \prg_return_true:
+        }
     }
-
-  \tl_if_exist:NT \l__fontspec_nfss_fam_tl
     {
-      \tl_set_eq:cN {g__fontspec_UID_\l__fontspec_fontid_tl} \l__fontspec_nfss_fam_tl
+      \tl_gset_eq:NN \g__fontspec_nfss_family_tl \l__fontspec_nfss_fam_tl
+      \cs_undefine:c { g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop }
+      \prg_return_true:
     }
-
-  \tl_if_empty:cT {g__fontspec_UID_\l__fontspec_fontid_tl}
-   {
-    % The font name is fully expanded, in case it's defined in terms of macros, before having its spaces zapped:
-    \tl_set:Nx \l__fontspec_tmp_tl {#1}
-    \tl_remove_all:Nn \l__fontspec_tmp_tl {~}
-
-    \cs_if_exist:cTF {g__fontspec_family_ \l__fontspec_tmp_tl _int}
-     { \int_gincr:c  {g__fontspec_family_ \l__fontspec_tmp_tl _int} }
-     { \int_new:c    {g__fontspec_family_ \l__fontspec_tmp_tl _int} }
-
-    \tl_gset:cx {g__fontspec_UID_\l__fontspec_fontid_tl}
-     {
-      \l__fontspec_tmp_tl ( \int_use:c {g__fontspec_family_ \l__fontspec_tmp_tl _int} )
-     }
-   }
-  \tl_gset:Nv \l_fontspec_family_tl {g__fontspec_UID_\l__fontspec_fontid_tl}
-  \cs_if_exist:cTF {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop}
-    \prg_return_false: \prg_return_true:
- }
+  }
+\cs_new:Nn \__fontspec_save_fontid_family:nn
+  {
+    \prop_get:NnNTF \g__fontspec_family_int_prop {#2} \l__fontspec_tmp_tl
+      {
+        \tl_set:Nx \l__fontspec_tmp_tl
+          { \int_eval:n { \l__fontspec_tmp_tl + 1 } }
+      }
+      { \tl_set:Nn \l__fontspec_tmp_tl { 0 } }
+    \prop_gput:NnV \g__fontspec_family_int_prop {#2} \l__fontspec_tmp_tl
+    \tl_gset:Nx \g__fontspec_nfss_family_tl { #2 ( \l__fontspec_tmp_tl ) }
+    \prop_gput:NnV \g__fontspec_fontid_family_prop {#1} \g__fontspec_nfss_family_tl
+  }
+\cs_generate_variant:Nn \__fontspec_save_fontid_family:nn { VV }
 \cs_new:Nn \__fontspec_save_family:nn
   {
     \__fontspec_save_fontinfo:n {#2}
     \__fontspec_find_autofonts:
-    \DeclareFontFamily{\l__fontspec_nfss_enc_tl}{\l_fontspec_family_tl}{}
+    \DeclareFontFamily{\g__fontspec_nfss_enc_tl}{\g__fontspec_nfss_family_tl}{}
     \__fontspec_set_faces:
     \__fontspec_info:nxx {defining-font} {#1} {#2}
   }
 \cs_new:Nn \__fontspec_save_fontinfo:n
  {
-  \prop_new:c    {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop}
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {fontname} { #1 }
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {options}  { \l__fontspec_all_features_clist }
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {fontdef}
+  \prop_new:c    {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop}
+  \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {fontname} { #1 }
+  \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {options}  { \l__fontspec_all_features_clist }
+  \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 \l__fontspec_rawfeatures_sclist }
+      { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
    }
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {script-num} \l__fontspec_script_int
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {lang-num} \l__fontspec_language_int
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+  \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
+  \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l_fontspec_script_tl
+  \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
  }
 \cs_new:Nn \__fontspec_find_autofonts:
  {
@@ -1535,18 +1558,18 @@
 \cs_new:Nn \__fontspec_setup_nfss:Nnnn
  {
 
-  \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist { #2 , #3 , #4 }
+  \__fontspec_get_features:n { #2 , #3 , #4 }
 
   \tl_put_right:Nx #1
    {
     <\l__fontspec_size_tl> \l__fontspec_scale_tl
       \__fontspec_construct_font_call:nn { \l_fontspec_fontname_tl }
-        { \l__fontspec_pre_feat_sclist \l__fontspec_rawfeatures_sclist }
+        { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
    }
  }
 \cs_new:Nn \__fontspec_declare_shapes_normal:nn
   {
-    \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl} {\l_fontspec_family_tl}
+    \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl} {\g__fontspec_nfss_family_tl}
       {#1} {#2} {\l__fontspec_nfss_tl}{\l__fontspec_postadjust_tl}
   }
 \cs_new:Nn \__fontspec_declare_shapes_smcaps:nn
@@ -1553,7 +1576,7 @@
   {
     \tl_if_empty:NF \l__fontspec_nfss_sc_tl
      {
-      \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl} {\l_fontspec_family_tl} {#1}
+      \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl} {\g__fontspec_nfss_family_tl} {#1}
         { \__fontspec_combo_sc_shape:n {#2} } {\l__fontspec_nfss_sc_tl} {\l__fontspec_postadjust_tl}
      }
   }
@@ -1581,13 +1604,13 @@
     !(\str_if_eq_x_p:nn {\itdefault} {\sldefault})
    }
    {
-    \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl}{\l_fontspec_family_tl}{#1}{\sldefault}
-      {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l__fontspec_postadjust_tl}
+    \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl}{\g__fontspec_nfss_family_tl}{#1}{\sldefault}
+      {<->ssub*\g__fontspec_nfss_family_tl/#1/\itdefault}{\l__fontspec_postadjust_tl}
    }
  }
 \cs_new:Nn \__fontspec_declare_shape_loginfo:nn
  {
-  \tl_gput_right:Nx \l_fontspec_defined_shapes_tl
+  \tl_gput_right:Nx \g__fontspec_defined_shapes_tl
    {
     \exp_not:n { \\ }
     -~ \exp_not:N \str_case:nn {#1/#2}
@@ -1637,7 +1660,7 @@
     \bool_if:NF \l__fontspec_firsttime_bool
       {
         \tl_gset:Nx \g__fontspec_single_feat_tl { #1 }
-        \tl_gput_right:Nx  \l__fontspec_rawfeatures_sclist {#1;}
+        \tl_gput_right:Nx  \g__fontspec_rawfeatures_sclist {#1;}
       }
   }
 \cs_new:Nn \__fontspec_remove_clashing_featstr:n
@@ -1644,7 +1667,7 @@
   {
     \clist_map_inline:nn {#1}
       {
-        \tl_gremove_all:Nn \l__fontspec_rawfeatures_sclist {##1;}
+        \tl_gremove_all:Nn \g__fontspec_rawfeatures_sclist {##1;}
       }
   }
 \cs_set:Npn \__fontspec_init:
@@ -1656,9 +1679,9 @@
   \tl_clear:N \l__fontspec_optical_size_tl
   \tl_clear:N \l__fontspec_ttc_index_tl
   \tl_clear:N \l_fontspec_renderer_tl
-  \tl_clear:N \l_fontspec_defined_shapes_tl
-  \tl_clear:N \g__fontspec_curr_series_tl
-  \tl_gset_eq:NN \l__fontspec_nfss_enc_tl \g_fontspec_encoding_tl
+  \tl_gclear:N \g__fontspec_defined_shapes_tl
+  \tl_gclear:N \g__fontspec_curr_series_tl
+  \tl_gset_eq:NN \g__fontspec_nfss_enc_tl \g_fontspec_encoding_tl
 
   \tl_set:Nn \l_fontspec_mode_tl {node}
   \int_set:Nn \luatex_prehyphenchar:D { `\- } % fixme
@@ -1668,11 +1691,11 @@
  }
 \cs_new:Nn \__fontspec_init_fontface:
   {
-    \tl_clear:N \l__fontspec_rawfeatures_sclist
+    \tl_gclear:N \g__fontspec_rawfeatures_sclist
     \tl_clear:N \l__fontspec_scale_tl
-    \tl_set_eq:NN \l__fontspec_opacity_tl \g__fontspec_opacity_tl
-    \tl_set_eq:NN \l__fontspec_hexcol_tl \g__fontspec_hexcol_tl
-    \tl_set_eq:NN \l__fontspec_postadjust_tl \g__fontspec_postadjust_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
+    \tl_set_eq:NN \l__fontspec_postadjust_tl \c__fontspec_postadjust_tl
     \tl_clear:N \l__fontspec_wordspace_adjust_tl
     \tl_clear:N \l__fontspec_punctspace_adjust_tl
   }
@@ -1949,7 +1972,7 @@
 
 %%^^A%%  fontspec-keyval.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
-\clist_set:Nn \g__fontspec_all_keyval_modules_clist
+\clist_gset:Nn \g__fontspec_all_keyval_modules_clist
   {
     fontspec, fontspec-opentype, fontspec-aat,
     fontspec-preparse, fontspec-preparse-cfg, fontspec-preparse-external, fontspec-preparse-nested,
@@ -1957,7 +1980,7 @@
   }
 \cs_new:Nn \__fontspec_keys_define_code:nnn
   {
-   \keys_define:nn {#1} { #2 .code:n = {#3} }
+    \keys_define:nn {#1} { #2 .code:n = {#3} }
   }
 \cs_new:Nn \__fontspec_aff_error:n
   {
@@ -2053,7 +2076,7 @@
     \seq_if_empty:NT \g__fontspec_bf_series_seq
      {
       \tl_gset:Nx \g__fontspec_curr_series_tl {\bfdefault}
-      \seq_put_right:Nx \g__fontspec_bf_series_seq {\bfdefault}
+      \seq_gput_right:Nx \g__fontspec_bf_series_seq {\bfdefault}
      }
     \tl_if_eq:oxT \g__fontspec_curr_series_tl {\bfdefault}
      { \tl_set_eq:NN \l__fontspec_fontname_bf_tl \l__fontspec_curr_bfname_tl }
@@ -2163,32 +2186,29 @@
  }
 \__fontspec_keys_define_code:nnn {fontspec-preparse} {NFSSEncoding}
  {
-  \tl_gset:Nx \l__fontspec_nfss_enc_tl { #1 }
+  \tl_gset:Nx \g__fontspec_nfss_enc_tl { #1 }
  }
 \__fontspec_keys_define_code:nnn {fontspec-preparse} {NFSSFamily}
  {
   \tl_set:Nx \l__fontspec_nfss_fam_tl { #1 }
-  \cs_undefine:c {g__fontspec_UID_\l__fontspec_fontid_tl}
-  \tl_if_exist:NT \l_fontspec_family_tl
-   { \cs_undefine:c {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} }
  }
 \__fontspec_keys_define_code:nnn {fontspec} {FontFace}
- {
-  \tl_set:No \l__fontspec_arg_tl { \use_iii:nnn #1 }
-  \tl_set_eq:NN \l__fontspec_this_feat_tl \l__fontspec_arg_tl
-  \tl_clear:N \l__fontspec_this_font_tl
-  \int_compare:nT { \clist_count:N \l__fontspec_arg_tl = 1 }
-   {
-    \tl_if_in:NnF \l__fontspec_arg_tl {=}
-     {
-      \tl_set_eq:NN \l__fontspec_this_font_tl \l__fontspec_arg_tl
-      \tl_clear:N \l__fontspec_this_feat_tl
-     }
-   }
+  {
+    \tl_clear:N \l__fontspec_this_font_tl
+    \clist_set:No \l__fontspec_arg_clist { \use_iii:nnn #1 }
+    \clist_set_eq:NN \l__fontspec_this_feat_clist \l__fontspec_arg_clist
+    \int_compare:nT { \clist_count:N \l__fontspec_arg_clist = 1 }
+      {
+        \tl_if_in:NnF \l__fontspec_arg_clist {=}
+          {
+            \tl_set_eq:NN \l__fontspec_this_font_tl \l__fontspec_arg_clist
+            \tl_clear:N \l__fontspec_this_feat_clist
+          }
+      }
 
-  \__fontspec_add_nfssfont:nnnn
-   {\use_i:nnn #1}{\use_ii:nnn #1}{\l__fontspec_this_font_tl}{\l__fontspec_this_feat_tl}
- }
+    \__fontspec_add_nfssfont:nnnn
+      {\use_i:nnn #1} {\use_ii:nnn #1} {\l__fontspec_this_font_tl} {\l__fontspec_this_feat_clist}
+  }
 \__fontspec_keys_define_code:nnn {fontspec} {Scale}
  {
   \str_case:nnF {#1}
@@ -2336,7 +2356,7 @@
 \cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8
  {
   \tl_set:Nn \l__fontspec_hexcol_tl {#1#2#3#4#5#6}
-  \tl_if_eq:NNF \l__fontspec_opacity_tl \g__fontspec_opacity_tl
+  \tl_if_eq:NNF \l__fontspec_opacity_tl \c__fontspec_opacity_tl
    {
     \bool_if:NF \l__fontspec_firsttime_bool
      { \__fontspec_warning:nx {opa-twice-col} {#7#8} }
@@ -2348,7 +2368,7 @@
  {
   \int_set:Nn \l__fontspec_tmp_int {255}
   \__fontspec_int_mult_truncate:Nn \l__fontspec_tmp_int { #1 }
-  \tl_if_eq:NNF \l__fontspec_opacity_tl \g__fontspec_opacity_tl
+  \tl_if_eq:NNF \l__fontspec_opacity_tl \c__fontspec_opacity_tl
    {
     \bool_if:NF \l__fontspec_firsttime_bool
      { \__fontspec_warning:nx {opa-twice} {#1} }
@@ -3441,24 +3461,20 @@
 
 %%^^A%%  fontspec-math.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \@ifpackageloaded{euler}
- {
-  \bool_set_true:N \g__fontspec_pkg_euler_loaded_bool
- }
- {
-  \bool_set_false:N \g__fontspec_pkg_euler_loaded_bool
- }
+  { \bool_gset_true:N  \g__fontspec_pkg_euler_loaded_bool }
+  { \bool_gset_false:N \g__fontspec_pkg_euler_loaded_bool }
 \cs_new:Nn \fontspec_setup_maths:
  {
   \@ifpackageloaded{euler}
    {
     \bool_if:NTF \g__fontspec_pkg_euler_loaded_bool
-     { \bool_set_true:N \g__fontspec_math_euler_bool }
+     { \bool_gset_true:N \g__fontspec_math_euler_bool }
      { \__fontspec_error:n {euler-too-late} }
    }
    {}
-  \@ifpackageloaded{lucbmath}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
-  \@ifpackageloaded{lucidabr}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
-  \@ifpackageloaded{lucimatx}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
+  \@ifpackageloaded{lucbmath}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
+  \@ifpackageloaded{lucidabr}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
+  \@ifpackageloaded{lucimatx}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
   \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
   \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
   \DeclareMathAccent{\acute}   {\mathalpha}{legacymaths}{19}
@@ -3540,34 +3556,34 @@
  {
   \@ifpackageloaded{anttor}
    {
-    \ifx\define at antt@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
+    \ifx\define at antt@mathversions a\bool_gset_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{arevmath}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{eulervm}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathdesign}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{concmath}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{cmbright}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathesf}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{arevmath}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{eulervm}        {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathdesign}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{concmath}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{cmbright}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathesf}        {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{gfsartemisia}   {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{gfsneohellenic} {\bool_gset_false:N \g__fontspec_math_bool}{}
   \@ifpackageloaded{iwona}
    {
     \ifx\define at iwona@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{kpfonts}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{kmath}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{kpfonts}{\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{kmath}  {\bool_gset_false:N \g__fontspec_math_bool}{}
   \@ifpackageloaded{kurier}
    {
     \ifx\define at kurier@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{fouriernc}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{fourier}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{lmodern}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathpazo}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathptmx}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{MinionPro}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{unicode-math}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{breqn}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{fouriernc}    {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{fourier}      {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{lmodern}      {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathpazo}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathptmx}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{MinionPro}    {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{unicode-math} {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{breqn}        {\bool_gset_false:N \g__fontspec_math_bool}{}
   \bool_if:NT \g__fontspec_math_bool
    {
     \__fontspec_info:n {setup-math}
@@ -3644,15 +3660,15 @@
  }
 \cs_new_protected:Npn \emfontdeclare #1
   {
-    \prop_clear:N    \g__fontspec_em_prop
-    \int_zero:N      \l__fontspec_emdef_int
-    \bool_set_true:N \g__fontspec_em_normalise_slant_bool
+    \prop_gclear:N    \g__fontspec_em_prop
+    \int_zero:N       \l__fontspec_emdef_int
+    \bool_gset_true:N \g__fontspec_em_normalise_slant_bool
 
     \tl_if_in:nnT {#1} {\slshape}
       {
         \tl_if_in:nnT {#1} {\itshape}
           {
-            \bool_set_false:N \g__fontspec_em_normalise_slant_bool
+            \bool_gset_false:N \g__fontspec_em_normalise_slant_bool
           }
       }
 
@@ -3698,7 +3714,7 @@
 \cs_set:Npn \eminnershape { \upshape }
 \cs_new_protected:Npn \strongfontdeclare #1
   {
-    \prop_clear:N    \g__fontspec_strong_prop
+    \prop_gclear:N   \g__fontspec_strong_prop
     \int_zero:N      \l__fontspec_strongdef_int
 
     \group_begin:

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2018-07-29 21:15:34 UTC (rev 48307)
@@ -37,10 +37,11 @@
 %% (your choice): <http://www.latex-project.org/lppl/>.
 %% ------------------------------------------------
 %%^^A%%  fontspec.dtx -- part of FONTSPEC <wspr.io/fontspec>
+%%^^A%%  Metadata for the package, including files and versioning
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-xetex}%
-  {2017/11/09}{2.6g}{Font selection for XeLaTeX and LuaLaTeX}
+  {2018/07/29}{v2.6h}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -70,6 +71,8 @@
 \bool_new:N \l__fontspec_defining_encoding_bool
 \bool_new:N \l__fontspec_script_exist_bool
 \bool_new:N \g__fontspec_em_normalise_slant_bool
+\bool_new:N \l__fontspec_proceed_bool
+\bool_new:N \l__fontspec_check_feat_bool
 \int_new:N \l__fontspec_script_int
 \int_new:N \l__fontspec_language_int
 \int_new:N \l__fontspec_strnum_int
@@ -97,13 +100,15 @@
 \clist_new:N \l__fontspec_sizing_leftover_clist
 \clist_new:N \l__fontspec_fontfeat_clist
 \clist_new:N \l__fontspec_fontfeat_curr_clist
-\tl_new:N \l__fontspec_fontfeat_up_clist
-\tl_new:N \l__fontspec_fontfeat_bf_clist
-\tl_new:N \l__fontspec_fontfeat_it_clist
-\tl_new:N \l__fontspec_fontfeat_bfit_clist
-\tl_new:N \l__fontspec_fontfeat_sl_clist
-\tl_new:N \l__fontspec_fontfeat_bfsl_clist
-\tl_new:N \l__fontspec_fontfeat_sc_clist
+\clist_new:N \l__fontspec_arg_clist
+\clist_new:N \l__fontspec_this_feat_clist
+\clist_new:N \l__fontspec_fontfeat_up_clist
+\clist_new:N \l__fontspec_fontfeat_bf_clist
+\clist_new:N \l__fontspec_fontfeat_it_clist
+\clist_new:N \l__fontspec_fontfeat_bfit_clist
+\clist_new:N \l__fontspec_fontfeat_sl_clist
+\clist_new:N \l__fontspec_fontfeat_bfsl_clist
+\clist_new:N \l__fontspec_fontfeat_sc_clist
 \prop_new:N \g__fontspec_fontopts_prop
 \prop_new:N \l__fontspec_nfss_prop
 \prop_new:N \l__fontspec_nfssfont_prop
@@ -111,41 +116,50 @@
 \prop_new:N \g__fontspec_all_opentype_feature_names_prop
 \prop_new:N \g__fontspec_em_prop
 \prop_new:N \g__fontspec_strong_prop
+\prop_new:N \g__fontspec_fontid_family_prop
+\prop_new:N \g__fontspec_family_int_prop
 \tl_new:N \l_fontspec_family_tl
 \tl_new:N \g_fontspec_encoding_tl
 \tl_new:N \l_fontspec_renderer_tl
 \tl_new:N \l_fontspec_fontname_tl
-\tl_new:N \l_fontspec_defined_shapes_tl
 \tl_clear_new:N \UTFencname
 \tl_clear_new:N \cyrillicencoding
 \tl_clear_new:N \latinencoding
+\tl_new:N \l_fontspec_mode_tl
+\tl_new:N \g__fontspec_curr_series_tl
+\tl_new:N \g__fontspec_defined_shapes_tl
+\tl_new:N \g__fontspec_nfss_enc_tl
+\tl_new:N \g__fontspec_nfss_family_tl
 \tl_new:N \g__fontspec_single_feat_tl
-\tl_new:N \l__fontspec_tmp_tl
+\tl_new:N \l__fontspec_basename_tl
+\tl_new:N \l__fontspec_curr_fontname_tl
+\tl_new:N \l__fontspec_curr_bfname_tl
+\tl_new:N \l__fontspec_ext_filename_tl
+\tl_new:N \l__fontspec_extension_tl
+\tl_new:N \l__fontspec_font_path_tl
+\tl_new:N \l__fontspec_fontid_tl
+\tl_new:N \l__fontspec_fontname_tl
+\tl_new:N \l__fontspec_hexcol_tl
+\tl_new:N \l__fontspec_nfss_sc_tl
+\tl_new:N \l__fontspec_nfss_tl
+\tl_new:N \l__fontspec_nfss_fam_tl
+\tl_new:N \l__fontspec_opacity_tl
+\tl_new:N \l__fontspec_optical_size_tl
+\tl_new:N \l__fontspec_options_tl
+\tl_new:N \l__fontspec_saved_fontname_tl
+\tl_new:N \l__fontspec_scale_tl
 \tl_new:N \l__fontspec_size_tl
 \tl_new:N \l__fontspec_sizedfont_tl
-\tl_new:N \l__fontspec_nfss_tl
-\tl_new:N \l__fontspec_nfss_sc_tl
 \tl_new:N \l__fontspec_this_font_tl
-\tl_new:N \l__fontspec_scale_tl
-\tl_new:N \l__fontspec_opacity_tl
-\tl_new:N \l__fontspec_hexcol_tl
-\tl_new:N \l__fontspec_fontid_tl
-\tl_new:N \l__fontspec_extension_tl
-\tl_new:N \l__fontspec_ext_filename_tl
-\tl_new:N \l__fontspec_font_path_tl
-\tl_new:N \l__fontspec_basename_tl
-\tl_new:N \l__fontspec_curr_fontname_tl
-\tl_new:N \l__fontspec_saved_fontname_tl
-\tl_new:N \l__fontspec_optical_size_tl
+\tl_new:N \l__fontspec_tmp_tl
 \tl_new:N \l__fontspec_ttc_index_tl
-\tl_new:N \l__fontspec_nfss_enc_tl
-\tl_new:N \g__fontspec_curr_series_tl
-\tl_new:N \l__fontspec_options_tl
-\tl_new:N \l__fontspec_fontname_tl
 \tl_new:N \g__fontspec_mathrm_tl
 \tl_new:N \g__fontspec_bfmathrm_tl
 \tl_new:N \g__fontspec_mathsf_tl
 \tl_new:N \g__fontspec_mathtt_tl
+\tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault}
 \tl_new:N \l__fontspec_family_label_tl
 \tl_new:N \l__fontspec_fake_slant_tl
 \tl_new:N \l__fontspec_fake_embolden_tl
@@ -161,20 +175,17 @@
 \tl_new:N \l__fontspec_lang_name_tl
 \tl_new:N \l_fontspec_lang_tl
 \tl_new:N  \l__fontspec_mapping_tl
-\tl_new:N  \g__fontspec_hexcol_tl
-\tl_new:N  \g__fontspec_opacity_tl
-\tl_set:Nn \g__fontspec_hexcol_tl {000000}
-\tl_set:Nn \g__fontspec_opacity_tl {FF~}
 \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_postadjust_tl
-\tl_set:Nn \g__fontspec_postadjust_tl { \l__fontspec_wordspace_adjust_tl \l__fontspec_punctspace_adjust_tl }
-\tl_new:N \l__fontspec_rawfeatures_sclist
+\tl_const:Nn \c__fontspec_hexcol_tl {000000}
+\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
-\tl_new:N \g__fontspec_rmfamily_family
-\tl_new:N \g__fontspec_sffamily_family
-\tl_new:N \g__fontspec_ttfamily_family
+\tl_new:N \l__fontspec_rmfamily_family_tl
+\tl_new:N \l__fontspec_sffamily_family_tl
+\tl_new:N \l__fontspec_ttfamily_family_tl
 
 %%^^A%%  fontspec-msg.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \cs_new:Npn \__fontspec_error:n     { \msg_error:nn     {fontspec} }
@@ -362,11 +373,11 @@
  }
 \__fontspec_msg_new:nnn {fontspec} {defining-font}
  {
-  Font family '\l_fontspec_family_tl' created for font '#2'
+  Font family '\g__fontspec_nfss_family_tl' created for font '#2'
   with options [\l__fontspec_all_features_clist].\\
   \\
   This font family consists of the following NFSS series/shapes:\\
-  \l_fontspec_defined_shapes_tl
+  \g__fontspec_defined_shapes_tl
  }
 \__fontspec_msg_new:nnn {fontspec} {no-font-shape}
  {
@@ -406,23 +417,25 @@
 
 %%^^A%%  fontspec-opening.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \DeclareOption{cm-default}
- { \__fontspec_warning:n {cm-default-obsolete} }
-\DeclareOption{math}{\bool_set_true:N \g__fontspec_math_bool}
-\DeclareOption{no-math}{\bool_set_false:N \g__fontspec_math_bool}
-\DeclareOption{config}{\bool_set_true:N \g__fontspec_cfg_bool}
-\DeclareOption{no-config}{\bool_set_false:N \g__fontspec_cfg_bool}
-\DeclareOption{euenc}{\bool_set_true:N  \g__fontspec_euenc_bool}
-\DeclareOption{tuenc}{\bool_set_false:N \g__fontspec_euenc_bool}
-\DeclareOption{quiet}
- {
-  \msg_redirect_module:nnn { fontspec } { warning } { info }
-  \msg_redirect_module:nnn { fontspec } { info } { none }
- }
+  {
+    \__fontspec_warning:n {cm-default-obsolete}
+  }
+\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 }
- }
+  {
+    \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
@@ -438,14 +451,14 @@
       }
       {
         \__fontspec_warning:n {tu-missing}
-        \bool_set_true:N \g__fontspec_euenc_bool
+        \bool_gset_true:N \g__fontspec_euenc_bool
       }
   }
 \bool_if:NTF \g__fontspec_euenc_bool
   {
-    \tl_set:Nn \g_fontspec_encoding_tl {EU1}
+    \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
   }
-  { \tl_set: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}
@@ -539,18 +552,22 @@
 \NewDocumentCommand \fontspec { O{} m O{} }
   {
     \__fontspec_main_fontspec:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmainfont { O{} m O{} }
   {
     \__fontspec_main_setmainfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setsansfont { O{} m O{} }
   {
     \__fontspec_main_setsansfont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmonofont { O{} m O{} }
   {
     \__fontspec_main_setmonofont:nn {#1,#3} {#2}
+    \ignorespaces
   }
 \NewDocumentCommand \setmathrm { O{} m O{} }
   {
@@ -574,8 +591,16 @@
   }
 \NewDocumentCommand \newfontfamily { m O{} m O{} }
   {
-    \__fontspec_main_newfontfamily:nnn {#1} {#2,#4} {#3}
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \NewDocumentCommand
   }
+\NewDocumentCommand \renewfontfamily { m O{} m O{} }
+  {
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \RenewDocumentCommand
+  }
+\NewDocumentCommand \setfontfamily { m O{} m O{} }
+  {
+    \__fontspec_main_newfontfamily:nnnN {#1} {#2,#4} {#3} \DeclareDocumentCommand
+  }
 \NewDocumentCommand \newfontface { m O{} m O{} }
   {
     \__fontspec_main_newfontface:nnn {#1} {#2,#4} {#3}
@@ -582,7 +607,10 @@
   }
 \NewDocumentCommand \defaultfontfeatures { t+ o m }
   {
-    \__fontspec_main_defaultfontfeatures:nnn {#1} {#2} {#3}
+    \IfNoValueTF {#2}
+      { \__fontspec_set_default_features:nn {#1} {#3} }
+      { \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} }
+    \ignorespaces
   }
 \NewDocumentCommand \addfontfeatures {m}
   {
@@ -624,9 +652,9 @@
   {
     \fontspec_new_lang:nn {#1} {#2}
   }
-\NewDocumentCommand \DeclareFontsExtensions {m}
+\NewDocumentCommand \DeclareFontExtensions {m}
   {
-    \__fontspec_main_DeclareFontsExtensions:n {#1}
+    \__fontspec_main_DeclareFontExtensions:n {#1}
   }
 \NewDocumentCommand \IfFontFeatureActiveTF {mmm}
   {
@@ -636,81 +664,83 @@
 %%^^A%%  fontspec-user.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
 \cs_new:Nn \__fontspec_main_fontspec:nn
- {
-  \fontspec_set_family:Nnn \f at family {#1} {#2}
-  \fontencoding { \l__fontspec_nfss_enc_tl }
-  \selectfont
-  \ignorespaces
- }
+  {
+    \fontspec_set_family:Nnn \f at family {#1} {#2}
+    \fontencoding { \g__fontspec_nfss_enc_tl }
+    \selectfont
+  }
 \cs_new:Nn \__fontspec_main_setmainfont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_rmfamily_family {#1} {#2}
-  \tl_set_eq:NN \rmdefault \g__fontspec_rmfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_rmfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_rmfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \rmdefault \l__fontspec_rmfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \rmfamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_rmfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\rmdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setmainfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\rmdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setmainfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setsansfont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_sffamily_family {#1} {#2}
-  \tl_set_eq:NN \sfdefault \g__fontspec_sffamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_sffamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_sffamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \sfdefault \l__fontspec_sffamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \sffamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_sffamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\sfdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setsansfont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\sfdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setsansfont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setmonofont:nn
- {
-  \fontspec_set_family:Nnn \g__fontspec_ttfamily_family {#1} {#2}
-  \tl_set_eq:NN \ttdefault \g__fontspec_ttfamily_family
-  \use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
-   {
-    \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-    \exp_not:N \fontfamily { \g__fontspec_ttfamily_family }
-    \exp_not:N \selectfont
-   }
+  {
+    \fontspec_set_family:Nnn \l__fontspec_ttfamily_family_tl {#1} {#2}
+    \tl_set_eq:NN \ttdefault \l__fontspec_ttfamily_family_tl
+    \use:x
+      {
+        \exp_not:n { \DeclareRobustCommand \ttfamily }
+          {
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \fontfamily { \l__fontspec_ttfamily_family_tl }
+            \exp_not:N \selectfont
+          }
+      }
+    \str_if_eq_x:nnT {\familydefault} {\ttdefault}
+      { \tl_set_eq:NN \encodingdefault \g__fontspec_nfss_enc_tl }
+    \__fontspec_setmonofont_hook:nn {#1} {#2}
+    \normalfont
   }
-  \str_if_eq_x:nnT {\familydefault} {\ttdefault}
-    { \tl_set_eq:NN \encodingdefault \l__fontspec_nfss_enc_tl }
-  \__fontspec_setmonofont_hook:nn {#1} {#2}
-  \normalfont
-  \ignorespaces
- }
 \cs_new:Nn \__fontspec_main_setmathrm:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathrm_tl {#1} {#2}
     \__fontspec_setmathrm_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setboldmathrm:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_bfmathrm_tl {#1} {#2}
     \__fontspec_setboldmathrm_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setmathsf:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {#1} {#2}
     \__fontspec_setmathsf_hook:nn {#1} {#2}
   }
 \cs_new:Nn \__fontspec_main_setmathtt:nn
   {
-    \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
+ \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {#1} {#2}
     \__fontspec_setmathtt_hook:nn {#1} {#2}
   }
 \cs_set_eq:NN \__fontspec_setmainfont_hook:nn   \use_none:nn
@@ -724,113 +754,103 @@
 \@onlypreamble\setboldmathrm
 \@onlypreamble\setmathsf
 \@onlypreamble\setmathtt
-\tl_set:Nn \g__fontspec_mathrm_tl {\rmdefault}
-\tl_set:Nn \g__fontspec_mathsf_tl {\sfdefault}
-\tl_set:Nn \g__fontspec_mathtt_tl {\ttdefault}
-\cs_new:Nn \__fontspec_main_newfontfamily:nnn
- {
-  \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3}
-  \use:x
-   {
-    \exp_not:N \DeclareRobustCommand \exp_not:N #1
-     {
-      \exp_not:N \fontfamily { \use:c {g__fontspec_ \cs_to_str:N #1 _family} }
-      \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
-      \exp_not:N \selectfont
-     }
-   }
- }
+\tl_gset:Nn \g__fontspec_mathrm_tl {\rmdefault}
+\tl_gset:Nn \g__fontspec_mathsf_tl {\sfdefault}
+\tl_gset:Nn \g__fontspec_mathtt_tl {\ttdefault}
+\cs_new:Nn \__fontspec_main_newfontfamily:nnnN
+  {
+    \fontspec_set_family:cnn { l__fontspec_ \cs_to_str:N #1 _family_tl } {#2} {#3}
+    \use:x
+      {
+        \exp_not:N #4 \exp_not:N #1 {}
+          {
+            \exp_not:N \fontfamily { \use:c { l__fontspec_ \cs_to_str:N #1 _family_tl } }
+            \exp_not:N \fontencoding { \g__fontspec_nfss_enc_tl }
+            \exp_not:N \selectfont
+          }
+      }
+  }
 \cs_new:Nn \__fontspec_main_newfontface:nnn
- {
-  \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
- }
-\cs_new:Nn \__fontspec_main_defaultfontfeatures:nnn
   {
-    \IfNoValueTF {#2}
-     { \__fontspec_set_default_features:nn {#1} {#3} }
-     { \__fontspec_set_font_default_features:nnn {#1} {#2} {#3} }
-    \ignorespaces
+    \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
   }
 \cs_new:Nn \__fontspec_set_default_features:nn
   {
-    \IfBooleanTF {#1} \clist_put_right:Nn \clist_set:Nn
+    \IfBooleanTF {#1} \clist_gput_right:Nn \clist_gset:Nn
       \g__fontspec_default_fontopts_clist {#2}
   }
 \cs_new:Nn \__fontspec_set_font_default_features:nnn
- {
-  \clist_map_inline:nn {#2}
-   {
-    \tl_if_single:nTF {##1}
-     { \tl_set:No \l__fontspec_tmp_tl { \cs:w g__fontspec_ \cs_to_str:N ##1 _family\cs_end: } }
-     { \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {##1} }
+  {
+    \clist_map_inline:nn {#2}
+      {
+        \tl_if_single:nTF {##1}
+          { \tl_set:No \l__fontspec_tmp_tl { \cs:w l__fontspec_ \cs_to_str:N ##1 _family_tl\cs_end: } }
+          { \__fontspec_sanitise_fontname:Nn \l__fontspec_tmp_tl {##1} }
 
-    \IfBooleanTF {#1}
-     {
-      \prop_get:NVNF \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
-       { \tl_clear:N \l__fontspec_tmpb_tl }
-      \tl_put_right:Nn \l__fontspec_tmpb_tl {#3,}
-      \prop_gput:NVV   \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
-     }
-     {
-      \tl_if_empty:nTF {#3}
-       { \prop_gremove:NV \g__fontspec_fontopts_prop \l__fontspec_tmp_tl }
-       { \prop_put:NVn    \g__fontspec_fontopts_prop \l__fontspec_tmp_tl {#3,} }
-     }
-   }
- }
+        \IfBooleanTF {#1}
+          {
+            \prop_get:NVNF \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
+              { \tl_clear:N \l__fontspec_tmpb_tl }
+            \tl_put_right:Nn \l__fontspec_tmpb_tl {#3,}
+            \prop_gput:NVV   \g__fontspec_fontopts_prop \l__fontspec_tmp_tl \l__fontspec_tmpb_tl
+          }
+          {
+            \tl_if_empty:nTF {#3}
+              { \prop_gremove:NV \g__fontspec_fontopts_prop \l__fontspec_tmp_tl }
+              { \prop_gput:NVn    \g__fontspec_fontopts_prop \l__fontspec_tmp_tl {#3,} }
+          }
+      }
+  }
 \cs_new:Nn \__fontspec_main_addfontfeatures:n
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \group_begin:
-      \keys_set_known:nnN {fontspec-addfeatures} {#1} \l__fontspec_tmp_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {options}  \l__fontspec_options_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {fontname} \l__fontspec_fontname_tl
-      \bool_set_true:N \l__fontspec_disable_defaults_bool
-      \use:x
-       {
-        \__fontspec_select_font_family:nn
-          { \l__fontspec_options_tl , #1 } {\l__fontspec_fontname_tl}
-       }
-    \group_end:
-    \fontfamily\l_fontspec_family_tl\selectfont
-   }
-   {
-    \__fontspec_warning:nx {addfontfeatures-ignored} {#1}
-   }
-  \ignorespaces
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \group_begin:
+          \keys_set_known:nnN {fontspec-addfeatures} {#1} \l__fontspec_tmp_tl
+          \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {options}  \l__fontspec_options_tl
+          \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {fontname} \l__fontspec_fontname_tl
+          \bool_set_true:N \l__fontspec_disable_defaults_bool
+          \use:x
+            {
+              \__fontspec_select_font_family:nn
+                { \l__fontspec_options_tl , #1 } {\l__fontspec_fontname_tl}
+            }
+        \group_end:
+        \fontfamily \g__fontspec_nfss_family_tl \selectfont
+      }
+      {
+        \__fontspec_warning:nx {addfontfeatures-ignored} {#1}
+      }
+    \ignorespaces
+  }
 \cs_new:Nn \__fontspec_main_newfontfeature:nn
- {
-  \keys_define:nn { fontspec }
-   {
-    #1 .code:n =
-     {
-      \__fontspec_update_featstr:n {#2}
-     }
-   }
- }
+  {
+    \keys_define:nn { fontspec }
+      {
+        #1 .code:n = { \__fontspec_update_featstr:n {#2} }
+      }
+  }
 \cs_new:Nn \__fontspec_main_newAATfeature:nnnn
- {
-  \keys_if_exist:nnF { fontspec } {#1}
-    { \__fontspec_define_aat_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec } {#1}
+      { \__fontspec_define_aat_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \__fontspec_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
- }
+    \__fontspec_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
+  }
 \cs_new:Nn \__fontspec_main_newopentypefeature:nnn
- {
-  \keys_if_exist:nnF { fontspec / options } {#1}
-    { \__fontspec_define_opentype_feature_group:n {#1} }
+  {
+    \keys_if_exist:nnF { fontspec / options } {#1}
+      { \__fontspec_define_opentype_feature_group:n {#1} }
 
-  \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
-    { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
+    \keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
+      { \__fontspec_warning:nxx {feature-option-overwrite} {#1} {#2} }
 
-  \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn
-    {#1} {#2} { \__fontspec_strip_plus_minus:n {#3} } {#3} {}
- }
+    \exp_args:Nnnx \__fontspec_define_opentype_feature:nnnnn
+      {#1} {#2} { \__fontspec_strip_plus_minus:n {#3} } {#3} {}
+  }
 \cs_new:Nn \__fontspec_strip_plus_minus:n { \__fontspec_strip_plus_minus_aux:Nq #1 \q_nil }
 \cs_new:Npn \__fontspec_strip_plus_minus_aux:Nq #1#2 \q_nil
   {
@@ -837,57 +857,56 @@
     \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2}
   }
 \cs_new:Nn \__fontspec_main_aliasfontfeature:nn
- {
-  \bool_set_false:N \l__fontspec_alias_bool
+  {
+    \bool_set_false:N \l__fontspec_alias_bool
 
-  \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT {##1} {#1}
+    \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
       {
-        \bool_set_true:N \l__fontspec_alias_bool
-        \keys_define:nn {##1}
-          { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+        \keys_if_exist:nnT {##1} {#1}
+          {
+            \bool_set_true:N \l__fontspec_alias_bool
+            \keys_define:nn {##1}
+              { #2 .code:n = { \keys_set:nn {##1} { #1 = {####1} } } }
+          }
       }
-   }
 
-  \bool_if:NF \l__fontspec_alias_bool
-    { \__fontspec_warning:nx {rename-feature-not-exist} {#1} }
- }
+    \bool_if:NF \l__fontspec_alias_bool
+      { \__fontspec_warning:nx {rename-feature-not-exist} {#1} }
+  }
 \cs_new:Nn \__fontspec_main_aliasfontfeatureoption:nnn
- {
-  \bool_set_false:N \l__fontspec_alias_bool
+  {
+    \bool_set_false:N \l__fontspec_alias_bool
 
-  \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
-   {
-     \keys_if_exist:nnT { ##1 / #1 } {#2}
+    \clist_map_inline:Nn \g__fontspec_all_keyval_modules_clist
       {
-        \bool_set_true:N \l__fontspec_alias_bool
-        \keys_define:nn { ##1 / #1 }
-          { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
-      }
+        \keys_if_exist:nnT { ##1 / #1 } {#2}
+          {
+            \bool_set_true:N \l__fontspec_alias_bool
+            \keys_define:nn { ##1 / #1 }
+              { #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
+          }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
-      {
-        \keys_define:nn { ##1 / #1 }
-          { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
-      }
+       \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
+         {
+            \keys_define:nn { ##1 / #1 }
+              { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
+         }
 
-     \keys_if_exist:nnT { ##1 / #1 } {#2Off}
-      {
-        \keys_define:nn { ##1 / #1 }
-          { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
-      }
-   }
+       \keys_if_exist:nnT { ##1 / #1 } {#2Off}
+         {
+            \keys_define:nn { ##1 / #1 }
+              { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
+         }
+     }
 
-  \bool_if:NF \l__fontspec_alias_bool
-    { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} }
- }
-\cs_new:Nn \__fontspec_main_DeclareFontsExtensions:n
- {
-  \clist_set:Nn \l__fontspec_extensions_clist { #1 }
-  \tl_remove_all:Nn \l__fontspec_extensions_clist {~}
- }
-\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
+    \bool_if:NF \l__fontspec_alias_bool
+      { \__fontspec_warning:nx {rename-feature-not-exist} {#1/#2} }
+  }
+\cs_new:Nn \__fontspec_main_DeclareFontExtensions:n
+  {
+    \clist_set:Nn \l__fontspec_extensions_clist { #1 }
+  }
+\__fontspec_main_DeclareFontExtensions:n {.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
 \cs_new:Nn \__fontspec_main_IfFontFeatureActiveTF:nnn
   {
     \__fontspec_if_font_feature:nTF {#1} {#2} {#3}
@@ -902,7 +921,7 @@
       \bool_set_true:N \l__fontspec_never_check_bool
       \bool_set_false:N \l__fontspec_firsttime_bool
       \clist_clear:N \l__fontspec_fontfeat_clist
-      \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist {#1}
+      \__fontspec_get_features:n {#1}
     \group_end:
 
 
@@ -916,64 +935,64 @@
 %%^^A%%  fontspec-api.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
 \prg_new_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F}
- {
-  \cs_if_exist:cTF {g__fontspec_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
- }
+  {
+    \cs_if_exist:cTF {g__fontspec_fontinfo_ \f at family _prop} \prg_return_true: \prg_return_false:
+  }
 \prg_new_conditional:Nnn \fontspec_if_aat_feature:nn {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_atsui_bool
-     {
-      \__fontspec_make_AAT_feature_string:NnnTF \font {#1} {#2}
-        \prg_return_true: \prg_return_false:
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_atsui_bool
+          {
+            \__fontspec_make_AAT_feature_string:NnnTF \font {#1} {#2}
+              \prg_return_true: \prg_return_false:
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_opentype: {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_ot_bool \prg_return_true: \prg_return_false:
-   }
-   {
-    \prg_return_false:
-   }
- }
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_ot_bool \prg_return_true: \prg_return_false:
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_feature:n {TF,T,F}
- {
-  \fontspec_if_fontspec_font:TF
-   {
-    \__fontspec_set_font_type:N \font
-    \bool_if:NTF \l__fontspec_ot_bool
-     {
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-num} \l__fontspec_tmp_tl
-      \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl}
+  {
+    \fontspec_if_fontspec_font:TF
+      {
+        \__fontspec_set_font_type:N \font
+        \bool_if:NTF \l__fontspec_ot_bool
+          {
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-num} \l__fontspec_tmp_tl
+            \int_set:Nn \l__fontspec_script_int {\l__fontspec_tmp_tl}
 
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-num} \l__fontspec_tmp_tl
-      \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl}
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-num} \l__fontspec_tmp_tl
+            \int_set:Nn \l__fontspec_language_int {\l__fontspec_tmp_tl}
 
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
-      \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {script-tag}  \l_fontspec_script_tl
+            \prop_get:cnN {g__fontspec_fontinfo_ \f at family _prop} {lang-tag}    \l_fontspec_lang_tl
 
-      \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
-     }
-     {
-      \prg_return_false:
-     }
-   }
-   {
-    \prg_return_false:
-   }
- }
+            \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
+          }
+          {
+            \prg_return_false:
+          }
+      }
+      {
+        \prg_return_false:
+      }
+  }
 \prg_new_conditional:Nnn \fontspec_if_feature:nnn {TF,T,F}
  {
   \fontspec_if_fontspec_font:TF
@@ -1065,19 +1084,19 @@
    { \prg_return_false: }
  }
 \cs_new:Nn \fontspec_set_family:Nnn
- {
-  \tl_set:Nn \l__fontspec_family_label_tl { #1 }
-  \__fontspec_select_font_family:nn {#2}{#3}
-  \tl_set_eq:NN #1 \l_fontspec_family_tl
- }
+  {
+    \tl_set:Nn \l__fontspec_family_label_tl {#1}
+    \__fontspec_select_font_family:nn {#2} {#3}
+    \tl_set_eq:NN #1 \l_fontspec_family_tl
+  }
 \cs_generate_variant:Nn \fontspec_set_family:Nnn {c}
-\cs_new:Nn \fontspec_set_fontface:NNnn
- {
-  \tl_set:Nn \l__fontspec_family_label_tl { #1 }
-  \__fontspec_select_font_family:nn {#3}{#4}
-  \font #1 = \fontname \l_fontspec_font \scan_stop:
-  \tl_set_eq:NN #2 \l_fontspec_family_tl
- }
+ \cs_new:Nn \fontspec_set_fontface:NNnn
+  {
+    \tl_set:Nn \l__fontspec_family_label_tl {#1}
+    \__fontspec_select_font_family:nn {#3}{#4}
+    \global \font #1 = \fontname \l_fontspec_font \scan_stop:
+    \tl_set_eq:NN #2 \l_fontspec_family_tl
+  }
 \prg_new_conditional:Nnn \fontspec_font_if_exist:n {TF,T,F}
   {
     \group_begin:
@@ -1143,7 +1162,7 @@
   \__fontspec_preparse_features:
   \__fontspec_load_font:
   \__fontspec_set_scriptlang:
-  \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist {}
+  \__fontspec_get_features:n {}
   \bool_set_false:N \l__fontspec_firsttime_bool
 
   \__fontspec_save_family_needed:nTF {#2}
@@ -1153,6 +1172,8 @@
    {
    }
   \group_end:
+
+  \tl_set_eq:NN \l_fontspec_family_tl \g__fontspec_nfss_family_tl
  }
 \cs_set_eq:NN \fontspec_select:nn \__fontspec_select_font_family:nn %% deprecated, for compatibility only
 \cs_new:Nn \__fontspec_sanitise_fontname:Nn
@@ -1302,10 +1323,10 @@
      }
    }
  }
-\cs_new:Nn \__fontspec_get_features:Nn
+\cs_new:Nn \__fontspec_get_features:n
  {
   \__fontspec_init_fontface:
-  \__fontspec_keys_set_known:nxN {fontspec-renderer} {\l__fontspec_fontfeat_clist,#2}
+  \__fontspec_keys_set_known:nxN {fontspec-renderer} {\l__fontspec_fontfeat_clist,#1}
     \l__fontspec_keys_leftover_clist
   \__fontspec_keys_set_known:nxN {fontspec} {\l__fontspec_keys_leftover_clist} \l__fontspec_keys_leftover_clist
   \bool_if:NTF \l__fontspec_ot_bool
@@ -1323,66 +1344,68 @@
     { \__fontspec_update_featstr:n { mapping = \l__fontspec_mapping_tl } }
 
   \str_if_eq_x:nnF { \l__fontspec_hexcol_tl \l__fontspec_opacity_tl }
-                   { \g__fontspec_hexcol_tl \g__fontspec_opacity_tl }
+                   { \c__fontspec_hexcol_tl \c__fontspec_opacity_tl }
     { \__fontspec_update_featstr:n { color = \l__fontspec_hexcol_tl\l__fontspec_opacity_tl } }
-
-  \tl_set_eq:NN #1 \l__fontspec_rawfeatures_sclist
  }
-\prg_new_conditional:Nnn \__fontspec_save_family_needed:n {TF}
- {
+\prg_new_conditional:Nnn \__fontspec_save_family_needed:n { TF }
+  {
 
 
-  \tl_if_exist:cF {g__fontspec_UID_\l__fontspec_fontid_tl}
+  \tl_if_empty:NTF \l__fontspec_nfss_fam_tl
     {
-      \tl_new:c {g__fontspec_UID_\l__fontspec_fontid_tl}
+      \prop_get:NVNTF \g__fontspec_fontid_family_prop \l__fontspec_fontid_tl \l__fontspec_tmp_tl
+        {
+          \tl_gset_eq:NN \g__fontspec_nfss_family_tl \l__fontspec_tmp_tl
+          \prg_return_false:
+        }
+        {
+          \tl_set:Nx \l__fontspec_tmp_tl {#1}
+          \tl_remove_all:Nn \l__fontspec_tmp_tl { ~ }
+          \__fontspec_save_fontid_family:VV \l__fontspec_fontid_tl \l__fontspec_tmp_tl
+          \prg_return_true:
+        }
     }
-
-  \tl_if_exist:NT \l__fontspec_nfss_fam_tl
     {
-      \tl_set_eq:cN {g__fontspec_UID_\l__fontspec_fontid_tl} \l__fontspec_nfss_fam_tl
+      \tl_gset_eq:NN \g__fontspec_nfss_family_tl \l__fontspec_nfss_fam_tl
+      \cs_undefine:c { g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop }
+      \prg_return_true:
     }
-
-  \tl_if_empty:cT {g__fontspec_UID_\l__fontspec_fontid_tl}
-   {
-    % The font name is fully expanded, in case it's defined in terms of macros, before having its spaces zapped:
-    \tl_set:Nx \l__fontspec_tmp_tl {#1}
-    \tl_remove_all:Nn \l__fontspec_tmp_tl {~}
-
-    \cs_if_exist:cTF {g__fontspec_family_ \l__fontspec_tmp_tl _int}
-     { \int_gincr:c  {g__fontspec_family_ \l__fontspec_tmp_tl _int} }
-     { \int_new:c    {g__fontspec_family_ \l__fontspec_tmp_tl _int} }
-
-    \tl_gset:cx {g__fontspec_UID_\l__fontspec_fontid_tl}
-     {
-      \l__fontspec_tmp_tl ( \int_use:c {g__fontspec_family_ \l__fontspec_tmp_tl _int} )
-     }
-   }
-  \tl_gset:Nv \l_fontspec_family_tl {g__fontspec_UID_\l__fontspec_fontid_tl}
-  \cs_if_exist:cTF {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop}
-    \prg_return_false: \prg_return_true:
- }
+  }
+\cs_new:Nn \__fontspec_save_fontid_family:nn
+  {
+    \prop_get:NnNTF \g__fontspec_family_int_prop {#2} \l__fontspec_tmp_tl
+      {
+        \tl_set:Nx \l__fontspec_tmp_tl
+          { \int_eval:n { \l__fontspec_tmp_tl + 1 } }
+      }
+      { \tl_set:Nn \l__fontspec_tmp_tl { 0 } }
+    \prop_gput:NnV \g__fontspec_family_int_prop {#2} \l__fontspec_tmp_tl
+    \tl_gset:Nx \g__fontspec_nfss_family_tl { #2 ( \l__fontspec_tmp_tl ) }
+    \prop_gput:NnV \g__fontspec_fontid_family_prop {#1} \g__fontspec_nfss_family_tl
+  }
+\cs_generate_variant:Nn \__fontspec_save_fontid_family:nn { VV }
 \cs_new:Nn \__fontspec_save_family:nn
   {
     \__fontspec_save_fontinfo:n {#2}
     \__fontspec_find_autofonts:
-    \DeclareFontFamily{\l__fontspec_nfss_enc_tl}{\l_fontspec_family_tl}{}
+    \DeclareFontFamily{\g__fontspec_nfss_enc_tl}{\g__fontspec_nfss_family_tl}{}
     \__fontspec_set_faces:
     \__fontspec_info:nxx {defining-font} {#1} {#2}
   }
 \cs_new:Nn \__fontspec_save_fontinfo:n
  {
-  \prop_new:c    {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop}
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {fontname} { #1 }
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {options}  { \l__fontspec_all_features_clist }
-  \prop_gput:cnx {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {fontdef}
+  \prop_new:c    {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop}
+  \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {fontname} { #1 }
+  \prop_gput:cnx {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {options}  { \l__fontspec_all_features_clist }
+  \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 \l__fontspec_rawfeatures_sclist }
+      { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
    }
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {script-num} \l__fontspec_script_int
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {lang-num} \l__fontspec_language_int
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {script-tag} \l_fontspec_script_tl
-  \prop_gput:cnV {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
+  \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
+  \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {script-tag} \l_fontspec_script_tl
+  \prop_gput:cnV {g__fontspec_fontinfo_ \g__fontspec_nfss_family_tl _prop} {lang-tag} \l_fontspec_lang_tl
  }
 \cs_new:Nn \__fontspec_find_autofonts:
  {
@@ -1558,18 +1581,18 @@
 \cs_new:Nn \__fontspec_setup_nfss:Nnnn
  {
 
-  \__fontspec_get_features:Nn \l__fontspec_rawfeatures_sclist { #2 , #3 , #4 }
+  \__fontspec_get_features:n { #2 , #3 , #4 }
 
   \tl_put_right:Nx #1
    {
     <\l__fontspec_size_tl> \l__fontspec_scale_tl
       \__fontspec_construct_font_call:nn { \l_fontspec_fontname_tl }
-        { \l__fontspec_pre_feat_sclist \l__fontspec_rawfeatures_sclist }
+        { \l__fontspec_pre_feat_sclist \g__fontspec_rawfeatures_sclist }
    }
  }
 \cs_new:Nn \__fontspec_declare_shapes_normal:nn
   {
-    \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl} {\l_fontspec_family_tl}
+    \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl} {\g__fontspec_nfss_family_tl}
       {#1} {#2} {\l__fontspec_nfss_tl}{\l__fontspec_postadjust_tl}
   }
 \cs_new:Nn \__fontspec_declare_shapes_smcaps:nn
@@ -1576,7 +1599,7 @@
   {
     \tl_if_empty:NF \l__fontspec_nfss_sc_tl
      {
-      \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl} {\l_fontspec_family_tl} {#1}
+      \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl} {\g__fontspec_nfss_family_tl} {#1}
         { \__fontspec_combo_sc_shape:n {#2} } {\l__fontspec_nfss_sc_tl} {\l__fontspec_postadjust_tl}
      }
   }
@@ -1604,13 +1627,13 @@
     !(\str_if_eq_x_p:nn {\itdefault} {\sldefault})
    }
    {
-    \__fontspec_DeclareFontShape:xxxxxx {\l__fontspec_nfss_enc_tl}{\l_fontspec_family_tl}{#1}{\sldefault}
-      {<->ssub*\l_fontspec_family_tl/#1/\itdefault}{\l__fontspec_postadjust_tl}
+    \__fontspec_DeclareFontShape:xxxxxx {\g__fontspec_nfss_enc_tl}{\g__fontspec_nfss_family_tl}{#1}{\sldefault}
+      {<->ssub*\g__fontspec_nfss_family_tl/#1/\itdefault}{\l__fontspec_postadjust_tl}
    }
  }
 \cs_new:Nn \__fontspec_declare_shape_loginfo:nn
  {
-  \tl_gput_right:Nx \l_fontspec_defined_shapes_tl
+  \tl_gput_right:Nx \g__fontspec_defined_shapes_tl
    {
     \exp_not:n { \\ }
     -~ \exp_not:N \str_case:nn {#1/#2}
@@ -1671,7 +1694,7 @@
     \bool_if:NF \l__fontspec_firsttime_bool
       {
         \tl_gset:Nx \g__fontspec_single_feat_tl { #1 }
-        \tl_gput_right:Nx  \l__fontspec_rawfeatures_sclist {#1;}
+        \tl_gput_right:Nx  \g__fontspec_rawfeatures_sclist {#1;}
       }
   }
 \cs_new:Nn \__fontspec_remove_clashing_featstr:n
@@ -1678,7 +1701,7 @@
   {
     \clist_map_inline:nn {#1}
       {
-        \tl_gremove_all:Nn \l__fontspec_rawfeatures_sclist {##1;}
+        \tl_gremove_all:Nn \g__fontspec_rawfeatures_sclist {##1;}
       }
   }
 \cs_set:Npn \__fontspec_init:
@@ -1690,18 +1713,18 @@
   \tl_clear:N \l__fontspec_optical_size_tl
   \tl_clear:N \l__fontspec_ttc_index_tl
   \tl_clear:N \l_fontspec_renderer_tl
-  \tl_clear:N \l_fontspec_defined_shapes_tl
-  \tl_clear:N \g__fontspec_curr_series_tl
-  \tl_gset_eq:NN \l__fontspec_nfss_enc_tl \g_fontspec_encoding_tl
+  \tl_gclear:N \g__fontspec_defined_shapes_tl
+  \tl_gclear:N \g__fontspec_curr_series_tl
+  \tl_gset_eq:NN \g__fontspec_nfss_enc_tl \g_fontspec_encoding_tl
 
  }
 \cs_new:Nn \__fontspec_init_fontface:
   {
-    \tl_clear:N \l__fontspec_rawfeatures_sclist
+    \tl_gclear:N \g__fontspec_rawfeatures_sclist
     \tl_clear:N \l__fontspec_scale_tl
-    \tl_set_eq:NN \l__fontspec_opacity_tl \g__fontspec_opacity_tl
-    \tl_set_eq:NN \l__fontspec_hexcol_tl \g__fontspec_hexcol_tl
-    \tl_set_eq:NN \l__fontspec_postadjust_tl \g__fontspec_postadjust_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
+    \tl_set_eq:NN \l__fontspec_postadjust_tl \c__fontspec_postadjust_tl
     \tl_clear:N \l__fontspec_wordspace_adjust_tl
     \tl_clear:N \l__fontspec_punctspace_adjust_tl
   }
@@ -2057,7 +2080,7 @@
 
 %%^^A%%  fontspec-keyval.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
-\clist_set:Nn \g__fontspec_all_keyval_modules_clist
+\clist_gset:Nn \g__fontspec_all_keyval_modules_clist
   {
     fontspec, fontspec-opentype, fontspec-aat,
     fontspec-preparse, fontspec-preparse-cfg, fontspec-preparse-external, fontspec-preparse-nested,
@@ -2065,7 +2088,7 @@
   }
 \cs_new:Nn \__fontspec_keys_define_code:nnn
   {
-   \keys_define:nn {#1} { #2 .code:n = {#3} }
+    \keys_define:nn {#1} { #2 .code:n = {#3} }
   }
 \cs_new:Nn \__fontspec_aff_error:n
   {
@@ -2164,7 +2187,7 @@
     \seq_if_empty:NT \g__fontspec_bf_series_seq
      {
       \tl_gset:Nx \g__fontspec_curr_series_tl {\bfdefault}
-      \seq_put_right:Nx \g__fontspec_bf_series_seq {\bfdefault}
+      \seq_gput_right:Nx \g__fontspec_bf_series_seq {\bfdefault}
      }
     \tl_if_eq:oxT \g__fontspec_curr_series_tl {\bfdefault}
      { \tl_set_eq:NN \l__fontspec_fontname_bf_tl \l__fontspec_curr_bfname_tl }
@@ -2274,32 +2297,29 @@
  }
 \__fontspec_keys_define_code:nnn {fontspec-preparse} {NFSSEncoding}
  {
-  \tl_gset:Nx \l__fontspec_nfss_enc_tl { #1 }
+  \tl_gset:Nx \g__fontspec_nfss_enc_tl { #1 }
  }
 \__fontspec_keys_define_code:nnn {fontspec-preparse} {NFSSFamily}
  {
   \tl_set:Nx \l__fontspec_nfss_fam_tl { #1 }
-  \cs_undefine:c {g__fontspec_UID_\l__fontspec_fontid_tl}
-  \tl_if_exist:NT \l_fontspec_family_tl
-   { \cs_undefine:c {g__fontspec_fontinfo_ \l_fontspec_family_tl _prop} }
  }
 \__fontspec_keys_define_code:nnn {fontspec} {FontFace}
- {
-  \tl_set:No \l__fontspec_arg_tl { \use_iii:nnn #1 }
-  \tl_set_eq:NN \l__fontspec_this_feat_tl \l__fontspec_arg_tl
-  \tl_clear:N \l__fontspec_this_font_tl
-  \int_compare:nT { \clist_count:N \l__fontspec_arg_tl = 1 }
-   {
-    \tl_if_in:NnF \l__fontspec_arg_tl {=}
-     {
-      \tl_set_eq:NN \l__fontspec_this_font_tl \l__fontspec_arg_tl
-      \tl_clear:N \l__fontspec_this_feat_tl
-     }
-   }
+  {
+    \tl_clear:N \l__fontspec_this_font_tl
+    \clist_set:No \l__fontspec_arg_clist { \use_iii:nnn #1 }
+    \clist_set_eq:NN \l__fontspec_this_feat_clist \l__fontspec_arg_clist
+    \int_compare:nT { \clist_count:N \l__fontspec_arg_clist = 1 }
+      {
+        \tl_if_in:NnF \l__fontspec_arg_clist {=}
+          {
+            \tl_set_eq:NN \l__fontspec_this_font_tl \l__fontspec_arg_clist
+            \tl_clear:N \l__fontspec_this_feat_clist
+          }
+      }
 
-  \__fontspec_add_nfssfont:nnnn
-   {\use_i:nnn #1}{\use_ii:nnn #1}{\l__fontspec_this_font_tl}{\l__fontspec_this_feat_tl}
- }
+    \__fontspec_add_nfssfont:nnnn
+      {\use_i:nnn #1} {\use_ii:nnn #1} {\l__fontspec_this_font_tl} {\l__fontspec_this_feat_clist}
+  }
 \__fontspec_keys_define_code:nnn {fontspec} {Scale}
  {
   \str_case:nnF {#1}
@@ -2447,7 +2467,7 @@
 \cs_set:Npn \fontspec_parse_colour:viii #1#2#3#4#5#6#7#8
  {
   \tl_set:Nn \l__fontspec_hexcol_tl {#1#2#3#4#5#6}
-  \tl_if_eq:NNF \l__fontspec_opacity_tl \g__fontspec_opacity_tl
+  \tl_if_eq:NNF \l__fontspec_opacity_tl \c__fontspec_opacity_tl
    {
     \bool_if:NF \l__fontspec_firsttime_bool
      { \__fontspec_warning:nx {opa-twice-col} {#7#8} }
@@ -2459,7 +2479,7 @@
  {
   \int_set:Nn \l__fontspec_tmp_int {255}
   \__fontspec_int_mult_truncate:Nn \l__fontspec_tmp_int { #1 }
-  \tl_if_eq:NNF \l__fontspec_opacity_tl \g__fontspec_opacity_tl
+  \tl_if_eq:NNF \l__fontspec_opacity_tl \c__fontspec_opacity_tl
    {
     \bool_if:NF \l__fontspec_firsttime_bool
      { \__fontspec_warning:nx {opa-twice} {#1} }
@@ -3707,24 +3727,20 @@
 
 %%^^A%%  fontspec-math.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \@ifpackageloaded{euler}
- {
-  \bool_set_true:N \g__fontspec_pkg_euler_loaded_bool
- }
- {
-  \bool_set_false:N \g__fontspec_pkg_euler_loaded_bool
- }
+  { \bool_gset_true:N  \g__fontspec_pkg_euler_loaded_bool }
+  { \bool_gset_false:N \g__fontspec_pkg_euler_loaded_bool }
 \cs_new:Nn \fontspec_setup_maths:
  {
   \@ifpackageloaded{euler}
    {
     \bool_if:NTF \g__fontspec_pkg_euler_loaded_bool
-     { \bool_set_true:N \g__fontspec_math_euler_bool }
+     { \bool_gset_true:N \g__fontspec_math_euler_bool }
      { \__fontspec_error:n {euler-too-late} }
    }
    {}
-  \@ifpackageloaded{lucbmath}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
-  \@ifpackageloaded{lucidabr}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
-  \@ifpackageloaded{lucimatx}{\bool_set_true:N \g__fontspec_math_lucida_bool}{}
+  \@ifpackageloaded{lucbmath}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
+  \@ifpackageloaded{lucidabr}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
+  \@ifpackageloaded{lucimatx}{ \bool_gset_true:N \g__fontspec_math_lucida_bool }{}
   \DeclareSymbolFont{legacymaths}{OT1}{cmr}{m}{n}
   \SetSymbolFont{legacymaths}{bold}{OT1}{cmr}{bx}{n}
   \DeclareMathAccent{\acute}   {\mathalpha}{legacymaths}{19}
@@ -3806,34 +3822,34 @@
  {
   \@ifpackageloaded{anttor}
    {
-    \ifx\define at antt@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
+    \ifx\define at antt@mathversions a\bool_gset_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{arevmath}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{eulervm}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathdesign}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{concmath}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{cmbright}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathesf}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{gfsartemisia}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{gfsneohellenic}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{arevmath}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{eulervm}        {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathdesign}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{concmath}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{cmbright}       {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathesf}        {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{gfsartemisia}   {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{gfsneohellenic} {\bool_gset_false:N \g__fontspec_math_bool}{}
   \@ifpackageloaded{iwona}
    {
     \ifx\define at iwona@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{kpfonts}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{kmath}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{kpfonts}{\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{kmath}  {\bool_gset_false:N \g__fontspec_math_bool}{}
   \@ifpackageloaded{kurier}
    {
     \ifx\define at kurier@mathversions a\bool_set_false:N \g__fontspec_math_bool\fi
    }{}
-  \@ifpackageloaded{fouriernc}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{fourier}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{lmodern}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathpazo}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{mathptmx}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{MinionPro}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{unicode-math}{\bool_set_false:N \g__fontspec_math_bool}{}
-  \@ifpackageloaded{breqn}{\bool_set_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{fouriernc}    {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{fourier}      {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{lmodern}      {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathpazo}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{mathptmx}     {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{MinionPro}    {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{unicode-math} {\bool_gset_false:N \g__fontspec_math_bool}{}
+  \@ifpackageloaded{breqn}        {\bool_gset_false:N \g__fontspec_math_bool}{}
   \bool_if:NT \g__fontspec_math_bool
    {
     \__fontspec_info:n {setup-math}
@@ -3910,15 +3926,15 @@
  }
 \cs_new_protected:Npn \emfontdeclare #1
   {
-    \prop_clear:N    \g__fontspec_em_prop
-    \int_zero:N      \l__fontspec_emdef_int
-    \bool_set_true:N \g__fontspec_em_normalise_slant_bool
+    \prop_gclear:N    \g__fontspec_em_prop
+    \int_zero:N       \l__fontspec_emdef_int
+    \bool_gset_true:N \g__fontspec_em_normalise_slant_bool
 
     \tl_if_in:nnT {#1} {\slshape}
       {
         \tl_if_in:nnT {#1} {\itshape}
           {
-            \bool_set_false:N \g__fontspec_em_normalise_slant_bool
+            \bool_gset_false:N \g__fontspec_em_normalise_slant_bool
           }
       }
 
@@ -3964,7 +3980,7 @@
 \cs_set:Npn \eminnershape { \upshape }
 \cs_new_protected:Npn \strongfontdeclare #1
   {
-    \prop_clear:N    \g__fontspec_strong_prop
+    \prop_gclear:N   \g__fontspec_strong_prop
     \int_zero:N      \l__fontspec_strongdef_int
 
     \group_begin:

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.cfg	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.cfg	2018-07-29 21:15:34 UTC (rev 48307)
@@ -11,7 +11,6 @@
 % Make a copy of this file in your own home TEXMF directory to set up your own
 % defaults.
 
-
 \defaultfontfeatures
  [\rmfamily,\sffamily]
  {Ligatures=TeX}

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2018-07-29 21:15:34 UTC (rev 48307)
@@ -17,6 +17,7 @@
 --  (your choice): <http://www.latex-project.org/lppl/>.
 --  ------------------------------------------------
 -- ^^A%%  fontspec.dtx -- part of FONTSPEC <wspr.io/fontspec>
+-- ^^A%%  Metadata for the package, including files and versioning
 
 fontspec          = fontspec or {}
 local fontspec    = fontspec
@@ -73,10 +74,10 @@
 function fontspec.mathfontdimen(fnt, str)
     local mathdimens = luaotfload.aux.get_math_dimension(fnt, str)
     if mathdimens then
-        tex.sprint(mathdimens)
-        tex.sprint("sp")
+        tex.sprint(-2,mathdimens)
+        tex.sprint(-2,"sp")
     else
-        tex.sprint("0pt")
+        tex.sprint(-2,"0pt")
     end
 end
 

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2018-07-29 21:15:15 UTC (rev 48306)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2018-07-29 21:15:34 UTC (rev 48307)
@@ -17,10 +17,11 @@
 %% (your choice): <http://www.latex-project.org/lppl/>.
 %% ------------------------------------------------
 %%^^A%%  fontspec.dtx -- part of FONTSPEC <wspr.io/fontspec>
+%%^^A%%  Metadata for the package, including files and versioning
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec}%
-  {2017/11/09}{2.6g}{Font selection for XeLaTeX and LuaLaTeX}
+  {2018/07/29}{v2.6h}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \sys_if_engine_luatex:T



More information about the tex-live-commits mailing list