diff --git a/fontspec-code-feat-opentype.dtx b/fontspec-code-feat-opentype.dtx index 4ffc5cd..5fbd797 100644 --- a/fontspec-code-feat-opentype.dtx +++ b/fontspec-code-feat-opentype.dtx @@ -556,11 +556,11 @@ \@@_warning: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_script:NnF \l_@@_fontface_cs_tl \l_@@_script_tl + \exp_args:Noo \@@_check_lang:NnF \l_@@_fontface_cs_tl \l_@@_lang_tl { - \tl_set:Nn \l_@@_script_name_tl {#1} + \tl_set:Nn \l_@@_lang_name_tl {#1} \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} - \tl_gset:Nx \g_@@_single_feat_tl { language=####1 } + \tl_gset:Nx \g_@@_single_feat_tl { language=\l_@@_lang_tl } } } } diff --git a/fontspec-code-opentype.dtx b/fontspec-code-opentype.dtx index 5a38be8..d78e0a8 100644 --- a/fontspec-code-opentype.dtx +++ b/fontspec-code-opentype.dtx @@ -216,7 +216,7 @@ % The script used is whatever's held in \cmd\l_@@_script_int. By default, that's the % number corresponding to `|latn|'. % \begin{macrocode} -\prg_new_conditional:Nnn \@@_check_lang:Nn {TF} +\prg_new_conditional:Nnn \@@_check_lang:Nn {TF,F} { \@@_check_lang:NnnTF #1 {#2} {\l_@@_script_tl} {\prg_return_true:} {\prg_return_false:} } diff --git a/testfiles/script-lang-chinese.luatex.tlg b/testfiles/script-lang-chinese.luatex.tlg new file mode 100644 index 0000000..7fd05ed --- /dev/null +++ b/testfiles/script-lang-chinese.luatex.tlg @@ -0,0 +1,6 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +TU/FandolHei(0)/m/n: + [FandolHei-Regular.otf]:mode=node;script=hani;language=ZHS;+tlig;family=rm; +*************** +Compilation 1 of test file completed with exit status 0 diff --git a/testfiles/script-lang-chinese.lvt b/testfiles/script-lang-chinese.lvt new file mode 100644 index 0000000..5f73a6e --- /dev/null +++ b/testfiles/script-lang-chinese.lvt @@ -0,0 +1,13 @@ + +\input{fontspec-testsetup.tex} + +\usepackage[english]{babel} +\babelfont[chinese]{rm}[ + Extension=.otf, + UprightFont=*-Regular, + BoldFont=*-Bold +]{FandolHei} + +\begin{document} +\foreignlanguage{chinese}{你好世界\CURRNFSS} +\end{document} diff --git a/testfiles/script-lang-chinese.tlg b/testfiles/script-lang-chinese.tlg new file mode 100644 index 0000000..b57c736 --- /dev/null +++ b/testfiles/script-lang-chinese.tlg @@ -0,0 +1,6 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +TU/FandolHei(0)/m/n: + "[FandolHei-Regular.otf]/OT:script=hani;language=ZHS;mapping=tex-text;" +*************** +Compilation 1 of test file completed with exit status 0