summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-05-11 20:36:43 +0000
committerKarl Berry <karl@freefriends.org>2024-05-11 20:36:43 +0000
commit67a321d98ede4649e46d620bbb9837a7c9fb5fd1 (patch)
treeba3884fb80109f9224408a71b07653298cecfc28 /Master/texmf-dist/source/latex
parent6c0edfd9f3be4d992a7e31152995de2a2808efe0 (diff)
fontspec (11may24)
git-svn-id: svn://tug.org/texlive/trunk@71237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx2
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx63
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx71
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx12
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx12
-rw-r--r--Master/texmf-dist/source/latex/fontspec/fontspec.dtx6
6 files changed, 93 insertions, 73 deletions
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx
index 2b210124725..3ce9edc230f 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx
@@ -233,7 +233,7 @@
\prop_get:cnN {g_@@_fontinfo_ \f@family _prop} {script-tag} \l_@@_script_tl
\prop_get:cnN {g_@@_fontinfo_ \f@family _prop} {lang-tag} \l_@@_lang_tl
- \@@_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:}
+ \@@_check_ot_feat:NnnnTF \font {#1} {\l_@@_lang_tl} {\l_@@_script_tl} {\prg_return_true:} {\prg_return_false:}
}
{
\prg_return_false:
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
index 5fbd797f445..b4d5db73f31 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx
@@ -476,7 +476,7 @@
\bool_if:NF \l_@@_scriptlang_exist_bool
{
%<debug>\typeout{Script~not~found!}
- \@@_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1}
+ \@@_info:nxx {script-not-exist} {\l_fontspec_fontname_tl} {#1}
\clist_set:Nn \l_tmpa_clist {#2}
\clist_get:NN \l_tmpa_clist \l_@@_script_tl
\exp_args:Noo \@@_check_script:NnF \l_@@_fontface_cs_tl \l_@@_script_tl
@@ -489,37 +489,42 @@
}
}
}
-\cs_new:Nn \fontspec_default_script:nn
+% \end{macrocode}
+% When script is not explicitly requested, use this list:
+% \begin{macrocode}
+\clist_new:N \g_@@_default_scripts_clist
+\cs_new:Nn \fontspec_default_script:n
{
- \keys_define:nn {fontspec-opentype} { Script / #1 .code:n =
+ \clist_gset:Nn \g_@@_default_scripts_clist {#1}
+ }
+\fontspec_default_script:n {latn,DFLT}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_define:nn {fontspec-opentype} { Script / CustomDefault .code:n =
+ {
+%<debug>\typeout{Trying~CustomDefault~Script}
+ \bool_set_false:N \l_@@_scriptlang_exist_bool
+ \clist_map_inline:Nn \g_@@_default_scripts_clist
{
-%<debug>\typeout{Trying~[Script=#1:#2]}
- \bool_set_false:N \l_@@_scriptlang_exist_bool
- \clist_map_inline:nn {#2}
+ \exp_args:No \@@_check_script:NnT \l_@@_fontface_cs_tl {##1}
{
- \exp_args:No \@@_check_script:NnT \l_@@_fontface_cs_tl {####1}
- {
-%<debug>\typeout{Script~tag~found:~####1}
- \tl_set:Nn \l_@@_script_name_tl {#1}
- \tl_set:Nn \l_@@_script_tl {####1}
- \int_set:Nn \l_@@_script_int {\l_@@_strnum_int}
- \bool_set_true:N \l_@@_scriptlang_exist_bool
- \tl_gset:Nx \g_@@_single_feat_tl { script=####1 }
- \clist_map_break:
- }
+%<debug>\typeout{Script~tag~found:~##1}
+ \tl_set:Nn \l_@@_script_name_tl {Default (##1)}
+ \tl_set:Nn \l_@@_script_tl {##1}
+ \int_set:Nn \l_@@_script_int {\l_@@_strnum_int}
+ \bool_set_true:N \l_@@_scriptlang_exist_bool
+ \tl_gset:Nx \g_@@_single_feat_tl { script=##1 }
+ \clist_map_break:
}
- \bool_if:NF \l_@@_scriptlang_exist_bool
- {
+ }
+ \bool_if:NF \l_@@_scriptlang_exist_bool
+ {
%<debug>\typeout{Script~not~found!}
- \tl_clear:N \l_@@_script_name_tl
- }
+ \tl_clear:N \l_@@_script_name_tl
}
- }
}
-% \end{macrocode}
-% When script is not explicitly requested, use this list:
-% \begin{macrocode}
-\fontspec_default_script:nn {CustomDefault} {latn,DFLT}
+}
% \end{macrocode}
%
%
@@ -553,7 +558,7 @@
\bool_if:NF \l_@@_scriptlang_exist_bool
{
%<debug>\typeout{Lang~not~found!}
- \@@_warning:nx {language-not-exist} {#1}
+ \@@_info:nx {language-not-exist} {#1}
\clist_set:Nn \l_tmpa_clist {#2}
\clist_get:NN \l_tmpa_clist \l_@@_lang_tl
\exp_args:Noo \@@_check_lang:NnF \l_@@_fontface_cs_tl \l_@@_lang_tl
@@ -574,6 +579,12 @@
% language is hardcoded to have a zero value,
% although this might be some \XeTeX-specific thing.
% \begin{macrocode}
+\clist_new:N \g_@@_default_langs_clist
+\cs_new:Nn \fontspec_default_lang:n
+ {
+ \clist_gset:Nn \g_@@_default_langs_clist {#1}
+ }
+\fontspec_default_lang:n {dflt}
\@@_keys_define_code:nnn {fontspec-opentype} { Language / Default }
{
\tl_set:Nn \l_@@_lang_tl {dflt}
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx
index fd52183c183..b454143ef5a 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx
@@ -787,7 +787,7 @@
% "normal"
\@@_load_fontname:Nn \l_fontspec_fontname_tl {\l_@@_sizedfont_tl}
- \@@_setup_nfss:Nnnn \l_@@_nfss_tl {#1} {\l_@@_sizing_leftover_clist} {}
+ \@@_setup_nfss:Nn \l_@@_nfss_tl { #1 , \l_@@_sizing_leftover_clist }
%<debug> \typeout{===~ sized~ font:~ \l_@@_sizedfont_tl}
% small caps
@@ -812,20 +812,22 @@
\bool_if:NF \l_@@_nosc_bool
{
- \@@_setup_nfss:Nnnn \l_@@_nfss_sc_tl
- {#1} {\l_@@_sizing_leftover_clist} {\l_@@_fontfeat_curr_clist}
+ \@@_setup_nfss:Nn \l_@@_nfss_sc_tl
+ {#1 , \l_@@_sizing_leftover_clist , \l_@@_fontfeat_curr_clist}
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_setup_nfss:Nnnn}
+% \begin{macro}{\@@_setup_nfss:Nn}
% \begin{macrocode}
-\cs_new:Nn \@@_setup_nfss:Nnnn
+\cs_new:Nn \@@_setup_nfss:Nn
{
%<debug>\typeout{====~Setup~NFSS~shape:~<\l_@@_size_tl>~\l_fontspec_fontname_tl}
+%<debug>\typeout{====~Requested~features:~#2}
+
+ \@@_get_features:n { #2 }
- \@@_get_features:n { #2 , #3 , #4 }
%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist \@@_get_variations:}
\tl_if_empty:NF \l_@@_scale_tl
@@ -976,22 +978,25 @@
} (#1/#2)~
with~ NFSS~ spec.:~
\l_@@_nfss_tl
- \exp_not:n { \\ }
- -~ \exp_not:N \str_case:nn { #1 / \@@_combo_sc_shape:n {#2} }
- {
- {\mddefault/\scdefault} {'small~ caps'~}
- {\bfdefault/\scdefault} {'bold~ small~ caps'~}
- {\mddefault/\scitdefault} {'italic~ small~ caps'~}
- {\bfdefault/\scitdefault} {'bold~ italic~ small~ caps'~}
- {\mddefault/\scsldefault} {'slanted~ small~ caps'~}
- {\bfdefault/\scsldefault} {'bold~ slanted~ small~ caps'~}
- }~( #1 / \@@_combo_sc_shape:n {#2} )~
- with~ NFSS~ spec.:~
- \l_@@_nfss_sc_tl
- \tl_if_empty:fF {\l_@@_postadjust_tl}
+ \tl_if_empty:NF \l_@@_nfss_sc_tl
{
- \exp_not:N \\ and~ font~ adjustment~ code:
- \exp_not:N \\ \l_@@_postadjust_tl
+ \exp_not:n { \\ }
+ -~ \exp_not:N \str_case:nn { #1 / \@@_combo_sc_shape:n {#2} }
+ {
+ {\mddefault/\scdefault} {'small~ caps'~}
+ {\bfdefault/\scdefault} {'bold~ small~ caps'~}
+ {\mddefault/\scitdefault} {'italic~ small~ caps'~}
+ {\bfdefault/\scitdefault} {'bold~ italic~ small~ caps'~}
+ {\mddefault/\scsldefault} {'slanted~ small~ caps'~}
+ {\bfdefault/\scsldefault} {'bold~ slanted~ small~ caps'~}
+ }~( #1 / \@@_combo_sc_shape:n {#2} )~
+ with~ NFSS~ spec.:~
+ \l_@@_nfss_sc_tl
+ \tl_if_empty:fF {\l_@@_postadjust_tl}
+ {
+ \exp_not:N \\ and~ font~ adjustment~ code:
+ \exp_not:N \\ \l_@@_postadjust_tl
+ }
}
}
}
@@ -1028,16 +1033,30 @@
% \end{macro}
%
%
+% \begin{macro}{\@@_make_smallcaps:TF}
% \begin{macro}{\@@_make_ot_smallcaps:TF}
% \label{mac:makesmallcaps}
% This macro checks if the font contains small caps.
% \begin{macrocode}
-%<LU>\cs_new:Nn \@@_make_smallcaps:TF
-%<XE>\cs_new:Nn \@@_make_ot_smallcaps:TF
+\cs_new:Nn \@@_make_ot_smallcaps:TF
{
- \exp_args:No \@@_check_ot_feat:NnTF \l_@@_fontface_cs_tl {smcp} {#1} {#2}
+ \bool_set_false:N \l_@@_tmpa_bool
+ \exp_args:Ne \clist_map_inline:nn { \l_@@_lang_tl , \g_@@_default_langs_clist }
+ {
+ \exp_args:Ne \clist_map_inline:nn { \l_@@_script_tl , \g_@@_default_scripts_clist }
+ {
+ \exp_args:No \@@_check_ot_feat:NnnnT \l_@@_fontface_cs_tl {smcp} {##1} {####1}
+ {
+%<debug>\typeout{SMCP~found~for~script/lang: ####1/##1~-~assuming~okay}
+ \bool_set_true:N \l_@@_tmpa_bool
+ \clist_map_break:
+ }
+ }
+ }
+ \bool_if:NTF \l_@@_tmpa_bool {#1} {#2}
}
-%<*XE>
+% \end{macrocode}
+% \begin{macrocode}
\cs_new:Nn \@@_make_smallcaps:TF
{
\bool_if:NTF \l_@@_ot_bool
@@ -1050,9 +1069,9 @@
}
}
}
-%</XE>
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_update_featstr:n}
% \cmd{\g_@@_rawfeatures_sclist} is the string used to define the list of specific
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx
index 2904f7350e1..9def7adde60 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx
@@ -153,6 +153,12 @@
{
'#1' doesn't appear to have an Optical Size axis.
}
+\@@_msg_new:nn {script-not-exist}
+ {
+ Script '#2' not explicitly supported within font '#1'.
+ Check the typeset output, and if it is okay then ignore this warning.
+ Otherwise a different font should be chosen.
+ }
\@@_msg_new:nn {language-not-exist}
{
Language '#1' not explicitly supported
@@ -232,12 +238,6 @@
{
Adjusting the maths setup (use [no-math] to avoid this).
}
-\@@_msg_new:nn {no-script}
- {
- Script '#2' not explicitly supported within font '#1'.
- Check the typeset output, and if it is okay then ignore this warning.
- Otherwise a different font should be chosen.
- }
\@@_msg_new:nn {opa-twice}
{
Opacity set twice, in both Colour and Opacity.\\
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
index dab45952c6e..81c1d2b0415 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx
@@ -258,7 +258,6 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_check_ot_feat:NnTF}
% \begin{macro}{\@@_check_ot_feat:NnnnTF}
% This macro takes an OpenType feature tag and checks if it exists in the current
% font/script/language.
@@ -267,15 +266,7 @@
% number corresponding to `|latn|'. The language used is \cmd\l_@@_language_int,
% by default |0|, the `default language'.
% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_check_ot_feat:Nn {TF,F}
- {
- \@@_check_ot_feat:NnnnTF #1 {#2} {\l_@@_lang_tl} {\l_@@_script_tl}
- {\prg_return_true:} {\prg_return_false:}
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\prg_new_conditional:Nnn \@@_check_ot_feat:Nnnn {TF,F}
+\prg_new_conditional:Nnn \@@_check_ot_feat:Nnnn {TF,T,F}
{
\bool_if:NTF \l_@@_never_check_bool
{ \prg_return_true: }
@@ -325,7 +316,6 @@
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \subsection{OpenType feature information}
%
diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
index ea7bbffe55e..4a9e99b18fc 100644
--- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
+++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx
@@ -70,7 +70,7 @@
\ProvidesExplFile{fontspec.dtx}
%</dtx>
%<*fontspec>
- {2024/05/07}{2.9d}{Font selection for XeLaTeX and LuaLaTeX}
+ {2024/05/11}{2.9e}{Font selection for XeLaTeX and LuaLaTeX}
%</fontspec>
% \end{macrocode}
%
@@ -89,8 +89,8 @@
%<lua>local fontspec = fontspec
%<lua>fontspec.module = {
%<lua> name = "fontspec",
-%<lua> version = "2.9d",
-%<lua> date = "2024/05/07",
+%<lua> version = "2.9e",
+%<lua> date = "2024/05/11",
%<lua> description = "Font selection for XeLaTeX and LuaLaTeX",
%<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson",
%<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",