diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/fontspec/fontspec-code-feat-opentype.dtx | 87 |
1 files changed, 51 insertions, 36 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 dc3db933869..590d69f77f5 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 @@ -44,7 +44,9 @@ \keys_define:nn {fontspec-opentype} { Ligatures / TeX .code:n = { \tl_set:Nn \l_@@_mapping_tl {tex-text} }, + Ligatures / TeX .groups:n = {opentype}, Ligatures / TeXReset .code:n = { \tl_clear:N \l_@@_mapping_tl }, + Ligatures / TeXReset .groups:n = {opentype}, } %</XE> %<LU>\@@_define_opentype_onreset:nnnnn {Ligatures} {TeX} {} { +tlig } {} @@ -313,6 +315,7 @@ \keys_define:nn {fontspec-opentype} { Alternate .default:n = {0} , + Alternate .groups:n = {opentype}, Alternate / unknown .code:n = { \clist_map_inline:nn {#1} @@ -343,6 +346,7 @@ \keys_define:nn {fontspec-opentype} { Variant .default:n = {0} , + Variant .groups:n = {opentype} , Variant / unknown .code:n = { \clist_map_inline:nn {#1} @@ -391,6 +395,7 @@ \keys_define:nn {fontspec-opentype} { Annotation .default:n = {0} , + Annotation .groups:n = {opentype}, Annotation / unknown .code:n = { \@@_make_OT_feature:nnn {nalt} {+nalt=#1} {} @@ -405,6 +410,7 @@ \keys_define:nn {fontspec-opentype} { Ornament .default:n = {0} , + Ornament .groups:n = {opentype}, Ornament / unknown .code:n = { \@@_make_OT_feature:nnn {ornm} { +ornm=#1 } {} @@ -419,43 +425,46 @@ % \subsection{Script} % % \begin{macrocode} -\keys_define:nn { fontspec-opentype } { Script .choice: } +\keys_define:nn {fontspec-opentype} + { + Script .choice: , + Script .groups:n = {opentype} , + } \cs_new:Nn \fontspec_new_script:nn { - \keys_define:nn { fontspec-opentype } { Script / #1 .code:n = + \keys_define:nn {fontspec-opentype} { Script / #1 .code:n = { - \bool_if:NF \l_@@_scripts_missing_bool +%<debug>\typeout{Trying~[Script=#1]} + \bool_set_false:N \l_@@_scriptlang_exist_bool + \clist_map_inline:nn {#2} + { + \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_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 { - \bool_set_false:N \l_@@_scriptlang_exist_bool - \clist_map_inline:nn {#2} + \bool_if:nF { \str_if_eq_p:ee {#1} {CustomDefault} } { - \@@_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: - } + \tl_clear:N \l_@@_script_name_tl + \@@_warning:nx {no-script} {\l_fontspec_fontname_tl} {#1} } - \bool_if:NF \l_@@_scriptlang_exist_bool + + \bool_if:nF { - \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 } - } - } + \str_if_eq_p:ee {#1} {Default} || + \str_if_eq_p:ee {#1} {Latin} || + \str_if_eq_p:ee {#1} {CustomDefault} + } + { + \keys_set:nn {fontspec-opentype} { Script = CustomDefault } } } } @@ -467,15 +476,19 @@ % \subsection{Language} % % \begin{macrocode} -\keys_define:nn {fontspec-opentype} { Language .choice: } +\keys_define:nn {fontspec-opentype} + { + Language .choice: , + Language .groups:n = {opentype} , + } \cs_new:Nn \fontspec_new_lang:nn { - \keys_define:nn { fontspec-opentype } { Language / #1 .code:n = + \keys_define:nn {fontspec-opentype} { Language / #1 .code:n = { \bool_set_false:N \l_@@_scriptlang_exist_bool \clist_map_inline:nn {#2} { - \@@_check_lang:NnTF \l_fontspec_font {#2} + \exp_args:No \@@_check_lang:NnTF \l_@@_fontface_cs_tl {#2} { \tl_set:Nn \l_fontspec_lang_tl {#2} \int_set:Nn \l_@@_language_int {\l_@@_strnum_int} @@ -494,9 +507,11 @@ } % \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. +% \paragraph{Language=Default} +% These are special-cased to avoid the additional logic above. +% 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 } { |