texlive[49816] Master/texmf-dist: fontspec (25jan19)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 25 22:39:17 CET 2019


Revision: 49816
          http://tug.org/svn/texlive?view=revision&revision=49816
Author:   karl
Date:     2019-01-25 22:39:16 +0100 (Fri, 25 Jan 2019)
Log Message:
-----------
fontspec (25jan19)

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-code-feat-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
    trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-patches.dtx
    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.dtx
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
    trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty

Modified: trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/doc/latex/fontspec/CHANGES.md	2019-01-25 21:39:16 UTC (rev 49816)
@@ -1,6 +1,16 @@
 Change history
 ==============
 
+## v2.7a (2019/01/25)
+
+    * One last (?!) fix for recent regression (!!). I am not getting enough sleep at the moment and it is too hot.
+    * Add `LocalForms=On/Off/Reset` to control the `locl` OpenType tag.
+    * Reorganise some documentation.
+    * Remove redundant redefinition of `\-` which is nowadays defined correctly by the LaTeX2e kernel.
+    * Add code to remove the patching of verbatim commands and environments when the new
+      `\verbvisiblespace` command is defined in a future version of LaTeX2e.
+
+
 ## v2.7 (2019/01/24)
 
     * Add new `ScaleAgain` feature for compounding scale factors.

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

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

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -203,6 +203,13 @@
 \@@_define_opentype_onoffreset:nnnnn {Fractions} {Alternate} {afrc} {afrc} {-frac}
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\@@_define_opentype_feature_group:n  {LocalForms}
+\@@_define_opentype_feature:nnnnn    {LocalForms} {On}    {locl} {+locl} {}
+\@@_define_opentype_feature:nnnnn    {LocalForms} {Off}   {locl} {-locl} {}
+\@@_define_opentype_feature:nnnnn    {LocalForms} {Reset} {} {}  {+locl,-locl}
+%    \end{macrocode}
+%
 
 % \subsection{Style}
 %    \begin{macrocode}
@@ -449,12 +456,14 @@
                 \clist_map_break:
               }
           }
