summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty492
1 files changed, 259 insertions, 233 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index 2ff401c2514..7043fd0d7de 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 49800bb 2022-07-14 18:54:00 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx c4ccfae 2022-08-05 21:02:32 +0800 Qing Lee <sobenlee@gmail.com> $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{3.9.0}{\ExplFileDescription}
+ {\ExplFileDate}{3.9.1}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -140,14 +140,12 @@
{ \tl_put_right:Nn \l__xeCJK_shipout_hook_tl }
\tl_new:N \l__xeCJK_shipout_hook_tl
\bool_new:N \l__xeCJK_shipout_hook_bool
-\cs_new_protected:Npn \xeCJK_tl_remove_outer_braces:N #1
- { \tl_set:Nx #1 { \exp_args:No \xeCJK_tl_remove_outer_braces:n {#1} } }
\cs_new:Npn \xeCJK_tl_remove_outer_braces:n #1
{
- \exp_last_unbraced:Nf
- \__xeCJK_tl_remove_outer_braces:w { \tl_trim_spaces:n {#1} } \s__stop
+ \exp_last_unbraced:Ne
+ \__xeCJK_tl_remove_outer_braces:w { \tl_trim_spaces:n {#1} } \s_stop
}
-\cs_new:Npn \__xeCJK_tl_remove_outer_braces:w #1 \s__stop
+\cs_new:Npn \__xeCJK_tl_remove_outer_braces:w #1 \s_stop
{
\tl_if_single:nTF {#1}
{
@@ -247,7 +245,7 @@
{
\group_begin:
\hbox_set:Nw \l__xeCJK_tmp_box #1 \scan_stop:
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{
\exp_args:NNNo \hbox_set_end:
\skip_set:Nn #2 { \skip_use:N \tex_lastskip:D }
@@ -259,15 +257,6 @@
\exp_args:NNNo \group_end:
\skip_set:Nn #2 { \skip_use:N #2 }
}
-\prg_new_conditional:Npnn \xeCJK_if_blank_x:n #1 { p , T , F , TF }
- {
- \if_case:w \tex_strcmp:D { } {#1} \exp_stop_f:
- \prg_return_true:
- \else:
- \if_case:w \tex_strcmp:D { ~ } {#1} \exp_stop_f:
- \prg_return_true: \else: \prg_return_false: \fi:
- \fi:
- }
\cs_new_protected:Npn \xeCJK_int_until_do:nn #1#2
{
\__xeCJK_int_until_do:wn \use_none:n
@@ -586,10 +575,10 @@
\cs_new_protected:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4
{
\bool_lazy_or:nnTF
- { \xeCJK_if_blank_x_p:n {#1} }
- { \xeCJK_if_blank_x_p:n {#2} }
+ { \tl_if_blank_p:n {#1} }
+ { \tl_if_blank_p:n {#2} }
{
- \int_set:Nn #3 { \xeCJK_if_blank_x:nTF {#1} {#2} {#1} }
+ \int_set:Nn #3 { \tl_if_blank:nTF {#1} {#2} {#1} }
\int_set_eq:NN #3 #4
}
{
@@ -657,7 +646,7 @@
\tex_XeTeXinterchartoks:D \xeCJK_class_num:n {#1} ~
\xeCJK_class_num:n {#2} = {#3}
}
-\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnx }
+\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nne }
\cs_new:Npn \xeCJK_get_inter_class_toks:nn #1#2
{
\tex_the:D \tex_XeTeXinterchartoks:D \xeCJK_class_num:n {#1} ~
@@ -667,16 +656,16 @@
{ \xeCJK_inter_class_toks:nnn {#1} {#2} { \prg_do_nothing: } }
\cs_new_protected:Npn \xeCJK_pre_inter_class_toks:nnn #1#2#3
{
- \xeCJK_inter_class_toks:nnx {#1} {#2}
+ \xeCJK_inter_class_toks:nne {#1} {#2}
{ \exp_not:n {#3} \xeCJK_get_inter_class_toks:nn {#1} {#2} }
}
-\cs_generate_variant:Nn \xeCJK_pre_inter_class_toks:nnn { nnx }
+\cs_generate_variant:Nn \xeCJK_pre_inter_class_toks:nnn { nne }
\cs_new_protected:Npn \xeCJK_app_inter_class_toks:nnn #1#2#3
{
- \xeCJK_inter_class_toks:nnx {#1} {#2}
+ \xeCJK_inter_class_toks:nne {#1} {#2}
{ \xeCJK_get_inter_class_toks:nn {#1} {#2} \exp_not:n {#3} }
}
-\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnx }
+\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nne }
\cs_new_protected:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4
{
\tl_set:Nx \l__xeCJK_tmp_tl
@@ -688,7 +677,7 @@
\tl_if_empty:NF \l__xeCJK_tmp_tl
{ \xeCJK_clear_inter_class_toks:nn {#1} {#2} }
}
- { \xeCJK_inter_class_toks:nnx {#1} {#2} { \exp_not:o \l__xeCJK_tmp_tl } }
+ { \xeCJK_inter_class_toks:nne {#1} {#2} { \exp_not:o \l__xeCJK_tmp_tl } }
}
\cs_new_protected:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4
{
@@ -697,7 +686,7 @@
\tl_if_empty:NF \l__xeCJK_tmp_tl
{
\tl_replace_all:Nnn \l__xeCJK_tmp_tl {#3} {#4}
- \xeCJK_inter_class_toks:nnx {#1} {#2}
+ \xeCJK_inter_class_toks:nne {#1} {#2}
{ \exp_not:o \l__xeCJK_tmp_tl }
}
}
@@ -786,7 +775,7 @@
{ \xeCJK_check_for_ecglue: }
\cs_new_protected:Npn \__xeCJK_check_for_xecglue:
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{ \__xeCJK_replace_space: }
{ \__xeCJK_check_for_ecglue: }
}
@@ -845,7 +834,7 @@
{ \xeCJK_check_for_ecglue_normalsp: }
\cs_new_protected:Npn \__xeCJK_check_for_xecglue_normalsp:
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{ \__xeCJK_replace_space: }
{ \__xeCJK_check_for_ecglue_normalsp: }
}
@@ -881,10 +870,10 @@
}
\cs_new_protected:Npn \xeCJK_check_for_glue:
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 12 }
+ \__xeCJK_if_last_kern:TF
{ \__xeCJK_check_for_glue_auxi: }
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 10 }
+ \__xeCJK_if_last_math:TF
{ \xeCJK_remove_node: \CJKecglue }
{ \__xeCJK_check_for_glue_auxii: }
}
@@ -919,7 +908,7 @@
\cs_new_eq:NN \xeCJK_check_for_xglue: \prg_do_nothing:
\cs_new_protected:Npn \__xeCJK_check_for_xglue:
{
- \int_compare:nNnT \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{
\skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
\tex_unskip:D
@@ -944,7 +933,7 @@
\xeCJK_if_last_node:nTF { default }
{ \xeCJK_remove_node: \CJKecglue }
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 10 }
+ \__xeCJK_if_last_math:TF
{ \CJKecglue }
{ \skip_horizontal:N \l__xeCJK_last_skip }
}
@@ -954,6 +943,29 @@
}
\cs_new_protected:Npn \__xeCJK_ccglue_or_space:
{ \CJKglue }
+\group_begin:
+\cs_set:Npn \__xeCJK_tmp:nn #1
+ {
+ \exp_args:Ncc \__xeCJK_tmp_aux:NNn
+ { __xeCJK_if_last_ #1 : }
+ { c__xeCJK_ #1 _node }
+ }
+\cs_set:Npn \__xeCJK_tmp_aux:NNn #1#2#3
+ {
+ \int_const:Nn #2 {#3}
+ \prg_new_conditional:Npnn #1 { T , F , TF }
+ {
+ \if_int_compare:w \tex_lastnodetype:D = #2
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+ }
+\__xeCJK_tmp:nn { none } { -1 }
+\__xeCJK_tmp:nn { hlist } { 1 }
+\__xeCJK_tmp:nn { math } { 10 }
+\__xeCJK_tmp:nn { glue } { 11 }
+\__xeCJK_tmp:nn { kern } { 12 }
+\__xeCJK_tmp:nn { penalty } { 13 }
+\group_end:
\prg_new_conditional:Npnn \xeCJK_if_last_node:n #1 { p , T , F , TF }
{
\if_dim:w
@@ -991,10 +1003,10 @@
}
\cs_new_protected:Npn \xeCJK_remove_node:
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 12 }
+ \__xeCJK_if_last_kern:TF
{ \tex_unkern:D \tex_unkern:D }
{
- \int_compare:nNnT \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:T
{ \tex_unskip:D \tex_unskip:D }
}
}
@@ -1181,9 +1193,9 @@
{
\clist_map_inline:nn { FullLeft , FullRight }
{
- \xeCJK_inter_class_toks:nnx {#1} {##1}
+ \xeCJK_inter_class_toks:nne {#1} {##1}
{ \exp_not:c { xeCJK_Default_and_##1:nN } {#1} }
- \xeCJK_inter_class_toks:nnx {##1} {#1}
+ \xeCJK_inter_class_toks:nne {##1} {#1}
{ \exp_not:c { xeCJK_##1_and_Default: } }
}
}
@@ -1324,7 +1336,7 @@
{
\clist_map_inline:nn { FullLeft , FullRight }
{
- \xeCJK_inter_class_toks:nnx {#1} {##1}
+ \xeCJK_inter_class_toks:nne {#1} {##1}
{ \exp_not:c { xeCJK_#1_and_##1:N } }
}
}
@@ -1474,9 +1486,9 @@
{ \__xeCJK_zero_glue: }
\cs_new_protected:cpn { __xeCJK_bound_type_ 1 _glue:Nn } #1
{
- \int_do_while:nNnn \tex_lastnodetype:D = \c_one_int
+ \int_do_while:nNnn \tex_lastnodetype:D = \c__xeCJK_hlist_node
{ \__xeCJK_bound_hbox_auxi: }
- \int_compare:nNnTF \tex_lastnodetype:D = { -1 }
+ \__xeCJK_if_last_none:TF
{
\dim_case:nnF { \box_wd:N \l__xeCJK_indent_box }
{
@@ -1526,7 +1538,7 @@
\skip_if_eq:nnTF { \l__xeCJK_last_skip } { \labelsep }
{
\tex_unskip:D
- \int_compare:nNnTF \tex_lastnodetype:D = { 13 }
+ \__xeCJK_if_last_penalty:TF
{
\int_compare:nNnTF \tex_lastpenalty:D = \c_zero_int
{ \skip_horizontal:N \l__xeCJK_last_skip }
@@ -1552,7 +1564,7 @@
\int_compare:nNnTF \tex_lastpenalty:D = \c_zero_int
{
\tex_unpenalty:D
- \int_compare:nNnTF \tex_lastnodetype:D = \c_one_int
+ \__xeCJK_if_last_hlist:TF
{ \tex_penalty:D \c_zero_int }
{ \tex_penalty:D \c_zero_int #2 }
}
@@ -1597,10 +1609,10 @@
\cs_new_protected:Npn \xeCJK_if_last_punct:TF
{
\bool_set_false:N \l__xeCJK_last_penalty_bool
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{ \__xeCJK_if_last_punct_glue:TF }
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 13 }
+ \__xeCJK_if_last_penalty:TF
{ \__xeCJK_if_last_punct_penalty:TF }
{ \use_ii:nn }
}
@@ -1637,7 +1649,7 @@
{
\skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D
\tex_unskip:D
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{
\prop_get:NoNTF \g__xeCJK_punct_skip_prop
{ \skip_use:N \tex_lastskip:D } \l__xeCJK_tmp_tl
@@ -1652,7 +1664,7 @@
\int_set_eq:NN \l__xeCJK_last_penalty_int \tex_lastpenalty:D
\tex_unpenalty:D
\bool_set_true:N \l__xeCJK_last_penalty_bool
- \int_compare:nNnTF \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{ \__xeCJK_if_last_punct_glue:TF { \use_i:nn } }
{ \use:n }
{ \__xeCJK_last_punct_penalty_false:nn }
@@ -1713,11 +1725,11 @@
\bool_new:N \l__xeCJK_last_penalty_bool
\cs_new_protected:Npn \xeCJK_if_last_node:TF #1#2
{
- \int_compare:nNnTF \tex_lastnodetype:D = { 12 }
+ \__xeCJK_if_last_kern:TF
{
\dim_set_eq:NN \l__xeCJK_last_kern_dim \tex_lastkern:D
\tex_unkern:D
- \int_compare:nNnTF \tex_lastnodetype:D = { 12 }
+ \__xeCJK_if_last_kern:TF
{
\dim_compare:nNnTF \tex_lastkern:D = { - \l__xeCJK_last_kern_dim }
{ \tex_unkern:D #1 }
@@ -1874,7 +1886,7 @@
\NewDocumentCommand \xeCJKnobreak { }
{
\bool_set_true:N \l__xeCJK_tmp_bool
- \int_while_do:nNnn \tex_lastnodetype:D = { 11 }
+ \int_while_do:nNnn \tex_lastnodetype:D = \c__xeCJK_glue_node
{
\bool_if:NTF \l__xeCJK_tmp_bool
{
@@ -1889,7 +1901,7 @@
\dim_set_eq:NN \l__xeCJK_tmp_dim \l__xeCJK_last_kern_dim
\xeCJK_if_last_node:TF
{
- \int_compare:nNnT \tex_lastnodetype:D = { 11 }
+ \__xeCJK_if_last_glue:TF
{
\exp_args:NNNo \tex_unskip:D \xeCJK_no_break:
\skip_horizontal:n { \skip_use:N \tex_lastskip:D }
@@ -2096,7 +2108,7 @@
\NewDocumentCommand \xeCJKDeclareSubCJKBlock
{ s > { \TrimSpaces } m m }
{
- \xeCJK_declare_sub_char_class:nxn { CJK } {#2} {#3}
+ \xeCJK_declare_sub_char_class:nen { CJK } {#2} {#3}
\IfBooleanT {#1} { \xeCJKResetPunctClass }
}
\@onlypreamble \xeCJKDeclareSubCJKBlock
@@ -2106,7 +2118,7 @@
\bool_if:NF \l__xeCJK_sub_cancel_bool
{
\bool_set_true:N \l__xeCJK_sub_cancel_bool
- \__xeCJK_sub_restore_or_cancel:x {#2}
+ \__xeCJK_sub_restore_or_cancel:e {#2}
\IfBooleanT {#1} { \xeCJKResetPunctClass }
}
}
@@ -2115,7 +2127,7 @@
\bool_if:NT \l__xeCJK_sub_cancel_bool
{
\bool_set_false:N \l__xeCJK_sub_cancel_bool
- \__xeCJK_sub_restore_or_cancel:x {#2}
+ \__xeCJK_sub_restore_or_cancel:e {#2}
\IfBooleanT {#1} { \xeCJKResetPunctClass }
}
}
@@ -2132,7 +2144,7 @@
{ \__xeCJK_error:nx { SubBlock-undefined } {##1} }
}
}
-\cs_generate_variant:Nn \__xeCJK_sub_restore_or_cancel:n { x }
+\cs_generate_variant:Nn \__xeCJK_sub_restore_or_cancel:n { e }
\__xeCJK_msg_new:nn { SubBlock-undefined }
{
The~CJK~sub~block~`#1'~is~undefined.\\\\
@@ -2149,7 +2161,7 @@
}
\xeCJK_declare_char_class:nn { #1/#2 } {#3}
}
-\cs_generate_variant:Nn \xeCJK_declare_sub_char_class:nnn { nx }
+\cs_generate_variant:Nn \xeCJK_declare_sub_char_class:nnn { ne }
\cs_new_protected:Npn \__xeCJK_set_sub_class_toks:nn #1#2
{
\seq_map_inline:Nn \g__xeCJK_base_class_seq
@@ -2212,16 +2224,16 @@
{
\IfBooleanTF {#1}
{
- \tl_map_inline:xn {#2}
+ \tl_map_inline:en {#2}
{ \tl_gset:cn { g__xeCJK_punct_bound_width/##1/tl } {#3} }
}
{
- \tl_map_inline:xn {#2}
+ \tl_map_inline:en {#2}
{ \tl_gset:cn { g__xeCJK_punct_width/##1/tl } {#3} }
}
}
\@onlypreamble \xeCJKsetwidth
-\cs_generate_variant:Nn \tl_map_inline:nn { x }
+\cs_generate_variant:Nn \tl_map_inline:nn { e }
\NewDocumentCommand \xeCJKsetkern { m m m }
{ \tl_gset:cn { g__xeCJK_punct/kern/#1/#2/tl } {#3} }
\@onlypreamble \xeCJKsetkern
@@ -2281,7 +2293,7 @@
\seq_map_inline:cn { \__xeCJK_special_punct_seq:n {#1} }
{ \cs_undefine:c { \__xeCJK_special_punct_tl:nN {#1} {##1} } }
\seq_gclear:c { \__xeCJK_special_punct_seq:n {#1} }
- \tl_map_inline:xn {#2}
+ \tl_map_inline:en {#2}
{
\tl_new:c { \__xeCJK_special_punct_tl:nN {#1} {##1} }
\seq_gput_right:cn { \__xeCJK_special_punct_seq:n {#1} } {##1}
@@ -2289,7 +2301,7 @@
}
\cs_new_protected:Npn \__xeCJK_add_special_punct:nn #1#2
{
- \tl_map_inline:xn {#2}
+ \tl_map_inline:en {#2}
{
\seq_if_in:cnF { \__xeCJK_special_punct_seq:n {#1} } {##1}
{
@@ -2300,7 +2312,7 @@
}
\cs_new_protected:Npn \__xeCJK_sub_special_punct:nn #1#2
{
- \tl_map_inline:xn {#2}
+ \tl_map_inline:en {#2}
{
\cs_undefine:c { \__xeCJK_special_punct_tl:nN {#1} {##1} }
\seq_gremove_all:cn { \__xeCJK_special_punct_seq:n {#1} } {##1}
@@ -2345,12 +2357,14 @@
}
\cs_new_protected:Npn \__xeCJK_save_punct_skip:nNNnnn #1#2#3#4#5#6
{
- \use:x
+ \exp_last_unbraced:Ne
+ \__xeCJK_save_punct_skip_aux:nnnnn
{
- \__xeCJK_save_punct_skip_aux:nnnnn {#1} { #1/#2/#3 }
- { \dim_eval:n {#4} }
- { \dim_max:nn { \c_zero_dim } {#5} }
- { \dim_max:nn { \c_zero_dim } {#6} }
+ {#1}
+ { #1/#2/#3 }
+ { \dim_eval:n {#4} }
+ { \dim_max:nn { \c_zero_dim } {#5} }
+ { \dim_max:nn { \c_zero_dim } {#6} }
}
}
\cs_new_protected:Npn \__xeCJK_save_punct_skip_aux:nnnnn #1#2#3#4#5
@@ -2364,7 +2378,7 @@
}
\cs_new_protected:Npn \__xeCJK_save_punct_width_aux:nnnn #1#2#3#4
{
- \__xeCJK_save_punct_width_aux:cxn
+ \__xeCJK_save_punct_width_aux:cen
{ \__xeCJK_punct_csname:n { #1/#3 } }
{ \use:c { #1_eval:n } {#4} }
{#2}
@@ -2377,7 +2391,7 @@
}
\prop_new:N \g__xeCJK_punct_skip_prop
\prop_gput:Non \g__xeCJK_punct_skip_prop { \skip_use:N \c_zero_skip } { }
-\cs_generate_variant:Nn \__xeCJK_save_punct_width_aux:Nnn { cx }
+\cs_generate_variant:Nn \__xeCJK_save_punct_width_aux:Nnn { ce }
\cs_new_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip:nNN
\DeclareObjectType { xeCJK / punctuation } { 0 }
\DeclareTemplateInterface { xeCJK / punctuation } { basic } { 0 }
@@ -3039,7 +3053,7 @@
\tex_the:D \tex_font:D
\xeCJK_clear_fallback_font:
}
- \exp_args:Nxx \__xeCJK_fallback_loop:nnNN
+ \exp_args:Nee \__xeCJK_fallback_loop:nnNN
}
\cs_new_protected:Npn \__xeCJK_clear_fallback_font:
{ \cs_set_eq:NN \xeCJK_reset_fallback_font: \prg_do_nothing: }
@@ -3050,7 +3064,6 @@
\cs_set_eq:NN \__xeCJK_fallback_loop:TF \use_i:nn
\__xeCJK_fallback_loop:nnnNN { FallBack }
}
-\cs_generate_variant:Nn \__xeCJK_fallback_loop:Nn { Nx }
\cs_new_protected:Npn \__xeCJK_fallback_loop:nnnNN #1#2#3
{
\xeCJK_select_fallback_font:nnn {#1} {#2} {#3}
@@ -3091,7 +3104,7 @@
}
\cs_new_protected:Npn \__xeCJK_fallback_font_initial_auxi:Nnnn #1
{
- \exp_args:NNx \__xeCJK_fallback_font_initial_auxii:Nnnnn
+ \exp_args:NNe \__xeCJK_fallback_font_initial_auxii:Nnnnn
#1 { \CJKfamilydefault }
}
\cs_new_protected:Npn \__xeCJK_fallback_font_initial_auxii:Nnnnn #1#2#3
@@ -3139,17 +3152,24 @@
\prop_get:NoNF \g__xeCJK_family_font_name_prop
\l__xeCJK_fallback_family_tl \l__xeCJK_font_name_tl
{ \tl_clear:N \l__xeCJK_font_name_tl }
- \clist_map_inline:nn {#3}
- {
- \tl_put_right:Nn \l__xeCJK_fallback_family_tl { /FallBack }
- \__xeCJK_get_sub_features:Vn \l__xeCJK_fallback_family_tl {##1}
- \clist_put_left:Nn \l__xeCJK_sub_font_options_clist {#2}
- \xeCJK_set_family:VVV \l__xeCJK_fallback_family_tl
- \l__xeCJK_sub_font_options_clist \l__xeCJK_sub_font_name_tl
- }
+ \clist_set:Nn \l__xeCJK_public_options_clist {#2}
+ \clist_map_function:nN {#3} \__xeCJK_set_family_fallback:n
\group_end:
}
+\cs_new_protected:Npn \__xeCJK_set_family_fallback:n #1
+ {
+ \tl_put_right:Nn \l__xeCJK_fallback_family_tl { /FallBack }
+ \__xeCJK_get_sub_features:on \l__xeCJK_fallback_family_tl {#1}
+ \clist_concat:NNN \l__xeCJK_sub_font_options_clist
+ \l__xeCJK_public_options_clist
+ \l__xeCJK_sub_font_options_clist
+ \exp_args:Nooo \xeCJK_set_family:nnn
+ \l__xeCJK_fallback_family_tl
+ \l__xeCJK_sub_font_options_clist
+ \l__xeCJK_sub_font_name_tl
+ }
\tl_new:N \l__xeCJK_fallback_family_tl
+\clist_new:N \l__xeCJK_public_options_clist
\bool_new:N \g__xeCJK_auto_fake_bold_bool
\bool_new:N \g__xeCJK_auto_fake_slant_bool
\fp_new:N \g__xeCJK_embolden_factor_fp
@@ -3212,11 +3232,11 @@
\q_mark [ \q_nil ] \q_mark \q_stop
\tl_if_empty:NTF \l__xeCJK_sub_font_name_tl
{ \tl_set_eq:NN \l__xeCJK_sub_font_name_tl \l__xeCJK_font_name_tl }
- { \tl_replace_all:NnV \l__xeCJK_sub_font_name_tl { * } \l__xeCJK_font_name_tl }
- \prop_put:Nnx \l__xeCJK_sub_key_prop {#1}
+ { \tl_replace_all:Nno \l__xeCJK_sub_font_name_tl { * } \l__xeCJK_font_name_tl }
+ \prop_put:Nne \l__xeCJK_sub_key_prop {#1}
{
- { \exp_not:V \l__xeCJK_sub_font_options_clist }
- { \exp_not:V \l__xeCJK_sub_font_name_tl }
+ { \exp_not:o \l__xeCJK_sub_font_options_clist }
+ { \exp_not:o \l__xeCJK_sub_font_name_tl }
}
}
\cs_new_protected:Npn \__xeCJK_get_sub_features:w #1 [#2] #3 \q_mark #4 \q_stop
@@ -3234,8 +3254,8 @@
\tl_new:N \l__xeCJK_sub_family_name_tl
\tl_new:N \l__xeCJK_sub_font_name_tl
\clist_new:N \l__xeCJK_sub_font_options_clist
-\cs_generate_variant:Nn \__xeCJK_get_sub_features:nn { V }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { NnV }
+\cs_generate_variant:Nn \__xeCJK_get_sub_features:nn { o }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { Nno }
\xeCJK_new_sub_key:n { FallBack }
\keys_define:nn { xeCJK / features }
{
@@ -3302,12 +3322,12 @@
\tl_set:Nn \l__xeCJK_font_name_tl {#3}
\clist_concat:NNN \l__xeCJK_font_options_clist
\g__xeCJK_default_features_clist \l__xeCJK_font_options_clist
- \keys_set_known:nVN { xeCJK / features }
+ \keys_set_known:noN { xeCJK / features }
\l__xeCJK_font_options_clist \l__xeCJK_fontspec_options_clist
\__xeCJK_binding_sub_family:
\__xeCJK_parse_font_shape:
- \__xeCJK_check_family:V \l__xeCJK_family_name_tl
- \__xeCJK_gset_family_cs:x { \l__xeCJK_family_name_tl }
+ \__xeCJK_check_family:o \l__xeCJK_family_name_tl
+ \__xeCJK_gset_family_cs:n { \l__xeCJK_family_name_tl }
\__xeCJK_save_family_info:
\__xeCJK_set_sub_block_family:
\group_end:
@@ -3315,22 +3335,22 @@
\tl_new:N \l__xeCJK_family_name_tl
\tl_new:N \l__xeCJK_font_name_tl
\clist_new:N \l__xeCJK_font_options_clist
-\cs_generate_variant:Nn \xeCJK_set_family:nnn { x , VVV , Voo }
+\cs_generate_variant:Nn \xeCJK_set_family:nnn { e , o }
\cs_new_protected:Npn \__xeCJK_binding_sub_family:
{
\tl_if_empty:NF \l__xeCJK_sub_family_name_tl
{ \tl_set_eq:NN \l__xeCJK_family_name_tl \l__xeCJK_sub_family_name_tl }
}
-\cs_new_protected:Npn \__xeCJK_gset_family_cs:x #1
+\cs_new_protected:Npn \__xeCJK_gset_family_cs:n #1
{
\cs_gset_protected:cpx { \__xeCJK_family_csname:n {#1} }
{
\group_begin:
\exp_not:n { \cs_set_eq:NN \xeCJK@fontfamily \use_none:n }
\exp_not:n { \fontspec_gset_family:Nnn \g__xeCJK_fontspec_family_tl }
- { \exp_not:V \l__xeCJK_fontspec_options_clist }
- { \exp_not:V \l__xeCJK_font_name_tl }
- \__xeCJK_gset_family_nfss_cs:xx
+ { \exp_not:o \l__xeCJK_fontspec_options_clist }
+ { \exp_not:o \l__xeCJK_font_name_tl }
+ \__xeCJK_gset_family_nfss_cs:no
{#1} { \exp_not:N \g__xeCJK_fontspec_family_tl }
\group_end:
\tl_set_eq:NN \exp_not:N \l__xeCJK_fontspec_family_tl
@@ -3351,12 +3371,12 @@
\__xeCJK_warning:nxx { CJKfamily-redef } {#1} { \l__xeCJK_tmp_tl }
}
}
-\cs_generate_variant:Nn \__xeCJK_check_family:n { V }
+\cs_generate_variant:Nn \__xeCJK_check_family:n { o }
\__xeCJK_msg_new:nn { CJKfamily-redef }
{ Redefining~CJKfamily~`\__xeCJK_msg_family_map:n {#1}'~(#2). }
\cs_new_protected:Npn \__xeCJK_parse_font_shape:
{
- \tl_if_blank:VTF \l__xeCJK_font_name_bf_tl
+ \tl_if_blank:oTF \l__xeCJK_font_name_bf_tl
{
\bool_if:NT \l__xeCJK_auto_fake_bold_bool
{
@@ -3366,9 +3386,9 @@
}
{
\clist_put_right:Nx \l__xeCJK_fontspec_options_clist
- { BoldFont = { \exp_not:V \l__xeCJK_font_name_bf_tl } }
+ { BoldFont = { \exp_not:o \l__xeCJK_font_name_bf_tl } }
}
- \tl_if_blank:VTF \l__xeCJK_font_name_it_tl
+ \tl_if_blank:oTF \l__xeCJK_font_name_it_tl
{
\bool_if:NT \l__xeCJK_auto_fake_slant_bool
{
@@ -3378,7 +3398,7 @@
}
{
\clist_put_right:Nx \l__xeCJK_fontspec_options_clist
- { ItalicFont = { \exp_not:V \l__xeCJK_font_name_it_tl } }
+ { ItalicFont = { \exp_not:o \l__xeCJK_font_name_it_tl } }
}
}
\prop_new:N \g__xeCJK_family_name_prop
@@ -3386,46 +3406,54 @@
\prop_new:N \g__xeCJK_family_font_options_prop
\cs_new_protected:Npn \__xeCJK_save_family_info:
{
- \prop_gput:NVV \g__xeCJK_family_font_name_prop
- \l__xeCJK_family_name_tl \l__xeCJK_font_name_tl
- \prop_gput:NVV \g__xeCJK_family_font_options_prop
- \l__xeCJK_family_name_tl \l__xeCJK_font_options_clist
+ \exp_args:Nooo \__xeCJK_save_family_info:nnn
+ \l__xeCJK_family_name_tl
+ \l__xeCJK_font_name_tl
+ \l__xeCJK_font_options_clist
+ }
+\cs_new_protected:Npn \__xeCJK_save_family_info:nnn #1#2#3
+ {
+ \prop_gput:Nnn \g__xeCJK_family_font_name_prop {#1} {#2}
+ \prop_gput:Nnn \g__xeCJK_family_font_options_prop {#1} {#3}
}
\cs_new_protected:Npn \__xeCJK_set_sub_block_family:
{
- \prop_map_inline:Nn \l__xeCJK_sub_key_prop
+ \prop_if_empty:NF \l__xeCJK_sub_key_prop
{
- \tl_set:Nx \l__xeCJK_sub_family_name_tl { \l__xeCJK_family_name_tl/##1 }
- \quark_if_no_value:nTF {##2}
- { \__xeCJK_copy_sub_family:n {##1} }
- {
- \xeCJK_set_family:Voo \l__xeCJK_sub_family_name_tl
- { \use_i:nn ##2 } { \use_ii:nn ##2 }
- }
+ \prop_map_function:NN
+ \l__xeCJK_sub_key_prop
+ \__xeCJK_set_sub_block_family:nn
}
}
+\cs_new_protected:Npn \__xeCJK_set_sub_block_family:nn #1#2
+ {
+ \tl_set:Nx \l__xeCJK_sub_family_name_tl { \l__xeCJK_family_name_tl/#1 }
+ \quark_if_no_value:nTF {#2}
+ { \__xeCJK_copy_sub_family:n {#1} }
+ { \xeCJK_set_family:onn \l__xeCJK_sub_family_name_tl #2 }
+ }
\cs_new_protected:Npn \__xeCJK_copy_sub_family:n #1
{
- \__xeCJK_check_family:V \l__xeCJK_sub_family_name_tl
+ \__xeCJK_check_family:o \l__xeCJK_sub_family_name_tl
\prop_get:NoNT \g__xeCJK_family_font_name_prop
\l__xeCJK_family_name_tl \l__xeCJK_sub_font_name_tl
{
- \prop_gput:NVV \g__xeCJK_family_font_name_prop
+ \prop_gput:Noo \g__xeCJK_family_font_name_prop
\l__xeCJK_sub_family_name_tl \l__xeCJK_sub_font_name_tl
}
\prop_get:NoNT \g__xeCJK_family_font_options_prop
\l__xeCJK_family_name_tl \l__xeCJK_sub_font_options_clist
{
\clist_remove_all:Nn \l__xeCJK_sub_font_options_clist { #1 = * }
- \prop_gput:NVV \g__xeCJK_family_font_options_prop
+ \prop_gput:Noo \g__xeCJK_family_font_options_prop
\l__xeCJK_sub_family_name_tl \l__xeCJK_sub_font_options_clist
}
\cs_gset_protected:cpx
{ \__xeCJK_family_csname:n { \l__xeCJK_sub_family_name_tl } }
{
- \xeCJK_family_if_exist:xT { \l__xeCJK_family_name_tl }
+ \xeCJK_family_if_exist:eT { \l__xeCJK_family_name_tl }
{
- \__xeCJK_gset_family_nfss_cs:xx
+ \__xeCJK_gset_family_nfss_cs:no
{ \l__xeCJK_sub_family_name_tl }
{ \exp_not:N \l__xeCJK_fontspec_family_tl }
}
@@ -3435,7 +3463,7 @@
{
\xeCJK_family_if_exist:nT {#2}
{
- \prop_gput:NnV \g__xeCJK_family_name_prop
+ \prop_gput:Nno \g__xeCJK_family_name_prop
{#1} \l__xeCJK_fontspec_family_tl
\tl_map_inline:nn
{
@@ -3444,15 +3472,14 @@
}
{
\prop_get:NnNT ##1 {#2} \l__xeCJK_tmp_tl
- { \prop_gput:NnV ##1 {#1} \l__xeCJK_tmp_tl }
+ { \prop_gput:Nno ##1 {#1} \l__xeCJK_tmp_tl }
}
\cs_gset_eq:cc
{ \__xeCJK_family_nfss_csname:n {#1} }
{ \__xeCJK_family_nfss_csname:n {#2} }
}
}
-\cs_new_protected:Npn \__xeCJK_copy_family:xx #1#2
- { \use:x { \__xeCJK_copy_family:nn {#1} {#2} } }
+\cs_generate_variant:Nn \__xeCJK_copy_family:nn { ee }
\cs_new:Npn \__xeCJK_font_csname:n #1
{ xeCJK/#1/\f@series/\f@shape/\f@size }
\tl_new:N \l_xeCJK_current_font_tl
@@ -3535,9 +3562,9 @@
}
\cs_new_protected:Npn \xeCJK_block_family:nn #1#2
{
- \xeCJK_family_if_exist:xF { #1/#2 }
+ \xeCJK_family_if_exist:eF { #1/#2 }
{
- \__xeCJK_copy_family:xx { #1/#2 }
+ \__xeCJK_copy_family:ee { #1/#2 }
{
\cs_if_exist:cTF
{ \__xeCJK_family_csname:n { \CJKfamilydefault/#2 } }
@@ -3558,7 +3585,7 @@
{ \__xeCJK_family_nfss_csname:n {#1} }
{ \__xeCJK_nfss_family:nn { \c__xeCJK_encoding_tl } {#2} }
}
-\cs_generate_variant:Nn \__xeCJK_gset_family_nfss_cs:nn { xx }
+\cs_generate_variant:Nn \__xeCJK_gset_family_nfss_cs:nn { no }
\cs_if_exist:NTF \fontseriesforce
{
\cs_new_protected:Npn \__xeCJK_nfss_family:nn #1#2
@@ -3596,15 +3623,16 @@
{#1} \l__xeCJK_fontspec_family_tl
{ \prg_return_true: }
{
- \cs_if_exist_use:cTF { \__xeCJK_family_csname:n {#1} }
+ \exp_args:Ne \cs_if_exist_use:cTF
+ { \__xeCJK_family_csname:n {#1} }
{ \prg_return_true: }
{ \prg_return_false: }
}
}
-\prg_generate_conditional_variant:Nnn \xeCJK_family_if_exist:n { x } { T , F , TF }
+\prg_generate_conditional_variant:Nnn \xeCJK_family_if_exist:n { e } { T , F , TF }
\NewDocumentCommand \CJKfamily { t+ t- m }
{
- \xeCJK_family:NNx #1 #2 {#3}
+ \xeCJK_family:NNe #1 #2 {#3}
\tex_ignorespaces:D
}
\cs_new_protected:Npn \xeCJK_family:NNn #1#2#3
@@ -3612,7 +3640,7 @@
\tl_if_blank:nTF {#3}
{
\bool_if:NF #1 { \bool_if:NF #2 { \use_none:nn } }
- \xeCJK_family_if_exist_use:x { \l_xeCJK_family_tl }
+ \xeCJK_family_if_exist_use:e { \l_xeCJK_family_tl }
}
{
\bool_if:NTF #2
@@ -3628,7 +3656,7 @@
}
}
}
-\cs_generate_variant:Nn \xeCJK_family:NNn { NNx }
+\cs_generate_variant:Nn \xeCJK_family:NNn { NNe }
\cs_new_protected:Npn \xeCJK_switch_family:n #1
{
\xeCJK_family_if_exist:nTF {#1}
@@ -3638,7 +3666,7 @@
}
{ \__xeCJK_family_unknown_warning:n {#1} }
}
-\cs_generate_variant:Nn \xeCJK_switch_family:n { x , o }
+\cs_generate_variant:Nn \xeCJK_switch_family:n { e , o }
\keys_define:nn { xeCJK / options }
{
PunctFamily .choice: ,
@@ -3652,7 +3680,7 @@
\cs_set_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font:
} ,
PunctFamily / unknown .code:n =
- { \xeCJK_punct_family:x {#1} } ,
+ { \xeCJK_punct_family:e {#1} } ,
}
\cs_new_protected:Npn \xeCJK_punct_family:n #1
{
@@ -3666,7 +3694,7 @@
}
{ \__xeCJK_family_unknown_warning:n {#1} }
}
-\cs_generate_variant:Nn \xeCJK_punct_family:n { x }
+\cs_generate_variant:Nn \xeCJK_punct_family:n { e }
\tl_new:N \l_xeCJK_family_tl
\tl_new:N \CJK@family
\cs_new_protected:Npn \__xeCJK_gobble_CJKfamily:
@@ -3678,7 +3706,7 @@
{ \__xeCJK_family_use:n {#1} }
{ \__xeCJK_family_unknown_warning:n {#1} }
}
-\cs_generate_variant:Nn \xeCJK_family_if_exist_use:n { x }
+\cs_generate_variant:Nn \xeCJK_family_if_exist_use:n { e }
\cs_new_protected:Npn \__xeCJK_family_unknown_warning:n #1
{
\prop_if_empty:NF \g__xeCJK_family_font_name_prop
@@ -3690,7 +3718,6 @@
}
}
}
-\cs_generate_variant:Nn \__xeCJK_family_unknown_warning:n { x }
\seq_new:N \g__xeCJK_unknown_family_seq
\__xeCJK_msg_new:nn { CJKfamily-Unknown }
{
@@ -3706,7 +3733,7 @@
\CJKttdefault { \token_to_str:N \setCJKmonofont }
}
{ \token_to_str:N \setCJKfamilyfont \{ #1 \} }
- [...]\{...\}
+ [<...>]\{<...>\}
}
\cs_new:Npn \__xeCJK_msg_family_map:n #1
{
@@ -3723,13 +3750,13 @@
\tl_if_novalue:nTF {#2}
{ \__xeCJK_post_arg:w {#1} {#3} {#4} }
{
- \use:x { #1 {#2} {#3} }
+ \use:e { #1 {#2} {#3} }
#4
}
}
\NewDocumentCommand \__xeCJK_post_arg:w { m m m O { } }
{
- \use:x { #1 {#4} {#2} }
+ \use:e { #1 {#4} {#2} }
#3
}
\NewDocumentCommand \setCJKmainfont { o m }
@@ -3786,7 +3813,7 @@
{ CJKfontspec/#1/#2/id } \l_xeCJK_family_tl
{ \xeCJK_switch_family:o { \l_xeCJK_family_tl } }
{
- \__xeCJK_fontspec:xnn
+ \__xeCJK_fontspec:enn
{ CJKfontspec ( \int_eval:n { \g__xeCJK_family_int + 1 } ) }
{#1} {#2}
}
@@ -3797,8 +3824,8 @@
\xeCJK_set_family:nnn {#1} {#2} {#3}
\xeCJK_switch_family:n {#1}
}
-\cs_generate_variant:Nn \xeCJK_fontspec:nn { VV }
-\cs_generate_variant:Nn \__xeCJK_fontspec:nnn { x }
+\cs_generate_variant:Nn \xeCJK_fontspec:nn { oo }
+\cs_generate_variant:Nn \__xeCJK_fontspec:nnn { e }
\prop_new:N \g__xeCJK_fontspec_prop
\clist_new:N \g__xeCJK_default_features_clist
\NewDocumentCommand \defaultCJKfontfeatures { m }
@@ -3806,7 +3833,7 @@
\@onlypreamble \defaultCJKfontfeatures
\NewDocumentCommand \addCJKfontfeatures { s O { } m }
{
- \xeCJK_add_font_features:Nxx #1 {#2} {#3}
+ \xeCJK_add_font_features:Nee #1 {#2} {#3}
\tex_ignorespaces:D
}
\cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures
@@ -3820,15 +3847,7 @@
{ \clist_remove_all:Nn \l__xeCJK_add_font_features_clist {##1} }
\seq_clear:N \l__xeCJK_sub_key_seq
\clist_clear:N \l__xeCJK_add_block_features_clist
- \clist_map_inline:nn {#2}
- {
- \seq_if_in:NnTF \g__xeCJK_sub_key_seq {##1}
- {
- \seq_put_right:Nn \l__xeCJK_sub_key_seq {##1}
- \__xeCJK_add_sub_class_features:n {##1}
- }
- { \__xeCJK_warning:nx { SubBlock-undefined } {##1} }
- }
+ \clist_map_function:nN {#2} \__xeCJK_add_sub_features:n
\bool_lazy_and:nnT
{#1}
{ \seq_if_empty_p:N \l__xeCJK_sub_key_seq }
@@ -3849,13 +3868,22 @@
\clist_concat:NNN \l__xeCJK_font_options_clist
\l__xeCJK_font_options_clist \l__xeCJK_add_block_features_clist
}
- \xeCJK_fontspec:VV \l__xeCJK_font_options_clist \l__xeCJK_font_name_tl
+ \xeCJK_fontspec:oo \l__xeCJK_font_options_clist \l__xeCJK_font_name_tl
}
{ \__xeCJK_warning:n { addCJKfontfeature-ignored } }
}
+\cs_new_protected:Npn \__xeCJK_add_sub_features:n #1
+ {
+ \seq_if_in:NnTF \g__xeCJK_sub_key_seq {#1}
+ {
+ \seq_put_right:Nn \l__xeCJK_sub_key_seq {#1}
+ \__xeCJK_add_sub_class_features:n {#1}
+ }
+ { \__xeCJK_warning:nx { SubBlock-undefined } {#1} }
+ }
\clist_new:N \l__xeCJK_add_font_features_clist
\clist_new:N \l__xeCJK_add_block_features_clist
-\cs_generate_variant:Nn \xeCJK_add_font_features:Nnn { Nxx , Nnx }
+\cs_generate_variant:Nn \xeCJK_add_font_features:Nnn { Nee , Nne }
\__xeCJK_msg_new:nn { addCJKfontfeature-ignored }
{
\token_to_str:N \addCJKfontfeature (s)~ignored.\\\\
@@ -3870,10 +3898,10 @@
{ \l_xeCJK_family_tl/#1 } \l__xeCJK_sub_font_options_clist
}
{
- \prop_get:NxNTF \g__xeCJK_family_font_name_prop
+ \prop_get:NeNTF \g__xeCJK_family_font_name_prop
{ \CJKfamilydefault/#1 } \l__xeCJK_sub_font_name_tl
{
- \prop_get:NxN \g__xeCJK_family_font_options_prop
+ \prop_get:NeN \g__xeCJK_family_font_options_prop
{ \CJKfamilydefault/#1 } \l__xeCJK_sub_font_options_clist
}
{
@@ -3888,23 +3916,23 @@
{
#1 =
{
- [ \exp_not:V \l__xeCJK_sub_font_options_clist ]
- { \exp_not:V \l__xeCJK_sub_font_name_tl }
+ [ \exp_not:o \l__xeCJK_sub_font_options_clist ]
+ { \exp_not:o \l__xeCJK_sub_font_name_tl }
}
}
}
-\cs_generate_variant:Nn \prop_get:NnN { Nx }
-\prg_generate_conditional_variant:Nnn \prop_get:NnN { Nx } { TF }
+\cs_generate_variant:Nn \prop_get:NnN { Ne }
+\prg_generate_conditional_variant:Nnn \prop_get:NnN { Ne } { T , TF }
\keys_define:nn { xeCJK / options }
{ LoadFandol .bool_gset:N = \g__xeCJK_fandol_bool }
\cs_new_protected:Npn \__xeCJK_load_fandol:
{
- \xeCJK_set_family:xnn { \CJKrmdefault }
+ \xeCJK_set_family:enn { \CJKrmdefault }
{ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular }
{ FandolSong-Regular }
- \xeCJK_set_family:xnn { \CJKsfdefault }
+ \xeCJK_set_family:enn { \CJKsfdefault }
{ Extension = .otf , BoldFont = FandolHei-Bold } { FandolHei-Regular }
- \xeCJK_set_family:xnn { \CJKttdefault }
+ \xeCJK_set_family:enn { \CJKttdefault }
{ Extension = .otf } { FandolFang-Regular }
}
\__xeCJK_at_end_preamble:n
@@ -3939,13 +3967,13 @@
}
\cs_new_protected:Npn \xeCJK_ensure_default_family:
{
- \xeCJK_family_if_exist:xF { \CJKfamilydefault }
+ \xeCJK_family_if_exist:eF { \CJKfamilydefault }
{
\tl_set_eq:NN \l__xeCJK_tmp_tl \CJKfamilydefault
\str_if_eq:eeTF { \CJKfamilydefault } { \CJKrmdefault }
{ \use:n }
{
- \xeCJK_family_if_exist:xTF { \CJKrmdefault }
+ \xeCJK_family_if_exist:eTF { \CJKrmdefault }
{ \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } }
}
{
@@ -3958,7 +3986,7 @@
\__xeCJK_warning:nxx { CJKfamilydefault-undefined }
{ \l__xeCJK_tmp_tl } { \CJKfamilydefault }
}
- \xeCJK_switch_family:x { \CJKfamilydefault }
+ \xeCJK_switch_family:e { \CJKfamilydefault }
\bool_if:NT \g__xeCJK_math_bool { \xeCJK_set_mathfont: }
}
\__xeCJK_msg_new:nn { no-CJKfamily }
@@ -3990,12 +4018,12 @@
\cs_new_protected:Npn \xeCJK_set_mathfont:
{
\cs_if_exist_use:N \__xeCJK_save_um_char:
- \xeCJK_family_if_exist:xTF { \c__xeCJK_math_tl }
+ \xeCJK_family_if_exist:eTF { \c__xeCJK_math_tl }
{ \__xeCJK_set_mathfont_aux: }
{
- \xeCJK_family_if_exist:xT { \CJKfamilydefault }
+ \xeCJK_family_if_exist:eT { \CJKfamilydefault }
{
- \__xeCJK_copy_family:xx { \c__xeCJK_math_tl } { \CJKfamilydefault }
+ \__xeCJK_copy_family:ee { \c__xeCJK_math_tl } { \CJKfamilydefault }
\__xeCJK_set_mathfont_aux:
}
}
@@ -4005,7 +4033,7 @@
{
\tl_const:Nx \c__xeCJK_math_family_tl
{ \l__xeCJK_fontspec_family_tl }
- \xeCJK_declare_mathfont:xx
+ \xeCJK_declare_mathfont:ee
{ \c__xeCJK_math_tl }
{ \c__xeCJK_math_family_tl }
\int_const:Nn \c_xeCJK_math_fam_int
@@ -4036,7 +4064,7 @@
\l__xeCJK_fontspec_family_tl \l__xeCJK_tmp_tl
{ \int_set:Nn \l__xeCJK_fam_int { \l__xeCJK_tmp_tl } }
{
- \xeCJK_declare_mathfont:xx
+ \xeCJK_declare_mathfont:ee
{ \c__xeCJK_math_tl / #1 }
{ \l__xeCJK_fontspec_family_tl }
\__xeCJK_set_mathfont_block_aux:cn
@@ -4062,10 +4090,11 @@
\SetSymbolFont {#1} { bold } { \c__xeCJK_encoding_tl }
{#2} { \bfdefault } { \shapedefault }
}
- \prop_gput:Nnx \g__xeCJK_fam_prop {#2} { \exp_not:c { sym #1 } }
+ \prop_gput:Nne \g__xeCJK_fam_prop {#2} { \exp_not:c { sym #1 } }
}
-\cs_generate_variant:Nn \prop_gput:Nnn { Nnx }
-\cs_generate_variant:Nn \xeCJK_declare_mathfont:nn { xx }
+\cs_generate_variant:Nn \prop_put:Nnn { Nne }
+\cs_generate_variant:Nn \prop_gput:Nnn { Nne }
+\cs_generate_variant:Nn \xeCJK_declare_mathfont:nn { ee }
\cs_new_protected:Npn \xeCJK_declare_symbol_font:nnnnn #1
{ \__xeCJK_declare_symbol_font:cnnnn { sym #1 } }
\cs_new_protected:Npn \__xeCJK_declare_symbol_font:Nnnnn #1
@@ -4243,38 +4272,7 @@
\cs_new_protected:Npn \__xeCJK_verb_addon:
{
\bool_if:NF \l__xeCJK_verb_addon_bool
- {
- \bool_set_true:N \l__xeCJK_verb_addon_bool
- \__xeCJK_set_char_class_eq:nn { FullLeft } { CJK }
- \__xeCJK_set_char_class_eq:nn { FullRight } { CJK }
- \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default }
- \__xeCJK_set_char_class_eq:nn { HalfRight } { Default }
- \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default }
- \cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue
- \cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue
- \cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue:
- \cs_set_eq:NN \__xeCJK_shipout_boundary:w \xeCJK_CJK_and_Boundary:w
- \cs_set_protected:Npx \xeCJKOffVerbAddon
- {
- \__xeCJK_reset_char_class:n { FullLeft }
- \__xeCJK_reset_char_class:n { FullRight }
- \__xeCJK_reset_char_class:n { HalfLeft }
- \__xeCJK_reset_char_class:n { HalfLeft }
- \__xeCJK_reset_char_class:n { NormalSpace }
- \bool_if:NTF \l__xeCJK_xecglue_bool
- { \keys_set:nn { xeCJK / options } { xCJKecglue = true } }
- { \keys_set:nn { xeCJK / options } { xCJKecglue = false } }
- \exp_not:n
- {
- \cs_set_eq:NN \CJKglue \__xeCJK_shipout_CJKglue:
- \cs_set_eq:NN \CJKecglue \__xeCJK_shipout_CJKecglue:
- \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_shipout_check_for_glue:
- \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_shipout_boundary:w
- }
- }
- \xeCJK_add_to_shipout:n { \xeCJKOffVerbAddon }
- \keys_set:nn { xeCJK / options } { xCJKecglue = false }
- }
+ { \__xeCJK_verb_addon_action: }
\skip_if_eq:nnTF { \l__xeCJK_verb_exspace_skip } { \c_zero_skip }
{
\xeCJK_cs_clear:N \CJKglue
@@ -4289,6 +4287,39 @@
\cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue
\cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_verb_CJK_and_Boundary:w
}
+\cs_new_protected:Npn \__xeCJK_verb_addon_action:
+ {
+ \bool_set_true:N \l__xeCJK_verb_addon_bool
+ \__xeCJK_set_char_class_eq:nn { FullLeft } { CJK }
+ \__xeCJK_set_char_class_eq:nn { FullRight } { CJK }
+ \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default }
+ \__xeCJK_set_char_class_eq:nn { HalfRight } { Default }
+ \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default }
+ \cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue
+ \cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue
+ \cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue:
+ \cs_set_eq:NN \__xeCJK_shipout_boundary:w \xeCJK_CJK_and_Boundary:w
+ \cs_set_protected:Npx \xeCJKOffVerbAddon
+ {
+ \__xeCJK_reset_char_class:n { FullLeft }
+ \__xeCJK_reset_char_class:n { FullRight }
+ \__xeCJK_reset_char_class:n { HalfLeft }
+ \__xeCJK_reset_char_class:n { HalfLeft }
+ \__xeCJK_reset_char_class:n { NormalSpace }
+ \bool_if:NTF \l__xeCJK_xecglue_bool
+ { \keys_set:nn { xeCJK / options } { xCJKecglue = true } }
+ { \keys_set:nn { xeCJK / options } { xCJKecglue = false } }
+ \exp_not:n
+ {
+ \cs_set_eq:NN \CJKglue \__xeCJK_shipout_CJKglue:
+ \cs_set_eq:NN \CJKecglue \__xeCJK_shipout_CJKecglue:
+ \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_shipout_check_for_glue:
+ \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_shipout_boundary:w
+ }
+ }
+ \xeCJK_add_to_shipout:n { \xeCJKOffVerbAddon }
+ \keys_set:nn { xeCJK / options } { xCJKecglue = false }
+ }
\cs_new_protected:Npn \__xeCJK_verb_CJK_and_Boundary:w
{ \xeCJK_class_group_end: \CJKecglue }
\cs_new_protected:Npn \__xeCJK_reset_char_class:n #1
@@ -4329,12 +4360,9 @@
\dim_compare:nNnTF \l__xeCJK_verb_exspace_skip < \c_zero_dim
{
\skip_zero:N \l__xeCJK_verb_exspace_skip
- \use:x
- {
- \__xeCJK_set_verb_scale:nn
- { \dim_to_fp:n { 2 \tex_fontdimen:D 2 ~ \tex_font:D } }
- { \dim_to_fp:n {#1} }
- }
+ \exp_args:Nee \__xeCJK_set_verb_scale:nn
+ { \dim_to_fp:n { 2 \tex_fontdimen:D 2 ~ \tex_font:D } }
+ { \dim_to_fp:n {#1} }
}
{
\tl_const:cx { xeCJK/verb/\CJK@family/\curr@fontshape/\f@size }
@@ -4347,9 +4375,9 @@
\__xeCJK_warning:nxx { scale-factor }
{ \fp_eval:n { trunc ( \l__xeCJK_scale_factor_fp , 4 ) } }
{ \fp_eval:n { ceil ( #2 / #1 , 4 ) } }
- \xeCJK_add_font_features:Nnx \c_true_bool
+ \xeCJK_add_font_features:Nne \c_true_bool
{ } { Scale = { \fp_use:N \l__xeCJK_scale_factor_fp } }
- \prop_gput:NVV \g__xeCJK_scale_family_prop
+ \prop_gput:Noo \g__xeCJK_scale_family_prop
\l__xeCJK_current_coor_tl \l_xeCJK_family_tl
}
\__xeCJK_msg_new:nn { scale-factor }
@@ -4545,7 +4573,7 @@
\exp_not:N \__xeCJK_family_default_wrap:n
{
\tl_if_exist:NTF \CJKfamilydefault
- { \exp_not:V \CJKfamilydefault }
+ { \exp_not:o \CJKfamilydefault }
{ \exp_not:N \CJKrmdefault }
}
}
@@ -4624,7 +4652,7 @@
}
\cs_new_protected:Npn \__xeCJK_math_robust_aux:NN #1#2
{
- \exp_args:Nx \str_case:nnTF { \cs_replacement_spec:N #1 }
+ \exp_args:Ne \str_case:nnTF { \cs_replacement_spec:N #1 }
{
{ \x@protect #1 \protect #2 } { }
{ \protect #2 } { }
@@ -4685,7 +4713,7 @@
\__xeCJK_math_robust:N \ensuremath
\ctex_if_format_at_least:nTF { 2020/10/01 }
{
- \cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:x
+ \cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:e
\ctex_gadd_ltxhook:nn { rmfamily } { \xeCJK@family { \CJKrmdefault } }
\ctex_gadd_ltxhook:nn { sffamily } { \xeCJK@family { \CJKsfdefault } }
\ctex_gadd_ltxhook:nn { ttfamily } { \xeCJK@family { \CJKttdefault } }
@@ -4694,7 +4722,7 @@
{
\cs_if_exist:NTF \@rmfamilyhook
{
- \cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:x
+ \cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:e
\g@addto@macro \@rmfamilyhook { \xeCJK@family { \CJKrmdefault } }
\g@addto@macro \@sffamilyhook { \xeCJK@family { \CJKsfdefault } }
\g@addto@macro \@ttfamilyhook { \xeCJK@family { \CJKttdefault } }
@@ -4714,17 +4742,17 @@
\cs_new_protected:Npn \xeCJK@fontfamily #1
{
\str_if_eq:nnTF {#1} { \familydefault }
- { \xeCJK_switch_family:x { \CJKfamilydefault } }
+ { \xeCJK_switch_family:e { \CJKfamilydefault } }
{ \__xeCJK_update_family_aux: }
}
\cs_new_protected:Npn \__xeCJK_update_family_aux:
{
\str_case_e:nn { \f@family }
{
- { \rmdefault } { \xeCJK_switch_family:x { \CJKrmdefault } }
- { \sfdefault } { \xeCJK_switch_family:x { \CJKsfdefault } }
- { \ttdefault } { \xeCJK_switch_family:x { \CJKttdefault } }
- { \familydefault } { \xeCJK_switch_family:x { \CJKfamilydefault } }
+ { \rmdefault } { \xeCJK_switch_family:e { \CJKrmdefault } }
+ { \sfdefault } { \xeCJK_switch_family:e { \CJKsfdefault } }
+ { \ttdefault } { \xeCJK_switch_family:e { \CJKttdefault } }
+ { \familydefault } { \xeCJK_switch_family:e { \CJKfamilydefault } }
}
}
}
@@ -4739,10 +4767,7 @@
{ \@@italiccorr }
}
\cs_new_protected:Npn \xeCJK_italic_correction:
- {
- \int_compare:nNnT \tex_lastnodetype:D = { 12 }
- { \__xeCJK_italic_correction: }
- }
+ { \__xeCJK_if_last_kern:T { \__xeCJK_italic_correction: } }
\cs_new_protected:Npn \__xeCJK_italic_correction:
{
\dim_case:nnF { \tex_lastkern:D }
@@ -4798,17 +4823,17 @@
{
\xeCJK_copy_inter_class_toks:nnnn {##1} { Others } {##1} { NormalSpace }
\xeCJK_copy_inter_class_toks:nnnn { Others } {##1} { NormalSpace } {##1}
- \xeCJK_app_inter_class_toks:nnx {##1} { Others }
+ \xeCJK_app_inter_class_toks:nne {##1} { Others }
{ \xeCJK_get_inter_class_toks:nn { Default } { Others } }
- \xeCJK_pre_inter_class_toks:nnx { Others } {##1}
+ \xeCJK_pre_inter_class_toks:nne { Others } {##1}
{ \xeCJK_get_inter_class_toks:nn { Others } { Default } }
- \xeCJK_if_blank_x:nT
+ \tl_if_blank:eT
{ \xeCJK_get_inter_class_toks:nn { Others } { Boundary } }
{
\xeCJK_copy_inter_class_toks:nnnn
{ Others } { Boundary } { Default } { Boundary }
}
- \xeCJK_if_blank_x:nT
+ \tl_if_blank:eT
{ \xeCJK_get_inter_class_toks:nn { Boundary } { Others } }
{
\xeCJK_copy_inter_class_toks:nnnn
@@ -4839,7 +4864,7 @@
\xeCJK_if_package_loaded:nTF { xunicode }
{ \__xeCJK_patch_xunicode_ambiguous_char: }
{
- \exp_args:Nx \__xeCJK_patch_tuenc_ambiguous_char:n
+ \exp_args:Ne \__xeCJK_patch_tuenc_ambiguous_char:n
{ \UnicodeEncodingName }
\__xeCJK_patch_tuenc_accent:
\__xeCJK_patch_tuenc_composite:
@@ -4874,13 +4899,14 @@
}
\cs_new_protected:Npn \__xeCJK_patch_ambiguous_char:nN #1#2
{
- \exp_args:Nx \__xeCJK_patch_ambiguous_char:nn
+ \exp_args:Ne \__xeCJK_patch_ambiguous_char:nn
{ #1 \token_to_str:N #2 }
{ #1 - #2 }
}
\cs_new_protected:Npx \__xeCJK_patch_ambiguous_char:nNn #1#2#3
{
- \exp_args:Nx \exp_not:N \__xeCJK_patch_ambiguous_char:nn
+ \exp_not:N \exp_args:Ne
+ \exp_not:N \__xeCJK_patch_ambiguous_char:nn
{
\c_backslash_str #1
\exp_not:N \token_to_str:N #2 -
@@ -4897,13 +4923,13 @@
{
\token_if_chardef:NTF #1
{
- \prop_gput:Nnx \c__xeCJK_ambiguous_slot_prop {#2}
+ \prop_gput:Nne \c__xeCJK_ambiguous_slot_prop {#2}
{ \int_eval:n {#1} }
\cs_set_protected:Npx #1
{ \__xeCJK_ambiguous_char:n { \tex_Uchar:D #1 } }
}
{
- \prop_gput:Nnx \c__xeCJK_ambiguous_slot_prop {#2}
+ \prop_gput:Nne \c__xeCJK_ambiguous_slot_prop {#2}
{ \int_eval:n { \exp_after:wN ` #1 } }
\cs_set_protected:Npx #1
{ \__xeCJK_ambiguous_char:n { \exp_not:o {#1} } }
@@ -5014,7 +5040,7 @@
}
\cs_new_protected:Npn \__xeCJK_get_ambiguous_slot:
{
- \exp_args:NNx \prop_get:NnNT \c__xeCJK_ambiguous_slot_prop
+ \prop_get:NeNT \c__xeCJK_ambiguous_slot_prop
{ \MT@encoding - \tex_the:D \MT@toks } \l__xeCJK_tmp_tl
{ \cs_set_eq:NN \MT@char \l__xeCJK_tmp_tl }
}