diff options
author | Karl Berry <karl@freefriends.org> | 2024-05-11 20:36:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-05-11 20:36:43 +0000 |
commit | 67a321d98ede4649e46d620bbb9837a7c9fb5fd1 (patch) | |
tree | ba3884fb80109f9224408a71b07653298cecfc28 /Master | |
parent | 6c0edfd9f3be4d992a7e31152995de2a2808efe0 (diff) |
fontspec (11may24)
git-svn-id: svn://tug.org/texlive/trunk@71237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/CHANGES.md | 13 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf | bin | 704184 -> 686785 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/fontspec/fontspec.pdf | bin | 496860 -> 524650 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-api.dtx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx | 63 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx | 71 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx | 12 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx | 12 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec.dtx | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty | 143 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty | 131 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.lua | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.sty | 2 |
13 files changed, 271 insertions, 188 deletions
diff --git a/Master/texmf-dist/doc/latex/fontspec/CHANGES.md b/Master/texmf-dist/doc/latex/fontspec/CHANGES.md index 47c3b7128e2..638e4563565 100644 --- a/Master/texmf-dist/doc/latex/fontspec/CHANGES.md +++ b/Master/texmf-dist/doc/latex/fontspec/CHANGES.md @@ -1,6 +1,19 @@ Change history ============== +## v2.9e (2024/05/11) + + * Fix regression with automatic detection and selection of small caps when the font + script or language was requested but not found. (#517) + + * Add additional tests to check against regressions. (#516, #518) + + * Improve message in log file when defining a font without small caps. + + * Demote warnings when Script or Language are requested but not found to the log file + instead of the console. (#421) + + ## v2.9d (2024/05/07) * Now that `Script` and `Language` are retained even if the font doesn't support them, diff --git a/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf b/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf Binary files differindex cf04b4a6a2a..8c60948f4c5 100644 --- a/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf +++ b/Master/texmf-dist/doc/latex/fontspec/fontspec-code.pdf diff --git a/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf b/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf Binary files differindex 643375da1ea..1f883d80f1f 100644 --- a/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf +++ b/Master/texmf-dist/doc/latex/fontspec/fontspec.pdf 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", diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty index 4fe9f75c91f..82b0a3591aa 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty @@ -40,7 +40,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec-luatex}% - {2024/05/07}{2.9d}{Font selection for XeLaTeX and LuaLaTeX} + {2024/05/11}{2.9e}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <latex3.github.io/fontspec> %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <latex3.github.io/fontspec> @@ -338,6 +338,12 @@ { '#1' doesn't appear to have an Optical Size axis. } +\__fontspec_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. + } \__fontspec_msg_new:nn {language-not-exist} { Language '#1' not explicitly supported @@ -397,12 +403,6 @@ { Adjusting the maths setup (use [no-math] to avoid this). } -\__fontspec_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. - } \__fontspec_msg_new:nn {opa-twice} { Opacity set twice, in both Colour and Opacity.\\ @@ -1007,7 +1007,7 @@ \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l__fontspec_lang_tl - \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:} + \__fontspec_check_ot_feat:NnnnTF \font {#1} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } { \prg_return_false: @@ -1581,7 +1581,7 @@ % "normal" \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__fontspec_sizedfont_tl} - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_tl {#1} {\l__fontspec_sizing_leftover_clist} {} + \__fontspec_setup_nfss:Nn \l__fontspec_nfss_tl { #1 , \l__fontspec_sizing_leftover_clist } % small caps \clist_set_eq:NN \l__fontspec_fontfeat_curr_clist \l__fontspec_fontfeat_sc_clist @@ -1603,14 +1603,15 @@ \bool_if:NF \l__fontspec_nosc_bool { - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_sc_tl - {#1} {\l__fontspec_sizing_leftover_clist} {\l__fontspec_fontfeat_curr_clist} + \__fontspec_setup_nfss:Nn \l__fontspec_nfss_sc_tl + {#1 , \l__fontspec_sizing_leftover_clist , \l__fontspec_fontfeat_curr_clist} } } -\cs_new:Nn \__fontspec_setup_nfss:Nnnn +\cs_new:Nn \__fontspec_setup_nfss:Nn { - \__fontspec_get_features:n { #2 , #3 , #4 } + \__fontspec_get_features:n { #2 } + \tl_if_empty:NF \l__fontspec_scale_tl { @@ -1720,22 +1721,25 @@ } (#1/#2)~ with~ NFSS~ spec.:~ \l__fontspec_nfss_tl - \exp_not:n { \\ } - -~ \exp_not:N \str_case:nn { #1 / \__fontspec_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 / \__fontspec_combo_sc_shape:n {#2} )~ - with~ NFSS~ spec.:~ - \l__fontspec_nfss_sc_tl - \tl_if_empty:fF {\l__fontspec_postadjust_tl} + \tl_if_empty:NF \l__fontspec_nfss_sc_tl { - \exp_not:N \\ and~ font~ adjustment~ code: - \exp_not:N \\ \l__fontspec_postadjust_tl + \exp_not:n { \\ } + -~ \exp_not:N \str_case:nn { #1 / \__fontspec_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 / \__fontspec_combo_sc_shape:n {#2} )~ + with~ NFSS~ spec.:~ + \l__fontspec_nfss_sc_tl + \tl_if_empty:fF {\l__fontspec_postadjust_tl} + { + \exp_not:N \\ and~ font~ adjustment~ code: + \exp_not:N \\ \l__fontspec_postadjust_tl + } } } } @@ -1746,9 +1750,33 @@ \tl_if_empty:NF \l__fontspec_script_tl { script = \l__fontspec_script_tl ; } \tl_if_empty:NF \l__fontspec_lang_tl { language = \l__fontspec_lang_tl ; } } +\cs_new:Nn \__fontspec_make_ot_smallcaps:TF + { + \bool_set_false:N \l__fontspec_tmpa_bool + \exp_args:Ne \clist_map_inline:nn { \l__fontspec_lang_tl , \g__fontspec_default_langs_clist } + { + \exp_args:Ne \clist_map_inline:nn { \l__fontspec_script_tl , \g__fontspec_default_scripts_clist } + { + \exp_args:No \__fontspec_check_ot_feat:NnnnT \l__fontspec_fontface_cs_tl {smcp} {##1} {####1} + { + \bool_set_true:N \l__fontspec_tmpa_bool + \clist_map_break: + } + } + } + \bool_if:NTF \l__fontspec_tmpa_bool {#1} {#2} + } \cs_new:Nn \__fontspec_make_smallcaps:TF { - \exp_args:No \__fontspec_check_ot_feat:NnTF \l__fontspec_fontface_cs_tl {smcp} {#1} {#2} + \bool_if:NTF \l__fontspec_ot_bool + { \__fontspec_make_ot_smallcaps:TF {#1} {#2} } + { + \bool_if:NT \l__fontspec_atsui_bool + { + \exp_args:No \__fontspec_make_AAT_feature_string:NnnTF + \l__fontspec_fontface_cs_tl {3} {3} {#1} {#2} + } + } } \cs_new:Nn \__fontspec_update_featstr:n { @@ -1946,12 +1974,7 @@ } } } -\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nn {TF,F} - { - \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} - {\prg_return_true:} {\prg_return_false:} - } -\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F} +\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,T,F} { \bool_if:NTF \l__fontspec_never_check_bool { \prg_return_true: } @@ -2975,7 +2998,7 @@ } \bool_if:NF \l__fontspec_scriptlang_exist_bool { - \__fontspec_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1} + \__fontspec_info:nxx {script-not-exist} {\l_fontspec_fontname_tl} {#1} \clist_set:Nn \l_tmpa_clist {#2} \clist_get:NN \l_tmpa_clist \l__fontspec_script_tl \exp_args:Noo \__fontspec_check_script:NnF \l__fontspec_fontface_cs_tl \l__fontspec_script_tl @@ -2988,31 +3011,33 @@ } } } -\cs_new:Nn \fontspec_default_script:nn +\clist_new:N \g__fontspec_default_scripts_clist +\cs_new:Nn \fontspec_default_script:n { - \keys_define:nn {fontspec-opentype} { Script / #1 .code:n = + \clist_gset:Nn \g__fontspec_default_scripts_clist {#1} + } +\fontspec_default_script:n {latn,DFLT} +\keys_define:nn {fontspec-opentype} { Script / CustomDefault .code:n = + { + \bool_set_false:N \l__fontspec_scriptlang_exist_bool + \clist_map_inline:Nn \g__fontspec_default_scripts_clist { - \bool_set_false:N \l__fontspec_scriptlang_exist_bool - \clist_map_inline:nn {#2} - { - \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {####1} - { - \tl_set:Nn \l__fontspec_script_name_tl {#1} - \tl_set:Nn \l__fontspec_script_tl {####1} - \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} - \bool_set_true:N \l__fontspec_scriptlang_exist_bool - \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 } - \clist_map_break: - } - } - \bool_if:NF \l__fontspec_scriptlang_exist_bool + \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {##1} { - \tl_clear:N \l__fontspec_script_name_tl + \tl_set:Nn \l__fontspec_script_name_tl {Default (##1)} + \tl_set:Nn \l__fontspec_script_tl {##1} + \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} + \bool_set_true:N \l__fontspec_scriptlang_exist_bool + \tl_gset:Nx \g__fontspec_single_feat_tl { script=##1 } + \clist_map_break: } } - } + \bool_if:NF \l__fontspec_scriptlang_exist_bool + { + \tl_clear:N \l__fontspec_script_name_tl + } } -\fontspec_default_script:nn {CustomDefault} {latn,DFLT} +} \keys_define:nn {fontspec-opentype} { Language .choice: , @@ -3036,7 +3061,7 @@ } \bool_if:NF \l__fontspec_scriptlang_exist_bool { - \__fontspec_warning:nx {language-not-exist} {#1} + \__fontspec_info:nx {language-not-exist} {#1} \clist_set:Nn \l_tmpa_clist {#2} \clist_get:NN \l_tmpa_clist \l__fontspec_lang_tl \exp_args:Noo \__fontspec_check_lang:NnF \l__fontspec_fontface_cs_tl \l__fontspec_lang_tl @@ -3049,6 +3074,12 @@ } } } +\clist_new:N \g__fontspec_default_langs_clist +\cs_new:Nn \fontspec_default_lang:n + { + \clist_gset:Nn \g__fontspec_default_langs_clist {#1} + } +\fontspec_default_lang:n {dflt} \__fontspec_keys_define_code:nnn {fontspec-opentype} { Language / Default } { \tl_set:Nn \l__fontspec_lang_tl {dflt} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty index 242e8141c0e..ff88419e717 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty @@ -40,7 +40,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec-xetex}% - {2024/05/07}{2.9d}{Font selection for XeLaTeX and LuaLaTeX} + {2024/05/11}{2.9e}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-load.dtx -- part of FONTSPEC <latex3.github.io/fontspec> %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <latex3.github.io/fontspec> @@ -338,6 +338,12 @@ { '#1' doesn't appear to have an Optical Size axis. } +\__fontspec_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. + } \__fontspec_msg_new:nn {language-not-exist} { Language '#1' not explicitly supported @@ -397,12 +403,6 @@ { Adjusting the maths setup (use [no-math] to avoid this). } -\__fontspec_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. - } \__fontspec_msg_new:nn {opa-twice} { Opacity set twice, in both Colour and Opacity.\\ @@ -1003,7 +1003,7 @@ \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {script-tag} \l__fontspec_script_tl \prop_get:cnN {g__fontspec_fontinfo_ \f@family _prop} {lang-tag} \l__fontspec_lang_tl - \__fontspec_check_ot_feat:NnTF \font {#1} {\prg_return_true:} {\prg_return_false:} + \__fontspec_check_ot_feat:NnnnTF \font {#1} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} {\prg_return_true:} {\prg_return_false:} } { \prg_return_false: @@ -1603,7 +1603,7 @@ % "normal" \__fontspec_load_fontname:Nn \l_fontspec_fontname_tl {\l__fontspec_sizedfont_tl} - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_tl {#1} {\l__fontspec_sizing_leftover_clist} {} + \__fontspec_setup_nfss:Nn \l__fontspec_nfss_tl { #1 , \l__fontspec_sizing_leftover_clist } % small caps \clist_set_eq:NN \l__fontspec_fontfeat_curr_clist \l__fontspec_fontfeat_sc_clist @@ -1625,14 +1625,15 @@ \bool_if:NF \l__fontspec_nosc_bool { - \__fontspec_setup_nfss:Nnnn \l__fontspec_nfss_sc_tl - {#1} {\l__fontspec_sizing_leftover_clist} {\l__fontspec_fontfeat_curr_clist} + \__fontspec_setup_nfss:Nn \l__fontspec_nfss_sc_tl + {#1 , \l__fontspec_sizing_leftover_clist , \l__fontspec_fontfeat_curr_clist} } } -\cs_new:Nn \__fontspec_setup_nfss:Nnnn +\cs_new:Nn \__fontspec_setup_nfss:Nn { - \__fontspec_get_features:n { #2 , #3 , #4 } + \__fontspec_get_features:n { #2 } + \tl_if_empty:NF \l__fontspec_scale_tl { @@ -1742,22 +1743,25 @@ } (#1/#2)~ with~ NFSS~ spec.:~ \l__fontspec_nfss_tl - \exp_not:n { \\ } - -~ \exp_not:N \str_case:nn { #1 / \__fontspec_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 / \__fontspec_combo_sc_shape:n {#2} )~ - with~ NFSS~ spec.:~ - \l__fontspec_nfss_sc_tl - \tl_if_empty:fF {\l__fontspec_postadjust_tl} + \tl_if_empty:NF \l__fontspec_nfss_sc_tl { - \exp_not:N \\ and~ font~ adjustment~ code: - \exp_not:N \\ \l__fontspec_postadjust_tl + \exp_not:n { \\ } + -~ \exp_not:N \str_case:nn { #1 / \__fontspec_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 / \__fontspec_combo_sc_shape:n {#2} )~ + with~ NFSS~ spec.:~ + \l__fontspec_nfss_sc_tl + \tl_if_empty:fF {\l__fontspec_postadjust_tl} + { + \exp_not:N \\ and~ font~ adjustment~ code: + \exp_not:N \\ \l__fontspec_postadjust_tl + } } } } @@ -1771,7 +1775,19 @@ } \cs_new:Nn \__fontspec_make_ot_smallcaps:TF { - \exp_args:No \__fontspec_check_ot_feat:NnTF \l__fontspec_fontface_cs_tl {smcp} {#1} {#2} + \bool_set_false:N \l__fontspec_tmpa_bool + \exp_args:Ne \clist_map_inline:nn { \l__fontspec_lang_tl , \g__fontspec_default_langs_clist } + { + \exp_args:Ne \clist_map_inline:nn { \l__fontspec_script_tl , \g__fontspec_default_scripts_clist } + { + \exp_args:No \__fontspec_check_ot_feat:NnnnT \l__fontspec_fontface_cs_tl {smcp} {##1} {####1} + { + \bool_set_true:N \l__fontspec_tmpa_bool + \clist_map_break: + } + } + } + \bool_if:NTF \l__fontspec_tmpa_bool {#1} {#2} } \cs_new:Nn \__fontspec_make_smallcaps:TF { @@ -2004,12 +2020,7 @@ } } } -\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nn {TF,F} - { - \__fontspec_check_ot_feat:NnnnTF #1 {#2} {\l__fontspec_lang_tl} {\l__fontspec_script_tl} - {\prg_return_true:} {\prg_return_false:} - } -\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,F} +\prg_new_conditional:Nnn \__fontspec_check_ot_feat:Nnnn {TF,T,F} { \bool_if:NTF \l__fontspec_never_check_bool { \prg_return_true: } @@ -3098,7 +3109,7 @@ } \bool_if:NF \l__fontspec_scriptlang_exist_bool { - \__fontspec_warning:nxx {no-script} {\l_fontspec_fontname_tl} {#1} + \__fontspec_info:nxx {script-not-exist} {\l_fontspec_fontname_tl} {#1} \clist_set:Nn \l_tmpa_clist {#2} \clist_get:NN \l_tmpa_clist \l__fontspec_script_tl \exp_args:Noo \__fontspec_check_script:NnF \l__fontspec_fontface_cs_tl \l__fontspec_script_tl @@ -3111,31 +3122,33 @@ } } } -\cs_new:Nn \fontspec_default_script:nn +\clist_new:N \g__fontspec_default_scripts_clist +\cs_new:Nn \fontspec_default_script:n { - \keys_define:nn {fontspec-opentype} { Script / #1 .code:n = + \clist_gset:Nn \g__fontspec_default_scripts_clist {#1} + } +\fontspec_default_script:n {latn,DFLT} +\keys_define:nn {fontspec-opentype} { Script / CustomDefault .code:n = + { + \bool_set_false:N \l__fontspec_scriptlang_exist_bool + \clist_map_inline:Nn \g__fontspec_default_scripts_clist { - \bool_set_false:N \l__fontspec_scriptlang_exist_bool - \clist_map_inline:nn {#2} + \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {##1} { - \exp_args:No \__fontspec_check_script:NnT \l__fontspec_fontface_cs_tl {####1} - { - \tl_set:Nn \l__fontspec_script_name_tl {#1} - \tl_set:Nn \l__fontspec_script_tl {####1} - \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} - \bool_set_true:N \l__fontspec_scriptlang_exist_bool - \tl_gset:Nx \g__fontspec_single_feat_tl { script=####1 } - \clist_map_break: - } - } - \bool_if:NF \l__fontspec_scriptlang_exist_bool - { - \tl_clear:N \l__fontspec_script_name_tl + \tl_set:Nn \l__fontspec_script_name_tl {Default (##1)} + \tl_set:Nn \l__fontspec_script_tl {##1} + \int_set:Nn \l__fontspec_script_int {\l__fontspec_strnum_int} + \bool_set_true:N \l__fontspec_scriptlang_exist_bool + \tl_gset:Nx \g__fontspec_single_feat_tl { script=##1 } + \clist_map_break: } } - } + \bool_if:NF \l__fontspec_scriptlang_exist_bool + { + \tl_clear:N \l__fontspec_script_name_tl + } } -\fontspec_default_script:nn {CustomDefault} {latn,DFLT} +} \keys_define:nn {fontspec-opentype} { Language .choice: , @@ -3159,7 +3172,7 @@ } \bool_if:NF \l__fontspec_scriptlang_exist_bool { - \__fontspec_warning:nx {language-not-exist} {#1} + \__fontspec_info:nx {language-not-exist} {#1} \clist_set:Nn \l_tmpa_clist {#2} \clist_get:NN \l_tmpa_clist \l__fontspec_lang_tl \exp_args:Noo \__fontspec_check_lang:NnF \l__fontspec_fontface_cs_tl \l__fontspec_lang_tl @@ -3172,6 +3185,12 @@ } } } +\clist_new:N \g__fontspec_default_langs_clist +\cs_new:Nn \fontspec_default_lang:n + { + \clist_gset:Nn \g__fontspec_default_langs_clist {#1} + } +\fontspec_default_lang:n {dflt} \__fontspec_keys_define_code:nnn {fontspec-opentype} { Language / Default } { \tl_set:Nn \l__fontspec_lang_tl {dflt} diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index c889bc65b2c..fbafa4095f8 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -23,8 +23,8 @@ fontspec = fontspec or {} local fontspec = fontspec fontspec.module = { name = "fontspec", - version = "2.9d", - date = "2024/05/07", + version = "2.9e", + date = "2024/05/11", description = "Font selection for XeLaTeX and LuaLaTeX", author = "Khaled Hosny, Philipp Gesang, Will Robertson", copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty index b0c70f2b249..1ca8270f673 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.sty +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.sty @@ -24,7 +24,7 @@ \RequirePackage{xparse} \ProvidesExplPackage{fontspec}% - {2024/05/07}{2.9d}{Font selection for XeLaTeX and LuaLaTeX} + {2024/05/11}{2.9e}{Font selection for XeLaTeX and LuaLaTeX} %%^^A%% fontspec-code-vars.dtx -- part of FONTSPEC <latex3.github.io/fontspec> \bool_new:N \g__fontspec_cfg_bool |