diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec')
7 files changed, 67 insertions, 87 deletions
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 26a75f91166..843e4587740 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 @@ -423,37 +423,39 @@ \cs_new:Nn \fontspec_new_script:nn { \keys_define:nn { fontspec-opentype } { Script / #1 .code:n = - \bool_set_false:N \l_@@_script_exist_bool - \clist_map_inline:nn {#2} - { - \@@_check_script:NnTF \l_fontspec_font {####1} - { - \tl_set:Nn \l_fontspec_script_tl {####1} - \int_set:Nn \l_@@_script_int {\l_@@_strnum_int} - \bool_set_true:N \l_@@_script_exist_bool - \tl_gset:Nx \g_@@_single_feat_tl { script=####1 } - \clist_map_break: - } - { } - } - \bool_if:NF \l_@@_script_exist_bool - { - \str_if_eq:nnTF {#1} {Latin} - { - \@@_warning:nx {script-not-exist} {#1} - } - { - \@@_check_script:NnTF \l_fontspec_font {latn} - { - \@@_warning:nx {script-not-exist-latn} {#1} - \tl_set:Nn \l_fontspec_script_tl {latn} - \int_set:Nn \l_@@_script_int {\l_@@_strnum_int} - } - { - \@@_warning:nx {script-not-exist} {#1} - } - } - } + { + \bool_set_false:N \l_@@_scriptlang_exist_bool + \clist_map_inline:nn {#2} + { + \@@_check_script:NnT \l_fontspec_font {####1} + { + \tl_set:Nn \l_fontspec_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 + { + \str_if_eq:eeTF {#1} {Latin} + { + \@@_warning:nx {script-not-exist} {#1} + } + { + \@@_check_script:NnTF \l_fontspec_font {latn} + { + \@@_warning:nx {script-not-exist-latn} {#1} + \tl_set:Nn \l_fontspec_script_tl {latn} + \int_set:Nn \l_@@_script_int {\l_@@_strnum_int} + } + { + \@@_warning:nx {script-not-exist} {#1} + \keys_set:nn {fontspec-opentype} { Script = Default } + } + } + } + } } } % \end{macrocode} @@ -462,28 +464,38 @@ % \subsection{Language} % % \begin{macrocode} -\keys_define:nn { fontspec-opentype } { Language .choice: } +\keys_define:nn {fontspec-opentype} { Language .choice: } \cs_new:Nn \fontspec_new_lang:nn { \keys_define:nn { fontspec-opentype } { Language / #1 .code:n = - \@@_check_lang:NnTF \l_fontspec_font {#2} { - \tl_set:Nn \l_fontspec_lang_tl {#2} - \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} - \tl_gset:Nx \g_@@_single_feat_tl { language=#2 } - } - { - \@@_warning:nx {language-not-exist} {#1} - \keys_set:nn { fontspec-opentype } { Language = Default } + \bool_set_false:N \l_@@_scriptlang_exist_bool + \clist_map_inline:nn {#2} + { + \@@_check_lang:NnTF \l_fontspec_font {#2} + { + \tl_set:Nn \l_fontspec_lang_tl {#2} + \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} + \tl_gset:Nx \g_@@_single_feat_tl { language=#2 } + \bool_set_true:N \l_@@_scriptlang_exist_bool + \clist_map_break: + } + } + \bool_if:NF \l_@@_scriptlang_exist_bool + { + \@@_warning:nx {language-not-exist} {#1} + \keys_set:nn {fontspec-opentype} { Language = Default } + } } } } % \end{macrocode} % % \paragraph{Default} -% +% I can't remember why this has to be special-cased. From memory, the OpenType default +% language is hardcoded to have a zero value, although this might be some \XeTeX-specific thing. % \begin{macrocode} -\@@_keys_define_code:nnn {fontspec-opentype}{ Language / Default } +\@@_keys_define_code:nnn {fontspec-opentype} { Language / Default } { \tl_set:Nn \l_fontspec_lang_tl {DFLT} \int_zero:N \l_@@_language_int @@ -491,35 +503,6 @@ } % \end{macrocode} % -% \paragraph{Turkish} Turns out that many fonts use `TUR' as their Turkish language tag rather than the specified `TRK'. So we check for both: -% \begin{macrocode} -\keys_define:nn {fontspec-opentype} - { - Language / Turkish .code:n = - { - \@@_check_lang:NnTF \l_fontspec_font {TRK} - { - \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} - \tl_set:Nn \l_fontspec_lang_tl {TRK} - \tl_gset:Nn \g_@@_single_feat_tl { language=TRK } - } - { - \@@_check_lang:NnTF \l_fontspec_font {TUR} - { - \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} - \tl_set:Nn \l_fontspec_lang_tl {TUR} - \tl_gset:Nn \g_@@_single_feat_tl { language=TUR } - } - { - \@@_warning:nx {language-not-exist} {Turkish} - \keys_set:nn {fontspec-opentype} {Language=Default} - } - } - } - } -% \end{macrocode} -% TODO: generalise the above -% % % \section{Backwards compatibility} % 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 a8d8c49763c..da2374cde13 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-internal.dtx @@ -328,9 +328,9 @@ { \tl_set:Nn \l_@@_lang_name_tl {Default} } +%<debug> \typeout{:::: Script=\l_@@_script_name_tl, Language=\l_@@_lang_name_tl} \keys_set:nx {fontspec-opentype} {Script=\l_@@_script_name_tl} \keys_set:nx {fontspec-opentype} {Language=\l_@@_lang_name_tl} -%<debug> \typeout{:::: Script=\l_@@_script_name_tl, Language=\l_@@_lang_name_tl} } } } @@ -1139,11 +1139,8 @@ { \@@_error:nx {ot-tag-too-long} {#2#3#4#5#6} } \str_if_eq:eeTF {#2#3#4#5#6} {DFLT} + { \int_zero:N #1 } { - \int_set:Nn #1 {0} - } - { - \int_set:Nn #1 { `#2 * "1000000 diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx index adcdcb8a355..7b7acfc921a 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-lang.dtx @@ -354,6 +354,7 @@ \newfontlanguage{Thai}{THA} \newfontlanguage{Tahitian}{THT} \newfontlanguage{Tibetan}{TIB} +\newfontlanguage{Turkish}{TRK,TUR} \newfontlanguage{Turkmen}{TKM} \newfontlanguage{Temne}{TMN} \newfontlanguage{Tswana}{TNA} 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 64aa1b96212..42b02254808 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-msg.dtx @@ -135,14 +135,14 @@ { OpenType tag '#1' is too long; script, language, and feature tags must be four characters or fewer. } -\@@_msg_new:nnn {fontspec} {script-not-exist-latn} +\@@_msg_new:nnn {fontspec} {script-not-exist} { - Font '\l_fontspec_fontname_tl' does not contain script '#1'.\\ - 'Latin' script used instead. + Font '\l_fontspec_fontname_tl' does not contain script '#1'. } -\@@_msg_new:nnn {fontspec} {script-not-exist} +\@@_msg_new:nnn {fontspec} {script-not-exist-latn} { Font '\l_fontspec_fontname_tl' does not contain script '#1'. + `Script=Latin` used instead. } \@@_msg_new:nnn {fontspec} {aat-feature-not-exist} { @@ -173,8 +173,7 @@ { Language '#1' not available for font '\l_fontspec_fontname_tl' - with script '\l_@@_script_name_tl'.\\ - 'Default' language used instead. + with script '\l_@@_script_name_tl'. } \@@_msg_new:nnn {fontspec} {only-xetex-feature} { 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 e7820d14dfb..ceda070f907 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-opentype.dtx @@ -147,7 +147,7 @@ % font. \cmd\l_@@_script_int\ is used to store % the number corresponding to the script tag string. % \begin{macrocode} -\prg_new_conditional:Nnn \@@_check_script:Nn {TF} +\prg_new_conditional:Nnn \@@_check_script:Nn {TF,T} { \bool_if:NTF \l_@@_never_check_bool { \prg_return_true: } diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx index c7ca26bb0e3..bdd970f3674 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec-code-vars.dtx @@ -60,7 +60,7 @@ \bool_new:N \l_@@_alias_bool \bool_new:N \l_@@_external_bool \bool_new:N \l_@@_defining_encoding_bool -\bool_new:N \l_@@_script_exist_bool +\bool_new:N \l_@@_scriptlang_exist_bool \bool_new:N \g_@@_em_normalise_slant_bool \bool_new:N \l_@@_proceed_bool \bool_new:N \l_@@_check_feat_bool diff --git a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx index e3f4907a98c..e3c5e01bde8 100644 --- a/Master/texmf-dist/source/latex/fontspec/fontspec.dtx +++ b/Master/texmf-dist/source/latex/fontspec/fontspec.dtx @@ -71,7 +71,7 @@ \ProvidesExplFile{fontspec.dtx} %</dtx> %<*fontspec> - {2019/01/10}{2.6j}{Font selection for XeLaTeX and LuaLaTeX} + {2019/01/16}{2.6k}{Font selection for XeLaTeX and LuaLaTeX} %</fontspec> % \end{macrocode} % @@ -90,8 +90,8 @@ %<lua>local fontspec = fontspec %<lua>fontspec.module = { %<lua> name = "fontspec", -%<lua> version = "2.6j", -%<lua> date = "2019/01/10", +%<lua> version = "2.6k", +%<lua> date = "2019/01/16", %<lua> description = "Font selection for XeLaTeX and LuaLaTeX", %<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson", %<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson", |