diff options
author | Norbert Preining <norbert@preining.info> | 2024-05-12 03:01:16 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-05-12 03:01:16 +0000 |
commit | 0140cc7eb697ba5925de5312dd0419e7717acca9 (patch) | |
tree | cb7751d3c8cda806166e8a6d17f1a901bdf760ac /macros/unicodetex | |
parent | f04305edb464261c7040b9ba9c1ebf0747536190 (diff) |
CTAN sync 202405120301
Diffstat (limited to 'macros/unicodetex')
-rw-r--r-- | macros/unicodetex/latex/fontspec/CHANGES.md | 13 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code-api.dtx | 2 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx | 63 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx | 71 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx | 12 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx | 12 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec-code.pdf | bin | 704184 -> 686785 bytes | |||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec.dtx | 6 | ||||
-rw-r--r-- | macros/unicodetex/latex/fontspec/fontspec.pdf | bin | 496860 -> 524650 bytes |
9 files changed, 106 insertions, 73 deletions
diff --git a/macros/unicodetex/latex/fontspec/CHANGES.md b/macros/unicodetex/latex/fontspec/CHANGES.md index 47c3b7128e..638e456356 100644 --- a/macros/unicodetex/latex/fontspec/CHANGES.md +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx index 2b21012472..3ce9edc230 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx index 5fbd797f44..b4d5db73f3 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx index fd52183c18..b454143ef5 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx index 2904f7350e..9def7adde6 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx index dab45952c6..81c1d2b041 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec-code.pdf b/macros/unicodetex/latex/fontspec/fontspec-code.pdf Binary files differindex cf04b4a6a2..8c60948f4c 100644 --- a/macros/unicodetex/latex/fontspec/fontspec-code.pdf +++ b/macros/unicodetex/latex/fontspec/fontspec-code.pdf diff --git a/macros/unicodetex/latex/fontspec/fontspec.dtx b/macros/unicodetex/latex/fontspec/fontspec.dtx index ea7bbffe55..4a9e99b18f 100644 --- a/macros/unicodetex/latex/fontspec/fontspec.dtx +++ b/macros/unicodetex/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/macros/unicodetex/latex/fontspec/fontspec.pdf b/macros/unicodetex/latex/fontspec/fontspec.pdf Binary files differindex 643375da1e..1f883d80f1 100644 --- a/macros/unicodetex/latex/fontspec/fontspec.pdf +++ b/macros/unicodetex/latex/fontspec/fontspec.pdf |