+
         \bool_if:NF \l_@@_scriptlang_exist_bool
           {
+%<debug>\typeout{Script~not~found!}
             \bool_if:nF { \str_if_eq_p:ee {#1} {CustomDefault} }
               {
                 \tl_clear:N \l_@@_script_name_tl
-                \@@_warning:nx {no-script} {\l_fontspec_fontname_tl} {#1}
+                \@@_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1}
               }
 
             \bool_if:nF

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-keyval.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -611,7 +611,7 @@
             \tl_put_right:Nn \l_@@_postadjust_tl
               { \@@_primitive_font_set_hyphenchar:Nn \font { \l_@@_hyphenchar_tl } }
           }
-          { \@@_error:nx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
+          { \@@_error:nxx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
 
       }
   }
@@ -728,7 +728,7 @@
     \bool_if:nT { !\l_@@_ot_bool && !\l_@@_mm_bool }
       {
         \bool_if:NT \l_@@_firsttime_bool
-        { \@@_warning:n {no-opticals} {\l_fontspec_fontname_tl} }
+        { \@@_warning:nx {no-opticals} {\l_fontspec_fontname_tl} }
       }
   }
 %</XE>

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-load.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -20,17 +20,17 @@
 \sys_if_engine_luatex:T
   {
     \RequirePackage{luaotfload}
-    \directlua{require("fontspec")}
+    \lua_now:e{require("fontspec")}
     \RequirePackageWithOptions{fontspec-luatex}
     \endinput
   }
 %    \end{macrocode}
-% 
+%
 % \paragraph{\XeLaTeX}
 %    \begin{macrocode}
 \sys_if_engine_xetex:T
-  { 
-    \RequirePackageWithOptions{fontspec-xetex} 
+  {
+    \RequirePackageWithOptions{fontspec-xetex}
     \endinput
   }
 %    \end{macrocode}
@@ -46,7 +46,7 @@
   }
 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
 %    \end{macrocode}
-% 
+%
 % \paragraph{Closing}
 % That's the end of the \texttt{fontspec.sty} file.
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opening.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -145,8 +145,25 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_lua_function:ne}
+% \begin{macro}{\@@_lua_function:nee}
+% \begin{macro}{\@@_lua_function:neee}
+% \begin{macro}{\@@_lua_function:neeee}
+%    \begin{macrocode}
+%<*LU>
+\cs_set:Npn \@@_lua_function:ne    #1#2       { \lua_now:e { fontspec.#1 ("#2")                } }
+\cs_set:Npn \@@_lua_function:nee   #1#2#3     { \lua_now:e { fontspec.#1 ("#2","#3")           } }
+\cs_set:Npn \@@_lua_function:neee  #1#2#3#4   { \lua_now:e { fontspec.#1 ("#2","#3","#4")      } }
+\cs_set:Npn \@@_lua_function:neeee #1#2#3#4#5 { \lua_now:e { fontspec.#1 ("#2","#3","#4","#5") } }
+%</LU>
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %
+%
 % \subsection{\pkg{expl3} variants}
 %
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -181,7 +181,7 @@
           { \tl_set:Nx \l_@@_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l_@@_tmp_tl {\cs_to_str:N #1} }
 %<debug>\typeout{::::~ checking:~"\l_@@_tmp_tl",~ "#2"}
-        \directlua{fontspec.check_ot_script("\l_@@_tmp_tl", "#2")}
+        \lua_now:e { fontspec.check_ot_script("\l_@@_tmp_tl", "#2") }
         \bool_if:NTF \l__fontspec_check_bool
           {
 %<debug>\typeout{::::::~ TRUE}
@@ -251,10 +251,7 @@
         \cs_if_eq:NNTF #1 \font
           { \tl_set:Nx \l_@@_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l_@@_tmp_tl {\cs_to_str:N #1} }
-        \directlua
-          {
-            fontspec.check_ot_lang( "\l_@@_tmp_tl", "#2", "#3" )
-          }
+        \@@_lua_function:neee {check_ot_lang} {\l_@@_tmp_tl} {#2} {#3}
         \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false:
 %</LU>
       }
@@ -323,10 +320,7 @@
         \cs_if_eq:NNTF #1 \font
           { \tl_set:Nx \l_@@_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l_@@_tmp_tl {\cs_to_str:N #1} }
-        \directlua
-          {
-            fontspec.check_ot_feat("\l_@@_tmp_tl", "#2", "#3", "#4")
-          }
+        \@@_lua_function:neeee {check_ot_feat} {\l_@@_tmp_tl} {#2} {#3} {#4}
         \bool_if:NTF \l_@@_check_bool \prg_return_true: \prg_return_false:
 %</LU>
       }

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-patches.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-patches.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-code-patches.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -6,27 +6,7 @@
 %<*fontspec>
 %    \end{macrocode}
 %
-% \subsection{\cmd\-}
 %
-% \begin{macro}{\-}
-% This macro is courtesy of Frank Mittelbach and the \LaTeXe\ source code.
-%    \begin{macrocode}
-\DeclareRobustCommand{\-}
-  {
-    \discretionary
-      {
-        \char\ifnum\hyphenchar\font<\z@
-              \xlx at defaulthyphenchar
-            \else
-              \hyphenchar\font
-            \fi
-      }{}{}
-  }
-\def\xlx at defaulthyphenchar{`\-}
-%    \end{macrocode}
-% \end{macro}
-%
-%
 % \subsection{Verbatims}
 %
 % Many thanks to Apostolos Syropoulos for discovering this problem and writing the  redefinion of \LaTeX's |verbatim| environment and \cs{verb*} command.
@@ -34,7 +14,7 @@
 % \begin{macro}{\fontspec_visible_space:}
 % Print \unichar{2423}{Open box}, which is used to visibly display a space character.
 %    \begin{macrocode}
-\cs_new:Nn \fontspec_visible_space:
+\cs_new_protected:Nn \fontspec_visible_space:
   {
     \@@_primitive_font_glyph_if_exist:NnTF \font {"2423}
       { \char"2423\scan_stop: }
@@ -46,7 +26,7 @@
 % \begin{macro}{\fontspec_visible_space_fallback:}
 % If the current font doesn't have \unichar{2423}{Open box}, use Latin Modern Mono instead.
 %    \begin{macrocode}
-\cs_new:Nn \fontspec_visible_space_fallback:
+\cs_new_protected:Nn \fontspec_visible_space_fallback:
   {
     {
       \usefont{\g_fontspec_encoding_tl}{lmtt}{\f at series}{\f at shape}
@@ -69,38 +49,50 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% In 2019 there will be a new kernel-supported command for generalising `verbatim visible spaces'.
+% For now we check if the new command is defined and disable all patching if so.
+% In 2020, I suppose, I'll remove all the patching code here.
+%
+%    \begin{macrocode}
+\AtBeginDocument
+  {
+    \cs_if_exist:NF \verbvisiblespace
+      {
+				\@@_patch_verb:
+				\@@_patch_verbatim:
+				\@@_patch_moreverb:
+				\@@_patch_fancyvrb:
+				\@@_patch_listings:
+			}
+  }
+%    \end{macrocode}
+%
+%
 % \begin{macro}{\verb}
 % \begin{macro}{\verb*}
 % Redefine \cmd\verb\ to use \cmd\fontspec_print_visible_spaces:.
 %    \begin{macrocode}
-\def\verb
+\cs_new_protected:Npn \@@_patch_verb:
   {
-    \relax\ifmmode\hbox\else\leavevmode\null\fi
-    \bgroup
-      \verb at eol@error \let\do\@makeother \dospecials
-      \verbatim at font\@noligs
-      \@ifstar\@@sverb\@verb
-  }
-\def\@@sverb{\fontspec_print_visible_spaces:\@sverb}
+		\def\verb
+			{
+				\relax\ifmmode\hbox\else\leavevmode\null\fi
+				\bgroup
+					\verb at eol@error \let\do\@makeother \dospecials
+					\verbatim at font\@noligs
+					\@ifstar\@@sverb\@verb
+			}
+		\def\@@sverb{\fontspec_print_visible_spaces:\@sverb}
+	}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
-% It's better to put small things into \cmd\AtBeginDocument, so here we go:
-%    \begin{macrocode}
-\AtBeginDocument
-  {
-    \fontspec_patch_verbatim:
-    \fontspec_patch_moreverb:
-    \fontspec_patch_fancyvrb:
-    \fontspec_patch_listings:
-  }
-%    \end{macrocode}
 %
 % \begin{environment}{verbatim*}
 % With the \pkg{verbatim} package.
 %    \begin{macrocode}
-\cs_set:Npn \fontspec_patch_verbatim:
+\cs_new_protected:Npn \@@_patch_verbatim:
   {
     \@ifpackageloaded{verbatim}
       {
@@ -126,7 +118,7 @@
 % This is for \pkg{moreverb}.
 % The main |listing*| environment inherits this definition.
 %    \begin{macrocode}
-\cs_set:Npn \fontspec_patch_moreverb:
+\cs_new_protected:Npn \@@_patch_moreverb:
   {
     \@ifpackageloaded{moreverb}
       {
@@ -146,7 +138,7 @@
 %
 % \pkg{listings} and \pkg{fancvrb} make things nice and easy:
 %    \begin{macrocode}
-\cs_set:Npn \fontspec_patch_fancyvrb:
+\cs_new_protected:Npn \@@_patch_fancyvrb:
   {
     \@ifpackageloaded{fancyvrb}
       {
@@ -156,7 +148,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_set:Npn \fontspec_patch_listings:
+\cs_new_protected:Npn \@@_patch_listings:
   {
     \@ifpackageloaded{listings}
       {

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-intro.tex	2019-01-25 21:39:16 UTC (rev 49816)
@@ -143,17 +143,12 @@
 
 In the case that the typewriter font does not contain `\verb*| |', the Latin Modern Mono font is used as a fallback.
 
+In 2019, \LaTeX\ will use a new command \cs{verbvisiblespace} for internal commands and for
+third party packages. If this new command is defined, \pkg{fontspec}'s patching code here
+will be entirely disabled and the packages listed above should no longer rely on \pkg{fontspec}
+to redefine their internals.
 
-\subsection{Discretionary hyphenation: \cmd\-}
-\label{sec:hyphen}
 
-\DescribeMacro{\-}
-\LaTeX\ defines the macro \cmd\-\ to insert discretionary hyphenation points.
-However, it is hard-coded in \LaTeX\ to use the hyphen |-| character.
-Since \pkg{fontspec} provides features to change the hyphenation character on
-a per font basis, the definition of \cmd\-\ is changed to adapt accordingly.
-
-
 \subsection{Commands for old-style and lining numbers}
 
 \DescribeMacro{\oldstylenums}

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-luatex.tex	2019-01-25 21:39:16 UTC (rev 49816)
@@ -10,10 +10,12 @@
 
 \section{Custom font features}
 
-Pre-2016, it was possible to load an OpenType font feature file to define new OpenType features for a selected font. This facility was particularly useful to implement custom substitutions, for example.  As of \TeX{}Live~2016, \LuaTeX/\pkg{luaotfload} no longer supports this feature, but provides its own internal mechanisms for an equivalent interface.
+\LuaTeX, via the \pkg{luaotfload} package, allows the definition and re-definition of custom OpenType features for a selected font. This facility is particularly useful to implement custom substitutions or to disable unwanted but not all ligatures.
+Figure~\ref{fig:featurefile} shows an minimal example of this type of functionality.
 
-Any documents using `feature file' options will need to transition to the new interface.
-Figure~\ref{fig:featurefile} shows an example.
+A third-party collection of additional examples are maintained in the repository `\texttt{fonts-in-luatex}'\footnote{\url{https://github.com/mewtant/fonts-in-luatex}}.
+These examples are intended to correct or adjust font features in a range of commercial fonts and provide a good introduction to some of the possibilities that \LuaTeX\ affords.
+
 Please refer to the \LuaTeX/\pkg{luaotfload} documentation for more details.
 
 \begin{figure}

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex	2019-01-25 21:39:16 UTC (rev 49816)
@@ -160,635 +160,9 @@
 zero	Slashed Zero
 \end{Verbatim}
 
-\section{OpenType font features}
-\label{sec:ot-feat}
 
-There are a finite set of OpenType font features, and \pkg{fontspec} provides an
-interface to around half of them.
-Full documentation will be presented in the following sections, including how to
-enable and disable individual features, and how they interact.
+\section{OpenType scripts and languages}\label{sec:ot}
 
-A brief reference is provided (\vref*{tab:all-ot}) but note that this is an incomplete
-listing --- only the `enable' keys are shown, and where alternative interfaces are
-provided for convenience only the first is shown.
-(E.g., |Numbers=OldStyle| is the same as |Numbers=Lowercase|.)
-
-For completeness, the complete list of OpenType features \emph{not} provided with
-a \pkg{fontspec} interface is shown in \vref{tab:none-ot}.
-Features omitted are partially by design and partially by oversight;
-for example, the |aalt| feature is largely useless in \TeX\ since it is designed
-for providing a textsc{gui} interface for selecting `all alternates' of a glyph.
-Others, such as optical bounds for example, simply haven't yet been considered
-due to a lack of fonts available for testing.
-Suggestions welcome for how/where to add these missing features to the package.
-
-\ExplSyntaxOn
-\def\allOTfeat{
-  \prop_map_inline:Nn \g__fontspec_all_opentype_feature_names_prop
-    { \opentypefeature{##1}{##2} }
-}
-\newcommand\opentypefeature[2]{
-  \prop_get:NnNT \g__fontspec_OT_features_prop {#1} \tmpa
-      {
-        \raggedright
-        \hangindent=5.2cm
-        \makebox[1cm][l]{\textsc{#1}}
-        \makebox[4.2cm][l]{
-          \int_compare:nT { \tl_count:N \tmpa > 25 } {\ttcondensed} {\ttfamily}
-          \tmpa
-        }
-        \textit{#2}
-        \par
-        \vspace{2pt}
-     }
-}
-\ExplSyntaxOff
-
-\begin{table}
-\caption{Summary of OpenType features in \textsf{fontspec}, alphabetic by feature tag.}
-\label{tab:all-ot}
-\centerline{%
-\begin{minipage}{18cm}
-\small
-\hrule\smallskip
-\begin{multicols}{2}
-\parindent =0pt
-\allOTfeat
-\end{multicols}
-\vspace*{-\smallskipamount}
-\hrule
-\end{minipage}}
-\end{table}
-
-\ExplSyntaxOn
-\renewcommand\opentypefeature[2]{
-  \prop_get:NnNF \g__fontspec_OT_features_prop {#1} \tmpa
-      {
-        \raggedright
-        \hangindent=0.9cm
-        \makebox[0.9cm][l]{\textsc{#1}}%
-        \textit{#2}
-        \par
-     }
-}
-\ExplSyntaxOff
-
-\begin{table}
-\caption{List of \emph{unsupported} OpenType features.}
-\label{tab:none-ot}
-\bigskip
-\centerline{%
-\begin{minipage}{15cm}
-\hrule\smallskip
-\begin{multicols}{3}
-\parindent =0pt
-\allOTfeat
-\end{multicols}
-\vspace*{-\smallskipamount}
-\hrule
-\end{minipage}}
-\end{table}
-
-\subsection{Tag-based features}
-
-\subsubsection{Ligatures}
-\label{sec:ot-feat-liga}
-
-\feat{Ligatures} refer to the replacement of two separate characters
-with a specially drawn glyph for functional or \ae sthetic reasons.
-The list of options, of which multiple may be selected at one time,
-is shown in \ref{feat:Ligatures}.
-A demonstration with the Linux Libertine fonts\note{\url{http://www.linuxlibertine.org/}} is shown in \exref{lig}.
-
-Note the additional features accessed with \verb|Ligatures=TeX|. These are
-not actually real OpenType features, but additions provided by \pkg{luaotfload} (i.e., \LuaTeX\ only) to emulate \TeX's behaviour for \textsc{ascii} input of curly quotes and punctuation. In \XeTeX\ this is achieved with the \feat{Mapping} feature (see \vref{sec:mapping}) but for consistency \verb|Ligatures=TeX| will perform the same function as \verb|Mapping=tex-text|.
-
-\subsection{Letters} \label{sec:letters}
-The \opt{Letters} feature specifies how the letters in the current font
-will look. OpenType fonts may contain the following options:
-\opt{Uppercase}, \opt{SmallCaps}, \opt{PetiteCaps},
-\opt{UppercaseSmallCaps}, \opt{UppercasePetiteCaps}, and
-\opt{Unicase}.
-
-
-\begin{features}{Ligatures}
-\otf*{Required}{rlig}
-\otf*{Common}{liga}
-\otf*{Contextual}{clig}
-\otf*{Rare/Discretionary}{dlig}
-\otf*{Historic}{hlig}
-\otf*{TeX}{tlig}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-\begin{Lexample}[firstline=2]{lig}{An example of the \feat{Ligatures} feature.}
-   \Huge\centering
-   \def\test#1#2{%
-     #2 $\to$ {\addfontfeature{#1} #2}\\}
-   \fontspec{LinLibertine_R.otf}
-   \test{Ligatures=Historic}{strict}
-   \test{Ligatures=Rare}{wurtzite}
-   \test{Ligatures=NoCommon}{firefly}
-\end{Lexample}
-
-\begin{features}{Letters}
-\otf*{Uppercase}{case}
-\otf*{SmallCaps}{smcp}
-\otf*{PetiteCaps}{pcap}
-\otf*{UppercaseSmallCaps}{c2sc}
-\otf*{UppercasePetiteCaps}{c2pc}
-\otf*{Unicase}{unic}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-Petite caps are smaller than small caps.
-\opt{SmallCaps} and \opt{PetiteCaps}
-turn lowercase letters into the smaller caps letters,
-whereas the \opt{Uppercase...} options turn the \emph{capital} letters into
-the smaller
-caps (good, \eg, for applying to already uppercase acronyms like
-`NASA').
-This difference is shown in \exref{caps}.
-`Unicase' is a weird hybrid of upper and lower case letters.
-
-\begin{Lexample}{caps}{Small caps from lowercase or uppercase letters.}
-  \fontspec{texgyreadventor-regular.otf}[Letters=SmallCaps]
-   THIS SENTENCE no verb                \\
-  \fontspec{texgyreadventor-regular.otf}[Letters=UppercaseSmallCaps]
-   THIS SENTENCE no verb
-\end{Lexample}
-
-Note that the \opt{Uppercase} option will (probably)
-not actually map letters to uppercase.
- \note{If you want automatic uppercase letters, look to \LaTeX's
-      \cmd\MakeUppercase\ command.}
-It is designed to select various
-uppercase forms for glyphs such as accents and dashes, such as shown
-in \exref{letters-uppercase}; note the raised position of the hyphen
-to better match the surrounding letters.
-
-\begin{Lexample}{letters-uppercase}{An example of the \opt{Uppercase} option of the \feat{Letters} feature.}
-  \fontspec{LinLibertine_R.otf}
-   UPPER-CASE example \\
-  \addfontfeature{Letters=Uppercase}
-   UPPER-CASE example
-\end{Lexample}
-
-The \feat{Kerning} feature also contains an \opt{Uppercase} option,
-which adds a small amount of spacing in between letters (see \vref{sec:kerning}).
-
-\subsubsection{Numbers}
-
-The \feat{Numbers} feature defines how numbers will look in the
-selected font, accepting options shown in \ref{feat:Numbers}.
-
-\begin{features}{Numbers}
-\otf*{Uppercase}{lnum}
-\otf*{Lowercase}{onum}
-\otf*{Lining}{lnum}
-\otf*{OldStyle}{onum}
-\otf*{Proportional}{pnum}
-\otf*{Monospaced}{tnum}
-\otf*{SlashedZero}{zero}
-\otf*{Arabic}{anum}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-The synonyms
-\opt{Uppercase} and \opt{Lowercase} are equivalent to \opt{Lining} and
-\opt{OldStyle}, respectively.
-The differences have been shown previously
-in \vref{sec:addfontfeatures}.
-The \opt{Monospaced} option is useful for tabular material when digits need
-to be vertically aligned.
-
-The \opt{SlashedZero} option
-replaces the default zero with a slashed version to prevent
-confusion with an uppercase `O', shown in \exref{slashzero}.
-
-\begin{Lexample}{slashzero}{The effect of the \opt{SlashedZero} option.}
-  \fontspec[Numbers=Lining]{texgyrebonum-regular.otf}
-   0123456789
-  \fontspec[Numbers=SlashedZero]{texgyrebonum-regular.otf}
-   0123456789
-\end{Lexample}
-
-The \opt{Arabic} option (with tag \verb|anum|) maps regular numerals to their Arabic script or Persian equivalents
-based on the current \opt{Language} setting (see \vref{sec:ot}).
-This option is based on a \LuaTeX\ feature of the \pkg{luaotfload} package,
-not an OpenType feature. (Thus, this feature is unavailable in \XeTeX.)
-
-\subsubsection{Contextuals}
-This feature refers to substitutions of glyphs that vary `contextually' by their relative position in a word or string of characters;
-features such as contextual swashes are accessed via the options shown in \ref{feat:Contextuals}.
-
-\begin{features}{Contextuals}
-\otf*{Swash}{cswh}
-\otf*{Alternate}{calt}
-\otf*{WordInitial}{init}
-\otf*{WordFinal}{fina}
-\otf*{LineFinal}{falt}
-\otf*{Inner}{medi}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-Historic forms are accessed in OpenType
-fonts via the feature \feat{Style=Historic}; this is generally \emph{not}
-contextual in OpenType, which is why it is not included in this feature.
-
-\subsubsection{Vertical Position}
-
-\begin{features}{VerticalPosition}
-\otf*{Superior}{sups}
-\otf*{Inferior}{subs}
-\otf*{Numerator}{numr}
-\otf*{Denominator}{dnom}
-\otf*{ScientificInferior}{sinf}
-\otf*{Ordinal}{ordn}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-The \feat{VerticalPosition} feature is used to access things like
-subscript (\opt{Inferior}) and superscript (\opt{Superior}) numbers and
-letters (and a small amount of punctuation, sometimes).
-The \opt{Ordinal} option will only raise characters that are used
-in some languages directly after a number.
-The \opt{ScientificInferior} feature will move glyphs
-further below the baseline than the \opt{Inferior} feature.
-These are shown in \exref{vertpos}
-
-\opt{Numerator} and \opt{Denominator} should only be used for creating
-arbitrary fractions (see next section).
-
-\begin{Lexample}{vertpos}{The \feat{VerticalPosition} feature.}
-  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Superior]
-   Superior: 1234567890                                   \\
-  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Numerator]
-   Numerator: 12345                                       \\
-  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Denominator]
-   Denominator: 12345                                     \\
-  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=ScientificInferior]
-   Scientific Inferior: 12345
-\end{Lexample}
-
-The \pkg{realscripts} package
-(which is also loaded by \pkg{xltxtra} for \XeTeX)
-redefines the \cmd\textsubscript\ and
-\cmd\textsuperscript\ commands to use the above font features automatically,
-including for use in footnote labels.
-If this is the only feature of \pkg{xltxtra} you wish to use, consider
-loading \pkg{realscripts} on its own instead.
-
-
-\subsubsection{Fractions}
-
-\begin{features}{Fractions}
-\otf{On}{+frac}
-\otf{Off}{-frac}
-\otf{Reset}{}
-\cmidrule{2-4}
-\otf*{Alternate}{afrc}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-For OpenType fonts use a regular text slash to create fractions, but
-the \feat{Fraction} feature must be explicitly activated.
-Some (Asian fonts predominantly) also provide for the
-\opt{Alternate} feature. These are both shown in \exref{ot-frac}.
-
-\begin{Xexample}{ot-frac}{The \feat{Fractions} feature.}
-  \fontspec{Hiragino Maru Gothic Pro W4}
-   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
-  \addfontfeature{Fractions=On}
-   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
-  \addfontfeature{Fractions=Alternate}
-   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
-\end{Xexample}
-
-\subsection{Style}
-\label{sec:ot-feat-style}
-
-\begin{features}{Style}
-\otf*{Alternate}{salt}
-\otf*{Italic}{ital}
-\otf*{Ruby}{ruby}
-\otf*{Swash}{swsh}
-\otf*{Cursive}{curs}
-\otf*{Historic}{hist}
-\otf*{TitlingCaps}{titl}
-\otf*{HorizontalKana}{hkna}
-\otf*{VerticalKana}{vkna}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-`Ruby' refers to a small optical size, used in
-Japanese typography for annotations.
-For fonts with multiple |salt| OpenType features,
-use the fontspec \feat{Alternate} feature instead.
-
-\Exref{style-alt} shows an example of a font feature that involves glyph substitution
-for particular letters within an alphabet.
-Other options in these categories operate in similar ways, with the choice of how
-particular substitutions are organised with which feature largely up to the font designer.
-
- \begin{Xexample}[firstline=2]{style-alt}{Example of the \opt{Alternate} option of the \feat{Style} feature.}
-  \Large
-  \fontspec{Quattrocento.otf}
-   M Q W                      \\
-  \addfontfeature{Style=Alternate}
-   M Q W
-\end{Xexample}
-
-In other features, larger breadths of changes can be seen, covering
-the style of an entire alphabet.
-See \exref{style-itrub}; here, the \opt{Italic} option affects the Latin text
-and the \opt{Ruby} option the Japanese.
-
-\begin{Xexample}[firstline=2]{style-itrub}{Example of the \opt{Italic} and \opt{Ruby} options of the \feat{Style} feature.}
-  \Large \def\kana{ようこそ ワカヨタレソ}
-  \fontspec{Hiragino Mincho Pro}
-   Latin \kana        \\
-  \addfontfeature{Style={Italic, Ruby}}
-   Latin \kana
-\end{Xexample}
-
-Note the difference here between the default and the horizontal style kana
-in \exref{style-hvkana}: the horizontal style is slightly wider.
-
-\begin{Xexample}[firstline=2]{style-hvkana}{Example of the \opt{HorizontalKana} and \opt{VerticalKana} options of the \feat{Style} feature.}
-  \Large \def\kana{ようこそ ワカヨタレソ}
-   \fontspec{Hiragino Mincho Pro}
-    \kana   \\
-  {\addfontfeature{Style=HorizontalKana}
-    \kana } \\
-  {\addfontfeature{Style=VerticalKana}
-    \kana }
-\end{Xexample}
-
-\subsection{Diacritics}
-
-Specifies how combining diacritics should be placed.
-These will usually be controlled automatically
-according to the Script setting.
-
-\begin{features}{Diacritics}
-\otf*{MarkToBase}{mark}
-\otf*{MarkToMark}{mkmk}
-\otf*{AboveBase}{abvm}
-\otf*{BelowBase}{blwm}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-\subsection{Kerning}\label{sec:kerning}
-Specifies how inter-glyph spacing should behave.
-Well-made fonts include information for how differing
-amounts of space should be inserted between separate character pairs.
-This kerning space is inserted automatically but in rare
-circumstances you may wish to turn it off.
-
-\begin{features}{Kerning}
-\otf{On}{+kern}
-\otf{Off}{-kern}
-\otf{Reset}{}
-\cmidrule{2-4}
-\otf*{Uppercase}{cpsp}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-As briefly mentioned previously at the end of \vref{sec:letters},
-the \opt{Uppercase} option will add a small amount of tracking between
-uppercase letters, seen in \exref{kernup}, which uses the Romande
-fonts\note{\url{http://arkandis.tuxfamily.org/adffonts.html}}
-(thanks to Clea F. Rees for the suggestion).
-The \opt{Uppercase} option acts separately to the regular kerning
-controlled by the \opt{On}/\opt{Off} options.
-
-\begin{Xexample}[firstline=2]{kernup}{Adding extra kerning for uppercase letters. (The difference is usually very small.)}
-  \large
-  \fontspec{RomandeADFStd-DemiBold.otf}
-   UPPERCASE EXAMPLE \\
-  \addfontfeature{Kerning=Uppercase}
-   UPPERCASE EXAMPLE
-\end{Xexample}
-
-
-\subsection{Character width}\label{sec:CharacterWidth}
-Many Asian fonts are equipped with variously spaced characters for
-shoe-horning into their generally monospaced text.
-These are
-accessed through the \feat{CharacterWidth} feature.
-
-\begin{features}{CharacterWidth}
-\otf*{Proportional}{pwid}
-\otf*{Full}        {fwid}
-\otf*{Half}        {hwid}
-\otf*{Third}       {twid}
-\otf*{Quarter}     {qwid}
-\otf*{AlternateProportional}{palt}
-\otf*{AlternateHalf}{halt}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-Japanese alphabetic glyphs (in Hiragana or Katakana) may be typeset
-proportionally, to better fit horizontal measures, or monospaced, to
-fit into the rigid grid imposed by ideographic typesetting. In this
-latter case, there are also half-width forms for squeezing more kana
-glyphs (which are less complex than the kanji they are amongst) into
-a given block of space. The same features are given to roman letters
-in Japanese fonts, for typesetting foreign words in the same style
-as the surrounding text.
-
-\begin{Xexample}[firstline=2]{charwdprop}{Proportional or fixed width forms.}
-  \def\texta{ようこそ}\def\textb{ワカヨタレソ}
-  \def\test{\makebox[2cm][l]{\texta}%
-            \makebox[2.5cm][l]{\textb}%
-            \makebox[2.5cm][l]{abcdef}}
-  \fontspec{Hiragino Mincho Pro}
-  {\addfontfeature{CharacterWidth=Proportional}\test}\\
-  {\addfontfeature{CharacterWidth=Full}\test}\\
-  {\addfontfeature{CharacterWidth=Half}\test}
-\end{Xexample}
-
-The same situation occurs with numbers, which are provided in
-increasingly illegible compressed forms seen in \exref{charwd}.
-
-\begin{Xexample}[firstline=2]{charwd}{Numbers can be compressed significantly.}
-  \centering
-  \fontspec[Renderer=AAT]{Hiragino Mincho Pro}
-  {\addfontfeature{CharacterWidth=Full}
-   ---12321---}\\
-  {\addfontfeature{CharacterWidth=Half}
-   ---1234554321---}\\
-  {\addfontfeature{CharacterWidth=Third}
-   ---123456787654321---}\\
-  {\addfontfeature{CharacterWidth=Quarter}
-   ---12345678900987654321---}
-\end{Xexample}
-
-
-\subsubsection{CJK shape}
-
-\begin{features}{CJKShape}
-\otf{Traditional}{trad}
-\otf{Simplified} {smpl}
-\otf{JIS1978}    {jp78}
-\otf{JIS1983}    {jp83}
-\otf{JIS1990}    {jp90}
-\otf{Expert}     {expt}
-\otf{NLC}        {nlck}
-\end{features}
-
-There have been many standards for how CJK ideographic
-glyphs are `supposed' to look. Some fonts will contain many alternate
-glyphs available in order to be able to display these gylphs
-correctly in whichever form is appropriate. Both \AAT\ and OpenType
-fonts support the following \feat{CJKShape} options:
-\opt{Traditional}, \opt{Simplified}, \opt{JIS1978}, \opt{JIS1983},
-\opt{JIS1990}, and \opt{Expert}. OpenType also supports the \opt{NLC} option.
-
-\begin{Xexample}[firstline=2]{ot-cjk-shape}{Different standards for CJK ideograph presentation.}
-  \LARGE\def\text{ 唖噛躯 妍并訝}
-  \fontspec{Hiragino Mincho Pro}
-  {\addfontfeature{CJKShape=Traditional}
-  \text }                          \\
-  {\addfontfeature{CJKShape=NLC}
-  \text }                          \\
-  {\addfontfeature{CJKShape=Expert}
-  \text }
-\end{Xexample}
-
-
-\subsection{Vertical typesetting}
-
-\begin{features}{Vertical}
-\otf*{RotatedGlyphs}         {vrt2}
-\otf*{AlternatesForRotation} {vrtr}
-\otf*{Alternates}            {vert}
-\otf*{KanaAlternates}        {vkna}
-\otf*{Kerning}               {vkrn}
-\otf*{AlternateMetrics}      {valt}
-\otf*{HalfMetrics}           {vhal}
-\otf*{ProportionalMetrics}   {vpal}
-\cmidrule{2-4}
-\otf{ResetAll}{}
-\end{features}
-
-OpenType provides a plethora of features for accommodating the varieties of possibilities
-needed for vertical typesetting (CJK and others).
-No capabilities for achieving such vertical typesetting are provided by \pkg{fontspec},
-however; please get in touch if there are improvements that could be made.
-
-
-\subsection{Numeric features}
-
-\subsubsection{Stylistic Set variations --- \texttt{ssNN}}
-
-This feature selects a `Stylistic Set' variation,
-which usually corresponds to an alternate glyph style for a range of
-characters (usually an alphabet or subset thereof).
-This feature is specified numerically. These correspond to OpenType
-features |ss01|, |ss02|, etc.
-
-Two demonstrations from the Junicode
-font\note{\url{http://junicode.sf.net}}
-are shown in \exref{ss} and \exref{ss2}; thanks to Adam
-Buchbinder for the suggestion.
-
-\begin{Lexample}{ss}{Insular letterforms, as used in medieval Northern Europe, for the Junicode font accessed with the \feat{StylisticSet} feature.}
-  \fontspec{Junicode}
-   Insular forms. \\
-  \addfontfeature{StylisticSet=2}
-   Insular forms. \\
-\end{Lexample}
-
-\begin{Lexample}{ss2}{Enlarged minuscules (capital letters remain unchanged) for the Junicode font, accessed with the \feat{StylisticSet} feature.}
-  \fontspec{Junicode}
-   ENLARGED Minuscules. \\
-  \addfontfeature{StylisticSet=6}
-   ENLARGED Minuscules. \\
-\end{Lexample}
-
-Multiple stylistic sets may be selected simultaneously by writing, e.g.,
-|StylisticSet={1,2,3}|.
-
-The |StylisticSet| feature is a synonym of the \feat{Variant} feature for \AAT\ fonts.
-See \vref{sec:newfeatures} for a way to assign names to stylistic sets, which should be done on a per-font basis.
-
-\subsubsection{Character Variants --- \texttt{cvNN}}
-
-Similar to the `Stylistic Sets' above, `Character Variations' are selected
-numerically to adjust the output of (usually) a single character for the
-particular font. These correspond to the OpenType features |cv01| to |cv99|.
-
-For each character that can be varied, it is possible to select among
-possible options for that particular glyph.
-For example, in the example below, variants are chosen for glyphs `4' and `5',
-and the trailing |:|\meta{n} corresponds to which variety to choose.
-\begin{Verbatim}
-  \fontspec{EB Garamond 12 Italic}[CharacterVariant={4,5:2}] \& violet
-\end{Verbatim}
-The numbering is entirely font-soecific. Glyph `5' might be the character `v', for example.
-Character variants are specifically designed not to conflict with each
-other, so you can enable them individually per character.
-(Unlike stylistic alternates, say.)
-Note that the indexing starts from zero.
-
-
-\subsubsection{Alternates --- \texttt{salt}}
-
-The \feat{Alternate} feature, alias \feat{StylisticAlternates}, is used to access alternate font glyphs when variations exist in the font, such as in \exref{salt}.
-It uses a numerical selection, starting from zero, that will be different for each font.
-Note that the \texttt{Style=Alternate} option is equivalent
-to \texttt{Alternate=0} to access the default case.
-
-\begin{Xexample}[firstline=2]{salt}{The \feat{Alternate} feature.}
-  \huge
-  \fontspec{LinLibertine_R.otf}
-  \textsc{a} \& h \\
-  \addfontfeature{Alternate=0}
-  \textsc{a} \& h
-\end{Xexample}
-
-Note that the indexing starts from zero.
-With the \LuaTeX\ engine, |Alternate=Random| selects a random alternate.
-
-See \vref{sec:newfeatures} for a way to assign names to alternates if desired.
-
-
-\subsubsection{Annotation --- \texttt{nalt} }
-Some fonts are equipped with an extensive range of
-numbers and numerals in different forms. These are accessed with the
-\feat{Annotation} feature (OpenType feature |nalt|), selected numerically as shown in
-\exref{ot-annot}. Note that the indexing starts from zero.
-
-\begin{Xexample}{ot-annot}{Annotation forms for OpenType fonts.}
-  \fontspec{Hiragino Maru Gothic Pro}
-   1 2 3 4 5 6 7 8 9
-  \def\x#1{\\{\addfontfeature{Annotation=#1}
-            1 2 3 4 5 6 7 8 9 }}
-  \x0\x1\x2\x3\x4\x5\x6\x7\x7\x8\x9
-\end{Xexample}
-
-
-\subsubsection{Ornament --- \texttt{ornm}}
-Ornaments are selected with the \feat{Ornament} feature (OpenType feature |ornm|), selected numerically such as for the \feat{Annotation} feature.
-If you know of an Open Source font that supports this feature, let me know and I'll add an example.
-
-
-
-
-\subsection{OpenType scripts and languages}\label{sec:ot}
-
 Fonts that include glyphs for various scripts and languages may contain different font features for the different character sets and languages they support, and different font features may behave differently depending on the script or language chosen.
 When multilingual fonts are used, it is important to select which language
 they are being used for, and more importantly what script is being used.
@@ -802,18 +176,29 @@
 tabulated in \vref{tab:ot-scpt} and \vref{tab:ot-lang},
 respectively. When a script or language is requested that is not
 supported by the current font, a warning is printed in the console output.
+See \vref{sec:newscriptlang} for methods to create new \feat{Script} or \feat{Language}
+options if required.
 
 Because these font features can
-change which features are able to be selected for the font, they are automatically selected
-by \pkg{fontspec} before all others and, if \XeTeX\ is being used, will
+change which features are able to be selected for the font, the \feat{Script} and \feat{Language}
+settings are automatically selected
+by \pkg{fontspec} before all others, and, if \XeTeX\ is being used, will
 specifically select the \opt{OpenType}
 renderer for this font, as described in \vref{sec:renderer}.
 
-See \vref{sec:newscriptlang} for methods to create new \feat{Script} or \feat{Language}
-options if required.
+OpenType fonts can make available different font features depending on the Script and
+Language chosen.
+In addition, these settings can also set up their own font behaviour
+and glyph selection (one example is differences in style between some of the letters in the
+alphabet used for Bulgarian, Serbian, and Russian).
+The \pkg{fontspec} feature \feat{LocalForms} \texttt{=} \opt{Off} will disable some of
+these substitutions if desired for some reason.
+It is important to note that \feat{LocalForms} \texttt{=} \opt{On} is a default not of \pkg{fontspec}
+but of the underlying font shaping engines in both \XeTeX\ and \LuaTeX/\pkg{otfload}.
 
-\subsubsection{\feat{Script} and \feat{Language} examples}
 
+\subsection{\feat{Script} and \feat{Language} examples}
+
 In the examples shown in \exref{script-lang},
 the Code2000 font\note{\url{http://www.code2000.net/}}
 is used to typeset various input texts with and without the OpenType Script
@@ -1412,6 +797,667 @@
  \end{minipage}
 \end{table}
 
+
+\section{OpenType font features}
+\label{sec:ot-feat}
+
+There are a finite set of OpenType font features, and \pkg{fontspec} provides an
+interface to around half of them.
+Full documentation will be presented in the following sections, including how to
+enable and disable individual features, and how they interact.
+
+A brief reference is provided (\vref*{tab:all-ot}) but note that this is an incomplete
+listing --- only the `enable' keys are shown, and where alternative interfaces are
+provided for convenience only the first is shown.
+(E.g., |Numbers=OldStyle| is the same as |Numbers=Lowercase|.)
+
+For completeness, the complete list of OpenType features \emph{not} provided with
+a \pkg{fontspec} interface is shown in \vref{tab:none-ot}.
+Features omitted are partially by design and partially by oversight;
+for example, the |aalt| feature is largely useless in \TeX\ since it is designed
+for providing a textsc{gui} interface for selecting `all alternates' of a glyph.
+Others, such as optical bounds for example, simply haven't yet been considered
+due to a lack of fonts available for testing.
+Suggestions welcome for how/where to add these missing features to the package.
+
+\ExplSyntaxOn
+\def\allOTfeat{
+  \prop_map_inline:Nn \g__fontspec_all_opentype_feature_names_prop
+    { \opentypefeature{##1}{##2} }
+}
+\newcommand\opentypefeature[2]{
+  \prop_get:NnNT \g__fontspec_OT_features_prop {#1} \tmpa
+      {
+        \raggedright
+        \hangindent=5.2cm
+        \makebox[1cm][l]{\textsc{#1}}
+        \makebox[4.2cm][l]{
+          \int_compare:nT { \tl_count:N \tmpa > 25 } {\ttcondensed} {\ttfamily}
+          \tmpa
+        }
+        \textit{#2}
+        \par
+        \vspace{2pt}
+     }
+}
+\ExplSyntaxOff
+
+\begin{table}
+\caption{Summary of OpenType features in \textsf{fontspec}, alphabetic by feature tag.}
+\label{tab:all-ot}
+\centerline{%
+\begin{minipage}{18cm}
+\small
+\hrule\smallskip
+\begin{multicols}{2}
+\parindent =0pt
+\allOTfeat
+\end{multicols}
+\vspace*{-\smallskipamount}
+\hrule
+\end{minipage}}
+\end{table}
+
+\ExplSyntaxOn
+\renewcommand\opentypefeature[2]{
+  \prop_get:NnNF \g__fontspec_OT_features_prop {#1} \tmpa
+      {
+        \raggedright
+        \hangindent=0.9cm
+        \makebox[0.9cm][l]{\textsc{#1}}%
+        \textit{#2}
+        \par
+     }
+}
+\ExplSyntaxOff
+
+\begin{table}
+\caption{List of \emph{unsupported} OpenType features.}
+\label{tab:none-ot}
+\bigskip
+\centerline{%
+\begin{minipage}{15cm}
+\hrule\smallskip
+\begin{multicols}{3}
+\parindent =0pt
+\allOTfeat
+\end{multicols}
+\vspace*{-\smallskipamount}
+\hrule
+\end{minipage}}
+\end{table}
+
+\subsection{Tag-based features}
+
+
+\subsubsection{Alternates --- \texttt{salt}}
+
+The \feat{Alternate} feature, alias \feat{StylisticAlternates}, is used to access alternate font glyphs when variations exist in the font, such as in \exref{salt}.
+It uses a numerical selection, starting from zero, that will be different for each font.
+Note that the \texttt{Style=Alternate} option is equivalent
+to \texttt{Alternate=0} to access the default case.
+
+\begin{Xexample}[firstline=2]{salt}{The \feat{Alternate} feature.}
+  \huge
+  \fontspec{LinLibertine_R.otf}
+  \textsc{a} \& h \\
+  \addfontfeature{Alternate=0}
+  \textsc{a} \& h
+\end{Xexample}
+
+Note that the indexing starts from zero.
+With the \LuaTeX\ engine, |Alternate=Random| selects a random alternate.
+
+See \vref{sec:newfeatures} for a way to assign names to alternates if desired.
+
+
+\subsubsection{Character Variants --- \texttt{cvNN}}
+
+`Character Variations' are selected
+numerically to adjust the output of (usually) a single character for the
+particular font. These correspond to the OpenType features |cv01| to |cv99|.
+
+For each character that can be varied, it is possible to select among
+possible options for that particular glyph.
+For example, in the example below, variants are chosen for glyphs `4' and `5',
+and the trailing |:|\meta{n} corresponds to which variety to choose.
+\begin{Verbatim}
+  \fontspec{EB Garamond 12 Italic}[CharacterVariant={4,5:2}] \& violet
+\end{Verbatim}
+The numbering is entirely font-soecific. Glyph `5' might be the character `v', for example.
+Character variants are specifically designed not to conflict with each
+other, so you can enable them individually per character.
+(Unlike stylistic alternates, say.)
+Note that the indexing starts from zero.
+
+
+\subsubsection{Contextuals}
+This feature refers to substitutions of glyphs that vary `contextually' by their relative position in a word or string of characters;
+features such as contextual swashes are accessed via the options shown in \ref{feat:Contextuals}.
+
+\begin{features}{Contextuals}
+\otf*{Swash}{cswh}
+\otf*{Alternate}{calt}
+\otf*{WordInitial}{init}
+\otf*{WordFinal}{fina}
+\otf*{LineFinal}{falt}
+\otf*{Inner}{medi}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+Historic forms are accessed in OpenType
+fonts via the feature \feat{Style=Historic}; this is generally \emph{not}
+contextual in OpenType, which is why it is not included in this feature.
+
+
+\subsubsection{Diacritics}
+
+Specifies how combining diacritics should be placed.
+These will usually be controlled automatically
+according to the Script setting.
+
+\begin{features}{Diacritics}
+\otf*{MarkToBase}{mark}
+\otf*{MarkToMark}{mkmk}
+\otf*{AboveBase}{abvm}
+\otf*{BelowBase}{blwm}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+
+\subsubsection{Fractions --- \texttt{frac}}
+
+\begin{features}{Fractions}
+\otf{On}{+frac}
+\otf{Off}{-frac}
+\otf{Reset}{}
+\cmidrule{2-4}
+\otf*{Alternate}{afrc}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+For OpenType fonts use a regular text slash to create fractions, but
+the \feat{Fraction} feature must be explicitly activated.
+Some (Asian fonts predominantly) also provide for the
+\opt{Alternate} feature. These are both shown in \exref{ot-frac}.
+
+\begin{Xexample}{ot-frac}{The \feat{Fractions} feature.}
+  \fontspec{Hiragino Maru Gothic Pro W4}
+   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
+  \addfontfeature{Fractions=On}
+   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
+  \addfontfeature{Fractions=Alternate}
+   1/2 \quad 1/4 \quad 5/6 \quad 13579/24680 \\
+\end{Xexample}
+
+
+
+\subsubsection{Kerning --- \texttt{kern}}
+\label{sec:kerning}
+
+Specifies how inter-glyph spacing should behave.
+Well-made fonts include information for how differing
+amounts of space should be inserted between separate character pairs.
+This kerning space is inserted automatically but in rare
+circumstances you may wish to turn it off.
+
+\begin{features}{Kerning}
+\otf{On}{+kern}
+\otf{Off}{-kern}
+\otf{Reset}{}
+\cmidrule{2-4}
+\otf*{Uppercase}{cpsp}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+As briefly mentioned previously at the end of \vref{sec:letters},
+the \opt{Uppercase} option will add a small amount of tracking between
+uppercase letters, seen in \exref{kernup}, which uses the Romande
+fonts\note{\url{http://arkandis.tuxfamily.org/adffonts.html}}
+(thanks to Clea F. Rees for the suggestion).
+The \opt{Uppercase} option acts separately to the regular kerning
+controlled by the \opt{On}/\opt{Off} options.
+
+\begin{Xexample}[firstline=2]{kernup}{Adding extra kerning for uppercase letters. (The difference is usually very small.)}
+  \large
+  \fontspec{RomandeADFStd-DemiBold.otf}
+   UPPERCASE EXAMPLE \\
+  \addfontfeature{Kerning=Uppercase}
+   UPPERCASE EXAMPLE
+\end{Xexample}
+
+
+\subsubsection{Letters} \label{sec:letters}
+The \opt{Letters} feature specifies how the letters in the current font
+will look. OpenType fonts may contain the following options:
+\opt{Uppercase}, \opt{SmallCaps}, \opt{PetiteCaps},
+\opt{UppercaseSmallCaps}, \opt{UppercasePetiteCaps}, and
+\opt{Unicase}.
+
+\begin{features}{Letters}
+\otf*{Uppercase}{case}
+\otf*{SmallCaps}{smcp}
+\otf*{PetiteCaps}{pcap}
+\otf*{UppercaseSmallCaps}{c2sc}
+\otf*{UppercasePetiteCaps}{c2pc}
+\otf*{Unicase}{unic}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+Petite caps are smaller than small caps.
+\opt{SmallCaps} and \opt{PetiteCaps}
+turn lowercase letters into the smaller caps letters,
+whereas the \opt{Uppercase...} options turn the \emph{capital} letters into
+the smaller
+caps (good, \eg, for applying to already uppercase acronyms like
+`NASA').
+This difference is shown in \exref{caps}.
+`Unicase' is a weird hybrid of upper and lower case letters.
+
+\begin{Lexample}{caps}{Small caps from lowercase or uppercase letters.}
+  \fontspec{texgyreadventor-regular.otf}[Letters=SmallCaps]
+   THIS SENTENCE no verb                \\
+  \fontspec{texgyreadventor-regular.otf}[Letters=UppercaseSmallCaps]
+   THIS SENTENCE no verb
+\end{Lexample}
+
+Note that the \opt{Uppercase} option will (probably)
+not actually map letters to uppercase.
+ \note{If you want automatic uppercase letters, look to \LaTeX's
+      \cmd\MakeUppercase\ command.}
+It is designed to select various
+uppercase forms for glyphs such as accents and dashes, such as shown
+in \exref{letters-uppercase}; note the raised position of the hyphen
+to better match the surrounding letters.
+
+\begin{Lexample}{letters-uppercase}{An example of the \opt{Uppercase} option of the \feat{Letters} feature.}
+  \fontspec{LinLibertine_R.otf}
+   UPPER-CASE example \\
+  \addfontfeature{Letters=Uppercase}
+   UPPER-CASE example
+\end{Lexample}
+
+The \feat{Kerning} feature also contains an \opt{Uppercase} option,
+which adds a small amount of spacing in between letters (see \vref{sec:kerning}).
+
+
+\subsubsection{Ligatures}
+\label{sec:ot-feat-liga}
+
+\feat{Ligatures} refer to the replacement of two separate characters
+with a specially drawn glyph for functional or \ae sthetic reasons.
+The list of options, of which multiple may be selected at one time,
+is shown in \ref{feat:Ligatures}.
+A demonstration with the Linux Libertine fonts\note{\url{http://www.linuxlibertine.org/}} is shown in \exref{lig}.
+
+Note the additional features accessed with \verb|Ligatures=TeX|. These are
+not actually real OpenType features, but additions provided by \pkg{luaotfload} (i.e., \LuaTeX\ only) to emulate \TeX's behaviour for \textsc{ascii} input of curly quotes and punctuation. In \XeTeX\ this is achieved with the \feat{Mapping} feature (see \vref{sec:mapping}) but for consistency \verb|Ligatures=TeX| will perform the same function as \verb|Mapping=tex-text|.
+
+\begin{features}{Ligatures}
+\otf*{Required}{rlig}
+\otf*{Common}{liga}
+\otf*{Contextual}{clig}
+\otf*{Rare/Discretionary}{dlig}
+\otf*{Historic}{hlig}
+\otf*{TeX}{tlig}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+\begin{Lexample}[firstline=2]{lig}{An example of the \feat{Ligatures} feature.}
+   \Huge\centering
+   \def\test#1#2{%
+     #2 $\to$ {\addfontfeature{#1} #2}\\}
+   \fontspec{LinLibertine_R.otf}
+   \test{Ligatures=Historic}{strict}
+   \test{Ligatures=Rare}{wurtzite}
+   \test{Ligatures=NoCommon}{firefly}
+\end{Lexample}
+
+
+\subsubsection{Localised Forms --- \texttt{locl}}
+
+\begin{features}{LocalForms}
+\otf{On}{+locl}
+\otf{Off}{-locl}
+\otf{Reset}{}
+\end{features}
+
+This feature enables and disables glyph substitutions, etc., that are specific to the
+\feat{Language} selected in the font.
+This feature is automatically activated by default when present,
+so it should not be generally necessary to use \feat{LocalForms} \texttt{=} \opt{On}.
+In certain scenarios it may be important to turn it \opt{Off} (although nothing specifically springs to mind).
+
+
+\subsubsection{Numbers}
+
+The \feat{Numbers} feature defines how numbers will look in the
+selected font, accepting options shown in \ref{feat:Numbers}.
+
+\begin{features}{Numbers}
+\otf*{Uppercase}{lnum}
+\otf*{Lowercase}{onum}
+\otf*{Lining}{lnum}
+\otf*{OldStyle}{onum}
+\otf*{Proportional}{pnum}
+\otf*{Monospaced}{tnum}
+\otf*{SlashedZero}{zero}
+\otf*{Arabic}{anum}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+The synonyms
+\opt{Uppercase} and \opt{Lowercase} are equivalent to \opt{Lining} and
+\opt{OldStyle}, respectively.
+The differences have been shown previously
+in \vref{sec:addfontfeatures}.
+The \opt{Monospaced} option is useful for tabular material when digits need
+to be vertically aligned.
+
+The \opt{SlashedZero} option
+replaces the default zero with a slashed version to prevent
+confusion with an uppercase `O', shown in \exref{slashzero}.
+
+\begin{Lexample}{slashzero}{The effect of the \opt{SlashedZero} option.}
+  \fontspec[Numbers=Lining]{texgyrebonum-regular.otf}
+   0123456789
+  \fontspec[Numbers=SlashedZero]{texgyrebonum-regular.otf}
+   0123456789
+\end{Lexample}
+
+The \opt{Arabic} option (with tag \verb|anum|) maps regular numerals to their Arabic script or Persian equivalents
+based on the current \opt{Language} setting (see \vref{sec:ot}).
+This option is based on a \LuaTeX\ feature of the \pkg{luaotfload} package,
+not an OpenType feature. (Thus, this feature is unavailable in \XeTeX.)
+
+
+\subsubsection{Ornament --- \texttt{ornm}}
+
+Ornaments are selected with the \feat{Ornament} feature (OpenType feature |ornm|),
+selected numerically such as for the \feat{Annotation} feature.
+
+
+\subsubsection{Style}
+\label{sec:ot-feat-style}
+
+\begin{features}{Style}
+\otf*{Alternate}{salt}
+\otf*{Italic}{ital}
+\otf*{Ruby}{ruby}
+\otf*{Swash}{swsh}
+\otf*{Cursive}{curs}
+\otf*{Historic}{hist}
+\otf*{TitlingCaps}{titl}
+\otf*{HorizontalKana}{hkna}
+\otf*{VerticalKana}{vkna}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+`Ruby' refers to a small optical size, used in
+Japanese typography for annotations.
+For fonts with multiple |salt| OpenType features,
+use the fontspec \feat{Alternate} feature instead.
+
+\Exref{style-alt} shows an example of a font feature that involves glyph substitution
+for particular letters within an alphabet.
+Other options in these categories operate in similar ways, with the choice of how
+particular substitutions are organised with which feature largely up to the font designer.
+
+ \begin{Xexample}[firstline=2]{style-alt}{Example of the \opt{Alternate} option of the \feat{Style} feature.}
+  \Large
+  \fontspec{Quattrocento.otf}
+   M Q W                      \\
+  \addfontfeature{Style=Alternate}
+   M Q W
+\end{Xexample}
+
+In other features, larger breadths of changes can be seen, covering
+the style of an entire alphabet.
+See \exref{style-itrub}; here, the \opt{Italic} option affects the Latin text
+and the \opt{Ruby} option the Japanese.
+
+\begin{Xexample}[firstline=2]{style-itrub}{Example of the \opt{Italic} and \opt{Ruby} options of the \feat{Style} feature.}
+  \Large \def\kana{ようこそ ワカヨタレソ}
+  \fontspec{Hiragino Mincho Pro}
+   Latin \kana        \\
+  \addfontfeature{Style={Italic, Ruby}}
+   Latin \kana
+\end{Xexample}
+
+Note the difference here between the default and the horizontal style kana
+in \exref{style-hvkana}: the horizontal style is slightly wider.
+
+\begin{Xexample}[firstline=2]{style-hvkana}{Example of the \opt{HorizontalKana} and \opt{VerticalKana} options of the \feat{Style} feature.}
+  \Large \def\kana{ようこそ ワカヨタレソ}
+   \fontspec{Hiragino Mincho Pro}
+    \kana   \\
+  {\addfontfeature{Style=HorizontalKana}
+    \kana } \\
+  {\addfontfeature{Style=VerticalKana}
+    \kana }
+\end{Xexample}
+
+
+\subsubsection{Stylistic Set variations --- \texttt{ssNN}}
+\label{sec:ot-ss}
+
+This feature selects a `Stylistic Set' variation,
+which usually corresponds to an alternate glyph style for a range of
+characters (usually an alphabet or subset thereof).
+This feature is specified numerically. These correspond to OpenType
+features |ss01|, |ss02|, etc.
+
+Two demonstrations from the Junicode
+font\note{\url{http://junicode.sf.net}}
+are shown in \exref{ss} and \exref{ss2}; thanks to Adam
+Buchbinder for the suggestion.
+
+\begin{Lexample}{ss}{Insular letterforms, as used in medieval Northern Europe, for the Junicode font accessed with the \feat{StylisticSet} feature.}
+  \fontspec{Junicode}
+   Insular forms. \\
+  \addfontfeature{StylisticSet=2}
+   Insular forms. \\
+\end{Lexample}
+
+\begin{Lexample}{ss2}{Enlarged minuscules (capital letters remain unchanged) for the Junicode font, accessed with the \feat{StylisticSet} feature.}
+  \fontspec{Junicode}
+   ENLARGED Minuscules. \\
+  \addfontfeature{StylisticSet=6}
+   ENLARGED Minuscules. \\
+\end{Lexample}
+
+Multiple stylistic sets may be selected simultaneously by writing, e.g.,
+|StylisticSet={1,2,3}|.
+
+The |StylisticSet| feature is a synonym of the \feat{Variant} feature for \AAT\ fonts.
+See \vref{sec:newfeatures} for a way to assign names to stylistic sets, which should be done on a per-font basis.
+
+
+\subsubsection{Vertical Position}
+
+\begin{features}{VerticalPosition}
+\otf*{Superior}{sups}
+\otf*{Inferior}{subs}
+\otf*{Numerator}{numr}
+\otf*{Denominator}{dnom}
+\otf*{ScientificInferior}{sinf}
+\otf*{Ordinal}{ordn}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+The \feat{VerticalPosition} feature is used to access things like
+subscript (\opt{Inferior}) and superscript (\opt{Superior}) numbers and
+letters (and a small amount of punctuation, sometimes).
+The \opt{Ordinal} option will only raise characters that are used
+in some languages directly after a number.
+The \opt{ScientificInferior} feature will move glyphs
+further below the baseline than the \opt{Inferior} feature.
+These are shown in \exref{vertpos}
+
+\opt{Numerator} and \opt{Denominator} should only be used for creating
+arbitrary fractions (see next section).
+
+\begin{Lexample}{vertpos}{The \feat{VerticalPosition} feature.}
+  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Superior]
+   Superior: 1234567890                                   \\
+  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Numerator]
+   Numerator: 12345                                       \\
+  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=Denominator]
+   Denominator: 12345                                     \\
+  \fontspec{LibreCaslonText-Regular.otf}[VerticalPosition=ScientificInferior]
+   Scientific Inferior: 12345
+\end{Lexample}
+
+The \pkg{realscripts} package
+(which is also loaded by \pkg{xltxtra} for \XeTeX)
+redefines the \cmd\textsubscript\ and
+\cmd\textsuperscript\ commands to use the above font features automatically,
+including for use in footnote labels.
+If this is the only feature of \pkg{xltxtra} you wish to use, consider
+loading \pkg{realscripts} on its own instead.
+
+
+
+\subsection{CJK features}
+
+This section summarises the features which are largely intending for Chinese, Korean,
+and Japanese typesetting.
+
+
+\subsubsection{Annotation --- \texttt{nalt} }
+
+Some fonts are equipped with an extensive range of
+numbers and numerals in different forms. These are accessed with the
+\feat{Annotation} feature (OpenType feature |nalt|), selected numerically as shown in
+\exref{ot-annot}. Note that the indexing starts from zero.
+
+\begin{Xexample}{ot-annot}{Annotation forms for OpenType fonts.}
+  \fontspec{Hiragino Maru Gothic Pro}
+   1 2 3 4 5 6 7 8 9
+  \def\x#1{\\{\addfontfeature{Annotation=#1}
+            1 2 3 4 5 6 7 8 9 }}
+  \x0\x1\x2\x3\x4\x5\x6\x7\x7\x8\x9
+\end{Xexample}
+
+
+\subsubsection{Character width}\label{sec:CharacterWidth}
+
+Many Asian fonts are equipped with variously spaced characters for
+shoe-horning into their generally monospaced text.
+These are
+accessed through the \feat{CharacterWidth} feature.
+
+\begin{features}{CharacterWidth}
+\otf*{Proportional}{pwid}
+\otf*{Full}        {fwid}
+\otf*{Half}        {hwid}
+\otf*{Third}       {twid}
+\otf*{Quarter}     {qwid}
+\otf*{AlternateProportional}{palt}
+\otf*{AlternateHalf}{halt}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+Japanese alphabetic glyphs (in Hiragana or Katakana) may be typeset
+proportionally, to better fit horizontal measures, or monospaced, to
+fit into the rigid grid imposed by ideographic typesetting. In this
+latter case, there are also half-width forms for squeezing more kana
+glyphs (which are less complex than the kanji they are amongst) into
+a given block of space. The same features are given to roman letters
+in Japanese fonts, for typesetting foreign words in the same style
+as the surrounding text.
+
+\begin{Xexample}[firstline=2]{charwdprop}{Proportional or fixed width forms.}
+  \def\texta{ようこそ}\def\textb{ワカヨタレソ}
+  \def\test{\makebox[2cm][l]{\texta}%
+            \makebox[2.5cm][l]{\textb}%
+            \makebox[2.5cm][l]{abcdef}}
+  \fontspec{Hiragino Mincho Pro}
+  {\addfontfeature{CharacterWidth=Proportional}\test}\\
+  {\addfontfeature{CharacterWidth=Full}\test}\\
+  {\addfontfeature{CharacterWidth=Half}\test}
+\end{Xexample}
+
+The same situation occurs with numbers, which are provided in
+increasingly illegible compressed forms seen in \exref{charwd}.
+
+\begin{Xexample}[firstline=2]{charwd}{Numbers can be compressed significantly.}
+  \centering
+  \fontspec[Renderer=AAT]{Hiragino Mincho Pro}
+  {\addfontfeature{CharacterWidth=Full}
+   ---12321---}\\
+  {\addfontfeature{CharacterWidth=Half}
+   ---1234554321---}\\
+  {\addfontfeature{CharacterWidth=Third}
+   ---123456787654321---}\\
+  {\addfontfeature{CharacterWidth=Quarter}
+   ---12345678900987654321---}
+\end{Xexample}
+
+
+\subsubsection{CJK shape}
+
+\begin{features}{CJKShape}
+\otf{Traditional}{trad}
+\otf{Simplified} {smpl}
+\otf{JIS1978}    {jp78}
+\otf{JIS1983}    {jp83}
+\otf{JIS1990}    {jp90}
+\otf{Expert}     {expt}
+\otf{NLC}        {nlck}
+\end{features}
+
+There have been many standards for how CJK ideographic
+glyphs are `supposed' to look. Some fonts will contain many alternate
+glyphs available in order to be able to display these gylphs
+correctly in whichever form is appropriate. Both \AAT\ and OpenType
+fonts support the following \feat{CJKShape} options:
+\opt{Traditional}, \opt{Simplified}, \opt{JIS1978}, \opt{JIS1983},
+\opt{JIS1990}, and \opt{Expert}. OpenType also supports the \opt{NLC} option.
+
+\begin{Xexample}[firstline=2]{ot-cjk-shape}{Different standards for CJK ideograph presentation.}
+  \LARGE\def\text{ 唖噛躯 妍并訝}
+  \fontspec{Hiragino Mincho Pro}
+  {\addfontfeature{CJKShape=Traditional}
+  \text }                          \\
+  {\addfontfeature{CJKShape=NLC}
+  \text }                          \\
+  {\addfontfeature{CJKShape=Expert}
+  \text }
+\end{Xexample}
+
+
+\subsubsection{Vertical typesetting}
+
+\begin{features}{Vertical}
+\otf*{RotatedGlyphs}         {vrt2}
+\otf*{AlternatesForRotation} {vrtr}
+\otf*{Alternates}            {vert}
+\otf*{KanaAlternates}        {vkna}
+\otf*{Kerning}               {vkrn}
+\otf*{AlternateMetrics}      {valt}
+\otf*{HalfMetrics}           {vhal}
+\otf*{ProportionalMetrics}   {vpal}
+\cmidrule{2-4}
+\otf{ResetAll}{}
+\end{features}
+
+OpenType provides a plethora of features for accommodating the varieties of possibilities
+needed for vertical typesetting (CJK and others).
+No capabilities for achieving such vertical typesetting are provided by \pkg{fontspec},
+however; please get in touch if there are improvements that could be made.
+
+
 \end{document}
 
 % /©

Modified: trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/source/latex/fontspec/fontspec.dtx	2019-01-25 21:39:16 UTC (rev 49816)
@@ -71,7 +71,7 @@
 \ProvidesExplFile{fontspec.dtx}
 %</dtx>
 %<*fontspec>
-  {2019/01/24}{2.7}{Font selection for XeLaTeX and LuaLaTeX}
+  {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX}
 %</fontspec>
 %    \end{macrocode}
 %
@@ -90,8 +90,8 @@
 %<lua>local fontspec    = fontspec
 %<lua>fontspec.module   = {
 %<lua>    name          = "fontspec",
-%<lua>    version       = "2.7",
-%<lua>    date          = "2019/01/24",
+%<lua>    version       = "2.7a",
+%<lua>    date          = "2019/01/25",
 %<lua>    description   = "Font selection for XeLaTeX and LuaLaTeX",
 %<lua>    author        = "Khaled Hosny, Philipp Gesang, Will Robertson",
 %<lua>    copyright     = "Khaled Hosny, Philipp Gesang, Will Robertson",

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty	2019-01-25 21:39:16 UTC (rev 49816)
@@ -41,7 +41,7 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-luatex}%
-  {2019/01/24}{2.7}{Font selection for XeLaTeX and LuaLaTeX}
+  {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -498,6 +498,10 @@
   {
     \int_set:Nn #1 { \__dim_eval:w #2 #1 \__dim_eval_end: }
   }
+\cs_set:Npn \__fontspec_lua_function:ne    #1#2       { \lua_now:e { fontspec.#1 ("#2")                } }
+\cs_set:Npn \__fontspec_lua_function:nee   #1#2#3     { \lua_now:e { fontspec.#1 ("#2","#3")           } }
+\cs_set:Npn \__fontspec_lua_function:neee  #1#2#3#4   { \lua_now:e { fontspec.#1 ("#2","#3","#4")      } }
+\cs_set:Npn \__fontspec_lua_function:neeee #1#2#3#4#5 { \lua_now:e { fontspec.#1 ("#2","#3","#4","#5") } }
 \cs_generate_variant:Nn \int_set:Nn {Nv}
 \cs_generate_variant:Nn \keys_set:nn {nx}
 \cs_generate_variant:Nn \keys_set_known:nnN {nx}
@@ -1860,7 +1864,7 @@
         \cs_if_eq:NNTF #1 \font
           { \tl_set:Nx \l__fontspec_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} }
-        \directlua{fontspec.check_ot_script("\l__fontspec_tmp_tl", "#2")}
+        \lua_now:e { fontspec.check_ot_script("\l__fontspec_tmp_tl", "#2") }
         \bool_if:NTF \l__fontspec_check_bool
           {
             \prg_return_true:
@@ -1888,10 +1892,7 @@
         \cs_if_eq:NNTF #1 \font
           { \tl_set:Nx \l__fontspec_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} }
-        \directlua
-          {
-            fontspec.check_ot_lang( "\l__fontspec_tmp_tl", "#2", "#3" )
-          }
+        \__fontspec_lua_function:neee {check_ot_lang} {\l__fontspec_tmp_tl} {#2} {#3}
         \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false:
       }
       }
@@ -1915,10 +1916,7 @@
         \cs_if_eq:NNTF #1 \font
           { \tl_set:Nx \l__fontspec_tmp_tl {\curr at fontshape/\f at size} }
           { \tl_set:Nx \l__fontspec_tmp_tl {\cs_to_str:N #1} }
-        \directlua
-          {
-            fontspec.check_ot_feat("\l__fontspec_tmp_tl", "#2", "#3", "#4")
-          }
+        \__fontspec_lua_function:neeee {check_ot_feat} {\l__fontspec_tmp_tl} {#2} {#3} {#4}
         \bool_if:NTF \l__fontspec_check_bool \prg_return_true: \prg_return_false:
       }
       }
@@ -2409,7 +2407,7 @@
             \tl_put_right:Nn \l__fontspec_postadjust_tl
               { \__fontspec_primitive_font_set_hyphenchar:Nn \font { \l__fontspec_hyphenchar_tl } }
           }
-          { \__fontspec_error:nx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
+          { \__fontspec_error:nxx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
 
       }
   }
@@ -2670,6 +2668,10 @@
 \__fontspec_define_opentype_feature:nnnnn    {Fractions} {Off}   {frac} {-frac} {}
 \__fontspec_define_opentype_feature:nnnnn    {Fractions} {Reset} {} {} {+frac,-frac}
 \__fontspec_define_opentype_onoffreset:nnnnn {Fractions} {Alternate} {afrc} {afrc} {-frac}
+\__fontspec_define_opentype_feature_group:n  {LocalForms}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {On}    {locl} {+locl} {}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {Off}   {locl} {-locl} {}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {Reset} {} {}  {+locl,-locl}
 
 \__fontspec_define_opentype_feature_group:n  {Style}
 \__fontspec_define_opentype_feature:nnnnn    {Style} {ResetAll} {} {}
@@ -2839,12 +2841,13 @@
                 \clist_map_break:
               }
           }
+
         \bool_if:NF \l__fontspec_scriptlang_exist_bool
           {
             \bool_if:nF { \str_if_eq_p:ee {#1} {CustomDefault} }
               {
                 \tl_clear:N \l__fontspec_script_name_tl
-                \__fontspec_warning:nx {no-script} {\l_fontspec_fontname_tl} {#1}
+                \__fontspec_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1}
               }
 
             \bool_if:nF
@@ -3848,25 +3851,13 @@
 
 %%^^A%%  fontspec-code-patches.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
-\DeclareRobustCommand{\-}
+\cs_new_protected:Nn \fontspec_visible_space:
   {
-    \discretionary
-      {
-        \char\ifnum\hyphenchar\font<\z@
-              \xlx at defaulthyphenchar
-            \else
-              \hyphenchar\font
-            \fi
-      }{}{}
-  }
-\def\xlx at defaulthyphenchar{`\-}
-\cs_new:Nn \fontspec_visible_space:
-  {
     \__fontspec_primitive_font_glyph_if_exist:NnTF \font {"2423}
       { \char"2423\scan_stop: }
       { \fontspec_visible_space_fallback: }
   }
-\cs_new:Nn \fontspec_visible_space_fallback:
+\cs_new_protected:Nn \fontspec_visible_space_fallback:
   {
     {
       \usefont{\g_fontspec_encoding_tl}{lmtt}{\f at series}{\f at shape}
@@ -3880,24 +3871,31 @@
 \cs_set_eq:NN^^20\fontspec_visible_space:%
 }%
 \group_end:
-\def\verb
+\AtBeginDocument
   {
-    \relax\ifmmode\hbox\else\leavevmode\null\fi
-    \bgroup
-      \verb at eol@error \let\do\@makeother \dospecials
-      \verbatim at font\@noligs
-      \@ifstar\__fontspecsverb\@verb
+    \cs_if_exist:NF \verbvisiblespace
+      {
+\__fontspec_patch_verb:
+\__fontspec_patch_verbatim:
+\__fontspec_patch_moreverb:
+\__fontspec_patch_fancyvrb:
+\__fontspec_patch_listings:
+}
   }
+\cs_new_protected:Npn \__fontspec_patch_verb:
+  {
+\def\verb
+{
+\relax\ifmmode\hbox\else\leavevmode\null\fi
+\bgroup
+\verb at eol@error \let\do\@makeother \dospecials
+\verbatim at font\@noligs
+\@ifstar\__fontspecsverb\@verb
+}
 \def\__fontspecsverb{\fontspec_print_visible_spaces:\@sverb}
-\AtBeginDocument
+}
+\cs_new_protected:Npn \__fontspec_patch_verbatim:
   {
-    \fontspec_patch_verbatim:
-    \fontspec_patch_moreverb:
-    \fontspec_patch_fancyvrb:
-    \fontspec_patch_listings:
-  }
-\cs_set:Npn \fontspec_patch_verbatim:
-  {
     \@ifpackageloaded{verbatim}
       {
         \cs_set:cpn {verbatim*}
@@ -3912,7 +3910,7 @@
           }
       }
  }
-\cs_set:Npn \fontspec_patch_moreverb:
+\cs_new_protected:Npn \__fontspec_patch_moreverb:
   {
     \@ifpackageloaded{moreverb}
       {
@@ -3927,7 +3925,7 @@
           }
       }{}
   }
-\cs_set:Npn \fontspec_patch_fancyvrb:
+\cs_new_protected:Npn \__fontspec_patch_fancyvrb:
   {
     \@ifpackageloaded{fancyvrb}
       {
@@ -3934,7 +3932,7 @@
         \cs_set_eq:NN \FancyVerbSpace \fontspec_visible_space:
       }{}
   }
-\cs_set:Npn \fontspec_patch_listings:
+\cs_new_protected:Npn \__fontspec_patch_listings:
   {
     \@ifpackageloaded{listings}
       {

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty	2019-01-25 21:39:16 UTC (rev 49816)
@@ -41,7 +41,7 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec-xetex}%
-  {2019/01/24}{2.7}{Font selection for XeLaTeX and LuaLaTeX}
+  {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 %%^^A%%  fontspec-code-vars.dtx -- part of FONTSPEC <wspr.io/fontspec>
@@ -2541,7 +2541,7 @@
             \tl_put_right:Nn \l__fontspec_postadjust_tl
               { \__fontspec_primitive_font_set_hyphenchar:Nn \font { \l__fontspec_hyphenchar_tl } }
           }
-          { \__fontspec_error:nx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
+          { \__fontspec_error:nxx {no-glyph}{\l_fontspec_fontname_tl}{#1} }
 
       }
   }
@@ -2622,7 +2622,7 @@
     \bool_if:nT { !\l__fontspec_ot_bool && !\l__fontspec_mm_bool }
       {
         \bool_if:NT \l__fontspec_firsttime_bool
-        { \__fontspec_warning:n {no-opticals} {\l_fontspec_fontname_tl} }
+        { \__fontspec_warning:nx {no-opticals} {\l_fontspec_fontname_tl} }
       }
   }
 \keys_define:nn {fontspec}
@@ -2823,6 +2823,10 @@
 \__fontspec_define_opentype_feature:nnnnn    {Fractions} {Off}   {frac} {-frac} {}
 \__fontspec_define_opentype_feature:nnnnn    {Fractions} {Reset} {} {} {+frac,-frac}
 \__fontspec_define_opentype_onoffreset:nnnnn {Fractions} {Alternate} {afrc} {afrc} {-frac}
+\__fontspec_define_opentype_feature_group:n  {LocalForms}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {On}    {locl} {+locl} {}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {Off}   {locl} {-locl} {}
+\__fontspec_define_opentype_feature:nnnnn    {LocalForms} {Reset} {} {}  {+locl,-locl}
 
 \__fontspec_define_opentype_feature_group:n  {Style}
 \__fontspec_define_opentype_feature:nnnnn    {Style} {ResetAll} {} {}
@@ -2987,12 +2991,13 @@
                 \clist_map_break:
               }
           }
+
         \bool_if:NF \l__fontspec_scriptlang_exist_bool
           {
             \bool_if:nF { \str_if_eq_p:ee {#1} {CustomDefault} }
               {
                 \tl_clear:N \l__fontspec_script_name_tl
-                \__fontspec_warning:nx {no-script} {\l_fontspec_fontname_tl} {#1}
+                \__fontspec_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1}
               }
 
             \bool_if:nF
@@ -4133,25 +4138,13 @@
 
 %%^^A%%  fontspec-code-patches.dtx -- part of FONTSPEC <wspr.io/fontspec>
 
-\DeclareRobustCommand{\-}
+\cs_new_protected:Nn \fontspec_visible_space:
   {
-    \discretionary
-      {
-        \char\ifnum\hyphenchar\font<\z@
-              \xlx at defaulthyphenchar
-            \else
-              \hyphenchar\font
-            \fi
-      }{}{}
-  }
-\def\xlx at defaulthyphenchar{`\-}
-\cs_new:Nn \fontspec_visible_space:
-  {
     \__fontspec_primitive_font_glyph_if_exist:NnTF \font {"2423}
       { \char"2423\scan_stop: }
       { \fontspec_visible_space_fallback: }
   }
-\cs_new:Nn \fontspec_visible_space_fallback:
+\cs_new_protected:Nn \fontspec_visible_space_fallback:
   {
     {
       \usefont{\g_fontspec_encoding_tl}{lmtt}{\f at series}{\f at shape}
@@ -4165,24 +4158,31 @@
 \cs_set_eq:NN^^20\fontspec_visible_space:%
 }%
 \group_end:
-\def\verb
+\AtBeginDocument
   {
-    \relax\ifmmode\hbox\else\leavevmode\null\fi
-    \bgroup
-      \verb at eol@error \let\do\@makeother \dospecials
-      \verbatim at font\@noligs
-      \@ifstar\__fontspecsverb\@verb
+    \cs_if_exist:NF \verbvisiblespace
+      {
+\__fontspec_patch_verb:
+\__fontspec_patch_verbatim:
+\__fontspec_patch_moreverb:
+\__fontspec_patch_fancyvrb:
+\__fontspec_patch_listings:
+}
   }
+\cs_new_protected:Npn \__fontspec_patch_verb:
+  {
+\def\verb
+{
+\relax\ifmmode\hbox\else\leavevmode\null\fi
+\bgroup
+\verb at eol@error \let\do\@makeother \dospecials
+\verbatim at font\@noligs
+\@ifstar\__fontspecsverb\@verb
+}
 \def\__fontspecsverb{\fontspec_print_visible_spaces:\@sverb}
-\AtBeginDocument
+}
+\cs_new_protected:Npn \__fontspec_patch_verbatim:
   {
-    \fontspec_patch_verbatim:
-    \fontspec_patch_moreverb:
-    \fontspec_patch_fancyvrb:
-    \fontspec_patch_listings:
-  }
-\cs_set:Npn \fontspec_patch_verbatim:
-  {
     \@ifpackageloaded{verbatim}
       {
         \cs_set:cpn {verbatim*}
@@ -4197,7 +4197,7 @@
           }
       }
  }
-\cs_set:Npn \fontspec_patch_moreverb:
+\cs_new_protected:Npn \__fontspec_patch_moreverb:
   {
     \@ifpackageloaded{moreverb}
       {
@@ -4212,7 +4212,7 @@
           }
       }{}
   }
-\cs_set:Npn \fontspec_patch_fancyvrb:
+\cs_new_protected:Npn \__fontspec_patch_fancyvrb:
   {
     \@ifpackageloaded{fancyvrb}
       {
@@ -4219,7 +4219,7 @@
         \cs_set_eq:NN \FancyVerbSpace \fontspec_visible_space:
       }{}
   }
-\cs_set:Npn \fontspec_patch_listings:
+\cs_new_protected:Npn \__fontspec_patch_listings:
   {
     \@ifpackageloaded{listings}
       {

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.lua	2019-01-25 21:39:16 UTC (rev 49816)
@@ -23,8 +23,8 @@
 local fontspec    = fontspec
 fontspec.module   = {
     name          = "fontspec",
-    version       = "2.7",
-    date          = "2019/01/24",
+    version       = "2.7a",
+    date          = "2019/01/25",
     description   = "Font selection for XeLaTeX and LuaLaTeX",
     author        = "Khaled Hosny, Philipp Gesang, Will Robertson",
     copyright     = "Khaled Hosny, Philipp Gesang, Will Robertson",

Modified: trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2019-01-25 21:38:58 UTC (rev 49815)
+++ trunk/Master/texmf-dist/tex/latex/fontspec/fontspec.sty	2019-01-25 21:39:16 UTC (rev 49816)
@@ -21,13 +21,13 @@
 
 \RequirePackage{xparse}
 \ProvidesExplPackage{fontspec}%
-  {2019/01/24}{2.7}{Font selection for XeLaTeX and LuaLaTeX}
+  {2019/01/25}{2.7a}{Font selection for XeLaTeX and LuaLaTeX}
 
 %%^^A%%  fontspec-code-load.dtx -- part of FONTSPEC <wspr.io/fontspec>
 \sys_if_engine_luatex:T
   {
     \RequirePackage{luaotfload}
-    \directlua{require("fontspec")}
+    \lua_now:e{require("fontspec")}
     \RequirePackageWithOptions{fontspec-luatex}
     \endinput
   }



More information about the tex-live-commits mailing list