summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-31 23:22:58 +0000
committerKarl Berry <karl@freefriends.org>2017-03-31 23:22:58 +0000
commit3e7a5bba844bbc4aca70a24ec2f32ee902592c98 (patch)
treed8e7ec389eca093b1a75b770cfd7127306fe8267 /Master/texmf-dist/source
parent49ec51835aa8913d04026b0b07cd1bbe1b379d0f (diff)
fontspec (31mar17)
git-svn-id: svn://tug.org/texlive/trunk@43661 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx32
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx200
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec.dtx6
3 files changed, 205 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx
index 5e04573ff23..949e95ca1b1 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-opentype.dtx
@@ -35,17 +35,27 @@
}
}
\cs_new:Nn \@@_define_opentype_feature:nnnnn
- {
- \@@_feat_prop_add:nn {#3} {#1\,=\,#2}
- \keys_define:nn {fontspec-opentype}
- {
- #1/#2 .code:n =
- {
-%<debug> \typeout{::::::::fontspec-opentype~#1/#2~=~#3/#4/#5}
- \@@_make_OT_feature:nnn {#3} {#4} {#5}
- }
- }
- }
+ {
+ \@@_feat_prop_add:nn {#3} {#1\,=\,#2}
+ \tl_if_empty:nTF {#4}
+ {
+ \keys_define:nn {fontspec-opentype}
+ {
+ #1/#2 .code:n =
+ { \@@_remove_clashing_featstr:n {#5} }
+ }
+ }
+ {
+ \keys_define:nn {fontspec-opentype}
+ {
+ #1/#2 .code:n =
+ {
+%<debug> \typeout{::::::::fontspec-opentype~#1/#2~=~#3/#4/#5}
+ \@@_make_OT_feature:nnn {#3} {#4} {#5}
+ }
+ }
+ }
+ }
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
index 89fe42b971e..ed835193426 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-user.dtx
@@ -19,6 +19,13 @@
% 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
{
\fontspec_set_family:Nnn \f@family {#1,#3} {#2}
\fontencoding { \l_@@_nfss_enc_tl }
@@ -36,6 +43,13 @@
% 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
{
\fontspec_set_family:Nnn \g_@@_rmfamily_family {#1,#3} {#2}
\tl_set_eq:NN \rmdefault \g_@@_rmfamily_family
@@ -57,6 +71,13 @@
% \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
{
\fontspec_set_family:Nnn \g_@@_sffamily_family {#1,#3} {#2}
\tl_set_eq:NN \sfdefault \g_@@_sffamily_family
@@ -78,6 +99,13 @@
% \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
{
\fontspec_set_family:Nnn \g_@@_ttfamily_family {#1,#3} {#2}
\tl_set_eq:NN \ttdefault \g_@@_ttfamily_family
@@ -101,7 +129,10 @@
% This is the old name for \cs{setmainfont}, retained \emph{ad infinitum}
% for backwards compatibility. It was deprecated in 2010.
% \begin{macrocode}
-\cs_set_eq:NN \setromanfont \setmainfont
+\DeclareDocumentCommand \setromanfont { O{} m O{} }
+ {
+ \@@_main_setmainfont:nnn {#1} {#2} {#3}
+ }
% \end{macrocode}
% \end{macro}
%
@@ -117,24 +148,61 @@
% fonts should be used in \cmd\boldmath.
% \begin{macrocode}
\DeclareDocumentCommand \setmathrm { O{} m O{} }
+ {
+ \@@_main_setmathrm:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \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{} }
+ {
+ \@@_main_setboldmathrm:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \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{} }
+ {
+ \@@_main_setmathsf:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \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{} }
+ {
+ \@@_main_setmathtt:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_set:Nn \@@_main_setmathtt:nnn
{
\fontspec_set_family:Nnn \g_@@_mathtt_tl {#1} {#2}
}
+% \end{macrocode}
+%
+% \begin{macrocode}
\@onlypreamble\setmathrm
\@onlypreamble\setboldmathrm
\@onlypreamble\setmathsf
@@ -163,6 +231,13 @@
% 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
{
\fontspec_set_family:cnn { g_@@_ \cs_to_str:N #1 _family } {#2,#4} {#3}
\use:x
@@ -182,6 +257,13 @@
% \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
{
\newfontfamily #1 [ BoldFont={},ItalicFont={},SmallCapsFont={},#2,#4 ] {#3}
}
@@ -200,17 +282,17 @@
%
% \begin{macrocode}
\DeclareDocumentCommand \defaultfontfeatures { t+ o m }
- {
- \IfNoValueTF {#2}
- { \@@_set_default_features:nn {#1} {#3} }
- { \@@_set_font_default_features:nnn {#1} {#2} {#3} }
- \ignorespaces
- }
+ {
+ \IfNoValueTF {#2}
+ { \@@_set_default_features:nn {#1} {#3} }
+ { \@@_set_font_default_features:nnn {#1} {#2} {#3} }
+ \ignorespaces
+ }
\cs_new:Nn \@@_set_default_features:nn
- {
- \IfBooleanTF {#1} \clist_put_right:Nn \clist_set:Nn
- \g_@@_default_fontopts_clist {#2}
- }
+ {
+ \IfBooleanTF {#1} \clist_put_right:Nn \clist_set:Nn
+ \g_@@_default_fontopts_clist {#2}
+ }
% \end{macrocode}
% The optional argument specifies a font identifier.
% Branch for either (a)~single token input such as \verb|\rmdefault|, or (b)~otherwise assume its a fontname.
@@ -264,6 +346,13 @@
% 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}
\fontspec_if_fontspec_font:TF
@@ -299,6 +388,13 @@
% 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 }
{
@@ -318,11 +414,20 @@
% 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}
{ \@@_define_aat_feature_group:n {#1} }
+
\keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
{ \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
+
\@@_define_aat_feature:nnnn {#1}{#2}{#3}{#4}
}
% \end{macrocode}
@@ -334,6 +439,13 @@
% 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}
{ \@@_define_opentype_feature_group:n {#1} }
@@ -341,19 +453,27 @@
\keys_if_choice_exist:nnnT {fontspec} {#1} {#2}
{ \@@_warning:nxx {feature-option-overwrite} {#1} {#2} }
- \exp_args:Nnnx \@@_define_opentype_feature:nnnnn {#1}{#2}{ \@@_strip_plus_minus:n {#3} }{#3}{}
+ \exp_args:Nnnx \@@_define_opentype_feature:nnnnn
+ {#1} {#2} { \@@_strip_plus_minus:n {#3} } {#3} {}
}
-
+% \end{macrocode}
+%
+% \begin{macrocode}
\cs_new:Nn \@@_strip_plus_minus:n { \@@_strip_plus_minus_aux:Nq #1 \q_nil }
\cs_new:Npn \@@_strip_plus_minus_aux:Nq #1#2 \q_nil
- { \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2} }
-
+ {
+ \str_case:nnF {#1} { {+} {#2} {-} {#2} } {#1#2}
+ }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newICUfeature}
+% Deprecated.
% \begin{macrocode}
-\cs_set_eq:NN \newICUfeature \newopentypefeature % deprecated
+\DeclareDocumentCommand \newICUfeature {mmm}
+ {
+ \@@_main_newopentypefeature:nnn {#1} {#2} {#3}
+ }
% \end{macrocode}
% \end{macro}
%
@@ -362,6 +482,13 @@
% 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}}
\bool_set_false:N \l_@@_alias_bool
@@ -386,6 +513,13 @@
% \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
@@ -398,6 +532,20 @@
\keys_define:nn { ##1 / #1 }
{ #3 .code:n = { \keys_set:nn {##1} { #1 = {#2} } } }
}
+
+ \keys_if_exist:nnT { ##1 / #1 } {#2Reset}
+ {
+%<debug> \typeout{:::: Keyval~exists~##1~/~#1~=~#2Reset}
+ \keys_define:nn { ##1 / #1 }
+ { #3Reset .code:n = { \keys_set:nn {##1} { #1 = {#2Reset} } } }
+ }
+
+ \keys_if_exist:nnT { ##1 / #1 } {#2Off}
+ {
+%<debug> \typeout{:::: Keyval~exists~##1~/~#1~=~#2Off}
+ \keys_define:nn { ##1 / #1 }
+ { #3Off .code:n = { \keys_set:nn {##1} { #1 = {#2Off} } } }
+ }
}
\bool_if:NF \l_@@_alias_bool
@@ -433,6 +581,13 @@
% \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 {~}
@@ -446,6 +601,13 @@
% \begin{macrocode}
\DeclareDocumentCommand \IfFontFeatureActiveTF {mmm}
{
+ \@@_main_IfFontFeatureActiveTF:nnn {#1} {#2} {#3}
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_set:Nn \@@_main_IfFontFeatureActiveTF:nnn
+ {
%<debug> \typeout{^^J:::::::::::::::::::::::::::::::::::::::::::::::}
%<debug> \typeout{:IfFontFeatureActiveTF \exp_not:n{{#1}{#2}{#3}}}
\@@_if_font_feature:nTF {#1} {#2} {#3}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
index 504b41c337a..e460179754e 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
@@ -79,14 +79,14 @@ And the derived files: fontspec*.sty,fontspec.lua, fontspec.pdf.
%<fontspec&xetexx>\ProvidesExplPackage{fontspec-xetex}%
%<fontspec&luatex>\ProvidesExplPackage{fontspec-luatex}%
%<*fontspec>
- {2017/02/12}{2.6}{Font selection for XeLaTeX and LuaLaTeX}
+ {2017/03/31}{2.6a}{Font selection for XeLaTeX and LuaLaTeX}
%</fontspec>
%<lua>fontspec = fontspec or {}
%<lua>local fontspec = fontspec
%<lua>fontspec.module = {
%<lua> name = "fontspec",
-%<lua> version = "2.6",
-%<lua> date = "2017/02/12",
+%<lua> version = "2.6a",
+%<lua> date = "2017/03/31",
%<lua> description = "Font selection for XeLaTeX and LuaLaTeX",
%<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson",
%<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",