summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fontspec
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-09-22 22:54:18 +0000
committerKarl Berry <karl@freefriends.org>2017-09-22 22:54:18 +0000
commitd51add942fa9edcf2de40adbb7ce915bcba38768 (patch)
tree3bde82167b1510ffd8fa01ba5b030161e15fbc44 /Master/texmf-dist/source/latex/fontspec
parent95a2badc031cd53b7456fbda90afd45806639e62 (diff)
fontspec (22sep17)
git-svn-id: svn://tug.org/texlive/trunk@45381 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx22
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex27
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex2
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx9
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx198
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx3
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx9
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx266
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec.dtx11
9 files changed, 299 insertions, 248 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx
index f2d3c1c2ce8..73ec2cfe255 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-closing.dtx
@@ -7,28 +7,6 @@
% \end{macrocode}
% \fi
%
-% \subsection{Compatibility}
-%
-% \begin{macro}{\zf@enc}
-% \begin{macro}{\zf@family}
-% \begin{macro}{\zf@basefont}
-% \begin{macro}{\zf@fontspec}
-% Old interfaces.
-% These are needed by, at least, the \pkg{mathspec} package.
-% \begin{macrocode}
-\tl_set:Nn \zf@enc { \g_fontspec_encoding_tl }
-\cs_set:Npn \zf@fontspec #1 #2
- {
- \@@_select_font_family:nn {#1} {#2}
- \tl_set:Nn \zf@family { \l_fontspec_family_tl }
- \tl_set:Nn \zf@basefont { \l_fontspec_font }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% \subsection{Finishing up}
% Now we just want to set up loading the \texttt{.cfg} file, if it exists.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
index 269a0602b3b..17d4a9da151 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-featset.tex
@@ -462,13 +462,16 @@ use this feature in \cs{addfontfeatures}.
\subsection{The hyphenation character}
The letter used for hyphenation may be chosen with the \feat{HyphenChar}
-feature. This is a \XeTeX-only feature since \LuaTeX\ cannot set the hyphenation character on a per-font basis; see its \cs{prehyphenchar} primitive for further details.
+feature.
+With one exception (\feat{HyphenChar} \texttt{=} \opt{None}),
+this is a \XeTeX-only feature since \LuaTeX\ cannot set the hyphenation character on a per-font basis;
+see its \cs{prehyphenchar} primitive for further details.
-It takes three types of input, which are chosen according to some
+\feat{HyphenChar} takes three types of input, which are chosen according to some
simple rules. If the input is the string \opt{None}, then hyphenation is
suppressed for this font.
-If the input is a single character, then this
-character is used. Finally, if the input is longer than a single character
+If the input is a single character, then this character is used.
+Finally, if the input is longer than a single character
it must be the UTF-8 slot number of the hyphen character you desire.
This package redefines \LaTeX's \cmd\-\ macro such that it adjusts along with the above changes.
@@ -503,9 +506,9 @@ and Lua\TeX\
able to compare the difference for equivalent font sizes.
The
-\opt{OpticalSize} option may be used to specify a different optical
+\feat{OpticalSize} feature may be used to specify a different optical
size.
-With \opt{OpticalSize} set
+With \feat{OpticalSize} set
to zero, no optical size font substitution is performed, as shown in
\exref{optsize0}.
@@ -545,14 +548,14 @@ of font size. For example, something like:
In rare situations users may want to mechanically distort the shapes of the glyphs in the current font such as shown in \exref{fake}. Please don't overuse these features; they are \emph{not} a good alternative to having the real shapes.
\begin{Xexample}{fake}{Articifial font transformations.}
- \fontspec{Charis SIL} \emph{ABCxyz} \quad
- \fontspec{Charis SIL}[FakeSlant=0.2] ABCxyz
+ \fontspec{Quattrocento.otf} \emph{ABCxyz} \quad
+ \fontspec{Quattrocento.otf}[FakeSlant=0.2] ABCxyz
- \fontspec{Charis SIL} ABCxyz \quad
- \fontspec{Charis SIL}[FakeStretch=1.2] ABCxyz
+ \fontspec{Quattrocento.otf} ABCxyz \quad
+ \fontspec{Quattrocento.otf}[FakeStretch=1.2] ABCxyz
- \fontspec{Charis SIL} \textbf{ABCxyz} \quad
- \fontspec{Charis SIL}[FakeBold=1.5] ABCxyz
+ \fontspec{Quattrocento.otf} \textbf{ABCxyz} \quad
+ \fontspec{Quattrocento.otf}[FakeBold=1.5] ABCxyz
\end{Xexample}
If values are omitted, their defaults are as shown above.
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
index a2ded3ca205..3869ce73430 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-doc-opentype.tex
@@ -493,7 +493,7 @@ Note the occasional inconsistency with which font features are labelled; a long-
\begin{Xexample}[firstline=2]{style-alt}{Example of the \opt{Alternate} option of the \feat{Style} feature.}
\Large
- \fontspec{Quattrocento Roman}
+ \fontspec{Quattrocento.otf}
M Q W \\
\addfontfeature{Style=Alternate}
M Q W
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
index 0f0bfedb9f3..f25ee8fbbb6 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-fontload.dtx
@@ -71,6 +71,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_primitive_font_set_hyphenchar:Nn}
+% \begin{macrocode}
+\cs_new:Nn \@@_primitive_font_set_hyphenchar:Nn
+ {
+ \tex_hyphenchar:D #1 = #2 \scan_stop:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \iffalse
% \begin{macrocode}
%</fontspec&(xetexx|luatex)>
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx
new file mode 100644
index 00000000000..f9c536f5300
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-interfaces.dtx
@@ -0,0 +1,198 @@
+% \section{User commands}\label{sec:codeuser}
+%
+% This section contains the definitions of the commands detailed in
+% the user documentation. Only the `top level' definitions of the
+% commands are contained herein; they all use or define macros which
+% are defined or used later on in \vref{sec:codeinternal}.
+%
+% \iffalse
+% \begin{macrocode}
+%<*fontspec&(xetexx|luatex)>
+% \end{macrocode}
+% \fi
+%
+% \begin{macrocode}
+\NewDocumentCommand \fontspec { O{} m O{} }
+ {
+ \@@_main_fontspec:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setmainfont { O{} m O{} }
+ {
+ \@@_main_setmainfont:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setsansfont { O{} m O{} }
+ {
+ \@@_main_setsansfont:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setmonofont { O{} m O{} }
+ {
+ \@@_main_setmonofont:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setmathrm { O{} m O{} }
+ {
+ \@@_main_setmathrm:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setboldmathrm { O{} m O{} }
+ {
+ \@@_main_setboldmathrm:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setmathsf { O{} m O{} }
+ {
+ \@@_main_setmathsf:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \setmathtt { O{} m O{} }
+ {
+ \@@_main_setmathtt:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\setromanfont}
+% This is the old name for \cs{setmainfont}, retained \emph{ad infinitum}
+% for backwards compatibility. It was deprecated in 2010.
+% \begin{macrocode}
+\NewDocumentCommand \setromanfont { O{} m O{} }
+ {
+ \@@_main_setmainfont:nn {#1,#3} {#2}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\NewDocumentCommand \newfontfamily { m O{} m O{} }
+ {
+ \@@_main_newfontfamily:nnn {#1} {#2,#4} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \newfontface { m O{} m O{} }
+ {
+ \@@_main_newfontface:nnn {#1} {#2,#4} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \defaultfontfeatures { t+ o m }
+ {
+ \@@_main_defaultfontfeatures:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \addfontfeatures {m}
+ {
+ \@@_main_addfontfeatures:n {#1}
+ }
+\NewDocumentCommand \addfontfeature {m}
+ {
+ \@@_main_addfontfeatures:n {#1}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \newfontfeature {mm}
+ {
+ \@@_main_newfontfeature:nn {#1} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \newAATfeature {mmmm}
+ {
+ \@@_main_newAATfeature:nnnn {#1} {#2} {#3} {#4}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \newopentypefeature {mmm}
+ {
+ \@@_main_newopentypefeature:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\newICUfeature}
+% Deprecated.
+% \begin{macrocode}
+\NewDocumentCommand \newICUfeature {mmm}
+ {
+ \@@_main_newopentypefeature:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\NewDocumentCommand \aliasfontfeature {mm}
+ {
+ \@@_main_aliasfontfeature:nn {#1} {#2}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \aliasfontfeatureoption {mmm}
+ {
+ \@@_main_aliasfontfeatureoption:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\newfontscript}
+% Mostly used internally, but also possibly useful for users, to define new OpenType
+% `scripts', mapping logical names to OpenType script tags.
+% \begin{macrocode}
+\NewDocumentCommand \newfontscript {mm}
+ {
+ \fontspec_new_script:nn {#1} {#2}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfontlanguage}
+% Mostly used internally, but also possibly useful for users, to define new OpenType
+% `languages', mapping logical names to OpenType language tags.
+% \begin{macrocode}
+\NewDocumentCommand \newfontlanguage {mm}
+ {
+ \fontspec_new_lang:nn {#1} {#2}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\NewDocumentCommand \DeclareFontsExtensions {m}
+ {
+ \@@_main_DeclareFontsExtensions:n {#1}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \IfFontFeatureActiveTF {mmm}
+ {
+ \@@_main_IfFontFeatureActiveTF:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \iffalse
+% \begin{macrocode}
+%</fontspec&(xetexx|luatex)>
+% \end{macrocode}
+% \fi
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
index 7c4daabcd19..0bc6e64d130 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-internal.dtx
@@ -7,7 +7,6 @@
% \fi
%
% \subsection{The main function for setting fonts}
-% \label{sec:codeinternal}
%
% \begin{macro}{\@@_select_font_family:nn}
% This is the command that defines font families for use, the underlying
@@ -75,7 +74,7 @@
% \begin{macro}{\fontspec_select:nn}
% This old name has been used by 3rd party packages so for compatibility:
% \begin{macrocode}
-\cs_set_eq:NN \fontspec_select:nn \@@_select_font_family:nn
+\cs_set_eq:NN \fontspec_select:nn \@@_select_font_family:nn %% deprecated, for compatibility only
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
index 8f790533a7c..13ed395a784 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-keyval.dtx
@@ -577,16 +577,19 @@
% \meta{glyph}, or \meta{slot}. If the input isn't the first,
% and it's one character, then it's the second; otherwise, it's
% the third.
+%
+% LuaTeX decouples hyphenation from font settings, so only \verb|HyphenChar=None| works
+% for that engine.
% \begin{macrocode}
\@@_keys_define_code:nnn {fontspec} {HyphenChar}
{
- \@@_warning:nx {only-xetex-feature} {HyphenChar}
\str_if_eq:nnTF {#1} {None}
{
\tl_put_right:Nn \l_@@_postadjust_tl
- { \hyphenchar \font = -1 \relax }
+ { \@@_primitive_font_set_hyphenchar:Nn \font {-1} }
}
{
+ \@@_warning:nx {only-xetex-feature} {HyphenChar}
\tl_if_single:nTF {#1}
{ \tl_set:Nn \l_fontspec_hyphenchar_tl {`#1} }
@@ -595,7 +598,7 @@
\@@_primitive_font_glyph_if_exist:NnTF \l_fontspec_font {\l_fontspec_hyphenchar_tl}
{
\tl_put_right:Nn \l_@@_postadjust_tl
- { \hyphenchar \font = \l_fontspec_hyphenchar_tl \scan_stop: }
+ { \@@_primitive_font_set_hyphenchar:Nn \font { \l_fontspec_hyphenchar_tl } }
}
{ \@@_error:nx {no-glyph}{#1} }
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
index 6ba11f53a0d..8ab76d375ed 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
@@ -1,9 +1,5 @@
-% \section{User commands}\label{sec:codeuser}
-%
-% This section contains the definitions of the commands detailed in
-% the user documentation. Only the `top level' definitions of the
-% commands are contained herein; they all use or define macros which
-% are defined or used later on in \vref{sec:codeinternal}.
+% \section{User command internals}
+% \label{sec:codeinternal}
%
% \iffalse
% \begin{macrocode}
@@ -11,23 +7,17 @@
% \end{macrocode}
% \fi
%
-% \subsubsection{Font selection}
+%
+% \subsection{Font selection}
% \begin{macro}{\fontspec}
% 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.
% \begin{macrocode}
-\NewDocumentCommand \fontspec { O{} m O{} }
- {
- \@@_main_fontspec:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_fontspec:nnn
+\cs_set:Nn \@@_main_fontspec:nn
{
- \fontspec_set_family:Nnn \f@family {#1,#3} {#2}
+ \fontspec_set_family:Nnn \f@family {#1} {#2}
\fontencoding { \l_@@_nfss_enc_tl }
\selectfont
\ignorespaces
@@ -42,16 +32,9 @@
% (monospaced). I end them with |\normalfont| so that if they're
% used in the document, the change registers immediately.
% \begin{macrocode}
-\DeclareDocumentCommand \setmainfont { O{} m O{} }
- {
- \@@_main_setmainfont:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_setmainfont:nnn
+\cs_set:Nn \@@_main_setmainfont:nn
{
- \fontspec_set_family:Nnn \g_@@_rmfamily_family {#1,#3} {#2}
+ \fontspec_set_family:Nnn \g_@@_rmfamily_family {#1} {#2}
\tl_set_eq:NN \rmdefault \g_@@_rmfamily_family
\use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
{
@@ -62,6 +45,7 @@
}
\str_if_eq_x:nnT {\familydefault} {\rmdefault}
{ \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
+ \@@_setmainfont_hook:nn {#1} {#2}
\normalfont
\ignorespaces
}
@@ -70,16 +54,9 @@
%
% \begin{macro}{\setsansfont}
% \begin{macrocode}
-\DeclareDocumentCommand \setsansfont { O{} m O{} }
- {
- \@@_main_setsansfont:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_setsansfont:nnn
+\cs_set:Nn \@@_main_setsansfont:nn
{
- \fontspec_set_family:Nnn \g_@@_sffamily_family {#1,#3} {#2}
+ \fontspec_set_family:Nnn \g_@@_sffamily_family {#1} {#2}
\tl_set_eq:NN \sfdefault \g_@@_sffamily_family
\use:x { \exp_not:n { \DeclareRobustCommand \sffamily }
{
@@ -90,6 +67,7 @@
}
\str_if_eq_x:nnT {\familydefault} {\sfdefault}
{ \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
+ \@@_setsansfont_hook:nn {#1} {#2}
\normalfont
\ignorespaces
}
@@ -98,16 +76,9 @@
%
% \begin{macro}{\setmonofont}
% \begin{macrocode}
-\DeclareDocumentCommand \setmonofont { O{} m O{} }
- {
- \@@_main_setmonofont:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_setmonofont:nnn
+\cs_set:Nn \@@_main_setmonofont:nn
{
- \fontspec_set_family:Nnn \g_@@_ttfamily_family {#1,#3} {#2}
+ \fontspec_set_family:Nnn \g_@@_ttfamily_family {#1} {#2}
\tl_set_eq:NN \ttdefault \g_@@_ttfamily_family
\use:x { \exp_not:n { \DeclareRobustCommand \ttfamily }
{
@@ -118,6 +89,7 @@
}
\str_if_eq_x:nnT {\familydefault} {\ttdefault}
{ \tl_set_eq:NN \encodingdefault \l_@@_nfss_enc_tl }
+ \@@_setmonofont_hook:nn {#1} {#2}
\normalfont
\ignorespaces
}
@@ -125,89 +97,76 @@
% \end{macro}
%
%
-% \begin{macro}{\setromanfont}
-% This is the old name for \cs{setmainfont}, retained \emph{ad infinitum}
-% for backwards compatibility. It was deprecated in 2010.
-% \begin{macrocode}
-\DeclareDocumentCommand \setromanfont { O{} m O{} }
- {
- \@@_main_setmainfont:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-% \end{macro}
%
%
% \begin{macro}{\setmathrm}
-% \begin{macro}{\setmathsf}
-% \begin{macro}{\setboldmathrm}
-% \begin{macro}{\setmathtt}
% These commands are analogous to \cmd\setmainfont\ and others,
% but for selecting the font used for \cmd\mathrm, \etc. They
% can only be used in the preamble of the
% document. \cmd\setboldmathrm\ is used for specifying which
% fonts should be used in \cmd\boldmath.
% \begin{macrocode}
-\DeclareDocumentCommand \setmathrm { O{} m O{} }
+\cs_set:Nn \@@_main_setmathrm:nn
{
- \@@_main_setmathrm:nnn {#1} {#2} {#3}
+%<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}
+% \end{macro}
%
+% \begin{macro}{\setboldmathrm}
% \begin{macrocode}
-\cs_set:Nn \@@_main_setmathrm:nnn
- {
- \fontspec_set_family:Nnn \g_@@_mathrm_tl {#1} {#2}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareDocumentCommand \setboldmathrm { O{} m O{} }
+\cs_set:Nn \@@_main_setboldmathrm:nn
{
- \@@_main_setboldmathrm:nnn {#1} {#2} {#3}
+%<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}
+% \end{macro}
%
+% \begin{macro}{\setmathsf}
% \begin{macrocode}
-\cs_set:Nn \@@_main_setboldmathrm:nnn
- {
- \fontspec_set_family:Nnn \g_@@_bfmathrm_tl {#1} {#2}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareDocumentCommand \setmathsf { O{} m O{} }
+\cs_set:Nn \@@_main_setmathsf:nn
{
- \@@_main_setmathsf:nnn {#1} {#2} {#3}
+%<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}
+% \end{macro}
%
+% \begin{macro}{\setmathtt}
% \begin{macrocode}
-\cs_set:Nn \@@_main_setmathsf:nnn
- {
- \fontspec_set_family:Nnn \g_@@_mathsf_tl {#1} {#2}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\DeclareDocumentCommand \setmathtt { O{} m O{} }
+\cs_set:Nn \@@_main_setmathtt:nn
{
- \@@_main_setmathtt:nnn {#1} {#2} {#3}
+%<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}
+% \end{macro}
%
+% Hooks:
% \begin{macrocode}
-\cs_set:Nn \@@_main_setmathtt:nnn
- {
- \fontspec_set_family:Nnn \g_@@_mathtt_tl {#1} {#2}
- }
+\cs_set_eq:NN \@@_setmainfont_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setsansfont_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setmonofont_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setmathrm_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setmathsf_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setmathtt_hook:nn \use_none:nn
+\cs_set_eq:NN \@@_setboldmathrm_hook:nn \use_none:nn
% \end{macrocode}
%
+% Hmm, this isn't necessary with \pkg{unicode-math}; oh well:
% \begin{macrocode}
\@onlypreamble\setmathrm
\@onlypreamble\setboldmathrm
\@onlypreamble\setmathsf
\@onlypreamble\setmathtt
% \end{macrocode}
+%
% If the commands above are not executed, then \cmd\rmdefault\ (\etc)
% will be used.
% \begin{macrocode}
@@ -215,8 +174,6 @@
\tl_set:Nn \g_@@_mathsf_tl {\sfdefault}
\tl_set:Nn \g_@@_mathtt_tl {\ttdefault}
% \end{macrocode}
-% \end{macro} \end{macro} \end{macro}
-% \end{macro}
%
% \begin{macro}{\newfontfamily}
% This macro takes the arguments of \cs{fontspec} with a prepended
@@ -230,16 +187,9 @@
% \cs{l_fontspec_family_tl}. This family is then used in a typical NFSS \cmd\fontfamily\
% declaration, saved in the macro name specified.
% \begin{macrocode}
-\DeclareDocumentCommand \newfontfamily { m O{} m O{} }
- {
- \@@_main_newfontfamily:nnnn {#1} {#2} {#3} {#4}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_newfontfamily:nnnn
+\cs_set:Nn \@@_main_newfontfamily:nnn
{
- \fontspec_set_family:cnn { g_@@_ \cs_to_str:N #1 _family } {#2,#4} {#3}
+ \fontspec_set_family:cnn { g_@@_ \cs_to_str:N #1 _family } {#2} {#3}
\use:x
{
\exp_not:N \DeclareRobustCommand \exp_not:N #1
@@ -256,21 +206,14 @@
% \begin{macro}{\newfontface}
% \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}
-\DeclareDocumentCommand \newfontface { m O{} m O{} }
- {
- \@@_main_newfontface:nnnn {#1} {#2} {#3} {#4}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\cs_set:Nn \@@_main_newfontface:nnnn
+\cs_set:Nn \@@_main_newfontface:nnn
{
- \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3}
+ \newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2 ] {#3}
}
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{Font feature selection}
+% \subsection{Font feature selection}
%
% \begin{macro}{\defaultfontfeatures}
% This macro takes one argument that consists of all of feature
@@ -279,15 +222,17 @@
% \cs{g_fontspec_default_fontopts_tl} (initialised empty), which is
% concatenated with the individual macro choices in the
% [...] macro.
-%
% \begin{macrocode}
-\DeclareDocumentCommand \defaultfontfeatures { t+ o m }
+\cs_set: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
@@ -345,13 +290,6 @@
% \cs{addfontfeature} is defined as an alias, as I found that I
% often typed this instead when adding only a single font feature.
% \begin{macrocode}
-\DeclareDocumentCommand \addfontfeatures {m}
- {
- \@@_main_addfontfeatures:n {#1}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_addfontfeatures:n
{
%<debug> \typeout{^^J::::::::::::::::::::::::::::::::::^^J: addfontfeatures}
@@ -376,24 +314,16 @@
}
\ignorespaces
}
-\cs_set_eq:NN \addfontfeature \addfontfeatures
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{Defining new font features}
+% \subsection{Defining new font features}
%
% \begin{macro}{\newfontfeature}
% \cs{newfontfeature} takes two arguments: the name of the feature
% tag by which to reference it, and the string that is used to
% select the font feature.
% \begin{macrocode}
-\DeclareDocumentCommand \newfontfeature {mm}
- {
- \@@_main_newfontfeature:nn {#1} {#2}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_newfontfeature:nn
{
\keys_define:nn { fontspec }
@@ -413,13 +343,6 @@
% Better than \cmd\newfontfeature\ because it checks if the feature exists in the
% font it's being used for.
% \begin{macrocode}
-\DeclareDocumentCommand \newAATfeature {mmmm}
- {
- \@@_main_newAATfeature:nnnn {#1} {#2} {#3} {#4}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_newAATfeature:nnnn
{
\keys_if_exist:nnF { fontspec } {#1}
@@ -438,13 +361,6 @@
% Better than \cmd\newfontfeature\ because it checks if the feature exists in the
% font it's being used for.
% \begin{macrocode}
-\DeclareDocumentCommand \newopentypefeature {mmm}
- {
- \@@_main_newopentypefeature:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_newopentypefeature:nnn
{
\keys_if_exist:nnF { fontspec / options } {#1}
@@ -467,27 +383,11 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\newICUfeature}
-% Deprecated.
-% \begin{macrocode}
-\DeclareDocumentCommand \newICUfeature {mmm}
- {
- \@@_main_newopentypefeature:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-% \end{macro}
%
%
% \begin{macro}{\aliasfontfeature}
% User commands for renaming font features and font feature options.
% \begin{macrocode}
-\DeclareDocumentCommand \aliasfontfeature {mm}
- {
- \@@_main_aliasfontfeature:nn {#1} {#2}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_aliasfontfeature:nn
{
%<debug> \typeout{::::::::::::::::::::^^J:: aliasfontfeature{#1}{#2}}
@@ -512,13 +412,6 @@
%
% \begin{macro}{\aliasfontfeatureoption}
% \begin{macrocode}
-\DeclareDocumentCommand \aliasfontfeatureoption {mmm}
- {
- \@@_main_aliasfontfeatureoption:nnn {#1} {#2} {#3}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_aliasfontfeatureoption:nnn
{
\bool_set_false:N \l_@@_alias_bool
@@ -554,57 +447,24 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\newfontscript}
-% Mostly used internally, but also possibly useful for users, to define new OpenType
-% `scripts', mapping logical names to OpenType script tags.
-% \begin{macrocode}
-\DeclareDocumentCommand \newfontscript {mm}
- {
- \fontspec_new_script:nn {#1} {#2}
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\newfontlanguage}
-% Mostly used internally, but also possibly useful for users, to define new OpenType
-% `languages', mapping logical names to OpenType language tags.
-% \begin{macrocode}
-\DeclareDocumentCommand \newfontlanguage {mm}
- {
- \fontspec_new_lang:nn {#1} {#2}
- }
-% \end{macrocode}
-% \end{macro}
-%
%
% \begin{macro}{\DeclareFontsExtensions}
% \texttt{dfont} would never be uppercase, right?
% \begin{macrocode}
-\DeclareDocumentCommand \DeclareFontsExtensions {m}
- {
- \@@_main_DeclareFontsExtensions:n {#1}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_set:Nn \@@_main_DeclareFontsExtensions:n
{
\clist_set:Nn \l_@@_extensions_clist { #1 }
\tl_remove_all:Nn \l_@@_extensions_clist {~}
}
-\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
% \end{macrocode}
-% \end{macro}
-
-
-% \begin{macro}{\IfFontFeatureActiveTF}
+%
% \begin{macrocode}
-\DeclareDocumentCommand \IfFontFeatureActiveTF {mmm}
- {
- \@@_main_IfFontFeatureActiveTF:nnn {#1} {#2} {#3}
- }
+\DeclareFontsExtensions{.otf,.ttf,.OTF,.TTF,.ttc,.TTC,.dfont}
% \end{macrocode}
+% \end{macro}
%
+%
+% \begin{macro}{\IfFontFeatureActiveTF}
% \begin{macrocode}
\cs_set:Nn \@@_main_IfFontFeatureActiveTF:nnn
{
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
index 06b3f7ae308..4b271817da0 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
@@ -41,6 +41,7 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf.
\DTX{fontspec-msg.dtx}
\DTX{fontspec-opening.dtx}
\DTX{fontspec-fontload.dtx}
+ \DTX{fontspec-interfaces.dtx}
\DTX{fontspec-user.dtx}
\DTX{fontspec-api.dtx}
\DTX{fontspec-internal.dtx}
@@ -58,10 +59,10 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf.
\DTX{fontspec-patches.dtx}
}
-\def\DTX#1{\from{#1}{fontspec,xetexx\FSDEBUG}}
+\def\DTX#1{\from{#1}{fontspec,XE,xetexx\FSDEBUG}}
\generate{\file{fontspec-xetex.sty}{\FONTSPECDTX}}
-\def\DTX#1{\from{#1}{fontspec,luatex\FSDEBUG}}
+\def\DTX#1{\from{#1}{fontspec,LU,luatex\FSDEBUG}}
\generate{\file{fontspec-luatex.sty}{\FONTSPECDTX}}
\def\tmpa{plain}
@@ -79,14 +80,14 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf.
%<fontspec&xetexx>\ProvidesExplPackage{fontspec-xetex}%
%<fontspec&luatex>\ProvidesExplPackage{fontspec-luatex}%
%<*fontspec>
- {2017/08/14}{2.6d}{Font selection for XeLaTeX and LuaLaTeX}
+ {2017/09/22}{2.6e}{Font selection for XeLaTeX and LuaLaTeX}
%</fontspec>
%<lua>fontspec = fontspec or {}
%<lua>local fontspec = fontspec
%<lua>fontspec.module = {
%<lua> name = "fontspec",
-%<lua> version = "2.6d",
-%<lua> date = "2017/08/14",
+%<lua> version = "2.6e",
+%<lua> date = "2017/09/27",
%<lua> description = "Font selection for XeLaTeX and LuaLaTeX",
%<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson",
%<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",