summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-30 21:06:15 +0000
committerKarl Berry <karl@freefriends.org>2018-01-30 21:06:15 +0000
commitf223ad48afe014b1314fd294f0e099232f46b63e (patch)
treeb757d99568ed6dede03f757f40094089706e23f2 /Master/texmf-dist/tex
parent4011de170d5d27b6758bef7c7146ab7297b80301 (diff)
xecjk (30jan18)
git-svn-id: svn://tug.org/texlive/trunk@46497 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty8
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg4
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty1653
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty154
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty8
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def8
6 files changed, 1216 insertions, 619 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
index 92fe13cbd7b..b19c1a82f24 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `listings')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2017 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2017 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{xeCJK patch file for listings}
\ProvidesExplPackage{xeCJK-listings}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } }
\ProcessOptions \scan_stop:
\RequirePackage { xeCJK }
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg
index 354fb8b2156..3101a8568ac 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg
@@ -6,10 +6,10 @@
%%
%% xeCJK.dtx (with options: `config')
%%
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{Configuration file for xeCJK package}
\ProvidesExplFile{\ExplFileName.cfg}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
%%
%%
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index 00dc7a2c4e6..22598d0c915 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `package')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2017 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2017 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -49,7 +49,7 @@
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
-\@ifpackagelater { expl3 } { 2017/07/19 } { }
+\@ifpackagelater { expl3 } { 2017/12/16 } { }
{ \msg_critical:nnn { xeCJK } { l3-too-old } { expl3 } }
\prg_new_conditional:Npnn \xeCJK_if_package_loaded:n #1 { p , T , F , TF }
{
@@ -98,8 +98,10 @@
\cs_new_protected_nopar:Npn \__xeCJK_warning:nxx { \msg_warning:nnxx { xeCJK } }
\cs_new_protected_nopar:Npn \__xeCJK_warning:nxxx { \msg_warning:nnxxx { xeCJK } }
\cs_new_protected_nopar:Npn \__xeCJK_info:nxx { \msg_info:nnxx { xeCJK } }
-\cs_new_protected_nopar:Npn \xeCJK_allow_break: { \tex_penalty:D \c_zero }
-\cs_new_protected_nopar:Npn \xeCJK_no_break: { \tex_penalty:D \c_ten_thousand }
+\cs_new_protected_nopar:Npn \xeCJK_allow_break:
+ { \tex_penalty:D \c_zero }
+\cs_new_protected_nopar:Npn \xeCJK_no_break:
+ { \tex_penalty:D \c_ten_thousand }
\tl_new:N \g__xeCJK_at_end_preamble_hook_tl
\tl_new:N \g__xeCJK_after_preamble_hook_tl
\tl_new:N \g__xeCJK_after_end_preamble_hook_tl
@@ -150,8 +152,6 @@
{ \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_nopar:Npn \xeCJK_reverse:nnn #1#2#3
- { \str_if_eq_x:nnTF {#1} {#2} {#3} {#2} }
\cs_new_protected_nopar:Npn \xeCJK_tl_remove_outer_braces:N #1
{ \tl_set:Nx #1 { \exp_args:NV \xeCJK_tl_remove_outer_braces:n #1 } }
\cs_new:Npn \xeCJK_tl_remove_outer_braces:n #1
@@ -190,7 +190,7 @@
}
\tl_const:Nn \c_xeCJK_space_skip_tl
{
- \int_compare:nNnTF \g__xeCJK_spacefactor_int = \c_one_thousand
+ \int_compare:nNnTF \g__xeCJK_space_factor_int = \c_one_thousand
{
\skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip
{
@@ -203,8 +203,11 @@
{
\skip_if_eq:nnTF \tex_spaceskip:D \c_zero_skip
{
- \int_compare:nNnTF \g__xeCJK_spacefactor_int < { 2000 }
- { \__xeCJK_space_skip_scale:nnn { \tex_fontdimen:D \c_two \tex_font:D } }
+ \int_compare:nNnTF \g__xeCJK_space_factor_int < { 2000 }
+ {
+ \__xeCJK_space_skip_scale:nnn
+ { \tex_fontdimen:D \c_two \tex_font:D }
+ }
{
\skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip
{
@@ -220,13 +223,16 @@
{ \tex_fontdimen:D \c_four \tex_font:D }
}
{
- \int_compare:nNnTF \g__xeCJK_spacefactor_int < { 2000 }
+ \int_compare:nNnTF \g__xeCJK_space_factor_int < { 2000 }
{ \__xeCJK_space_skip_scale:nnn { \tex_spaceskip:D } }
{
\skip_if_eq:nnTF \tex_xspaceskip:D \c_zero_skip
{
\__xeCJK_space_skip_scale:nnn
- { \tex_spaceskip:D + \tex_fontdimen:D \c_seven \tex_font:D }
+ {
+ \tex_spaceskip:D +
+ \tex_fontdimen:D \c_seven \tex_font:D
+ }
}
{ \tex_xspaceskip:D \use_none:nn }
}
@@ -238,13 +244,13 @@
\cs_new_nopar:Npn \__xeCJK_space_skip_scale:nnn #1#2#3
{
\dim_eval:n {#1}
- plus \fp_eval:n { \g__xeCJK_spacefactor_int / 1000 } #2
+ plus \fp_eval:n { \g__xeCJK_space_factor_int / 1000 } #2
minus
\int_div_truncate:nn
- { 1000 * \tex_number:D #3 } { \g__xeCJK_spacefactor_int } sp
+ { 1000 * \tex_number:D #3 } { \g__xeCJK_space_factor_int } sp
}
-\int_new:N \g__xeCJK_spacefactor_int
-\int_gset_eq:NN \g__xeCJK_spacefactor_int \c_one_thousand
+\int_new:N \g__xeCJK_space_factor_int
+\int_gset_eq:NN \g__xeCJK_space_factor_int \c_one_thousand
\cs_new_protected_nopar:Npn \xeCJK_glue_to_skip:nN #1#2
{
\group_begin:
@@ -271,14 +277,17 @@
\fi:
}
\cs_new_protected:Npn \xeCJK_int_until_do:nn #1#2
- { \__xeCJK_int_until_do:wn \use_none:n { \reverse_if:N \if_int_compare:w #1#2 } }
+ {
+ \__xeCJK_int_until_do:wn \use_none:n
+ { \reverse_if:N \if_int_compare:w #1#2 }
+ }
\cs_new_protected:Npn \__xeCJK_int_until_do:wn \use_none:n #1
{ #1 \exp_after:wN \__xeCJK_int_until_do:wn \fi: \use_none:n {#1} }
\int_new:N \l__xeCJK_begin_int
\int_new:N \l__xeCJK_end_int
\cs_new_protected:Npn \xeCJK_peek_catcode_ignore_spaces:NTF #1#2#3
{
- \cs_set_eq:NN \l__peek_search_token #1 \scan_stop:
+ \cs_set_eq:NN \l__xeCJK_peek_search_token #1 \scan_stop:
\tl_set:Nn \__xeCJK_peek_catcode_true:w { \group_align_safe_end: #2 }
\tl_set:Nn \__xeCJK_peek_catcode_false:w { \group_align_safe_end: #3 }
\bool_set_false:N \l__xeCJK_peek_ignore_spaces_bool
@@ -294,7 +303,7 @@
\tex_romannumeral:D 0
\else:
\if_catcode:w
- \exp_not:N \l_peek_token \exp_not:N \l__peek_search_token
+ \exp_not:N \l_peek_token \exp_not:N \l__xeCJK_peek_search_token
\exp_after:wN \exp_after:wN
\exp_after:wN \__xeCJK_peek_catcode_true:w
\else:
@@ -303,6 +312,7 @@
\fi:
\fi:
}
+\cs_new_eq:NN \l__xeCJK_peek_search_token ?
\tl_new:N \__xeCJK_peek_catcode_true:w
\tl_new:N \__xeCJK_peek_catcode_false:w
\bool_new:N \l__xeCJK_peek_ignore_spaces_bool
@@ -357,16 +367,17 @@
\group_end:
\prg_new_conditional:Npnn \xeCJK_if_CJK_class:N #1 { p , T , F , TF }
{
- \if_cs_exist:w \__xeCJK_CJK_class_tl:n { \xeCJK_token_value_class:N #1 } \cs_end:
+ \if_cs_exist:w
+ \__xeCJK_CJK_class_tl:n { \xeCJK_token_value_class:N #1 }
+ \cs_end:
\prg_return_true: \else: \prg_return_false: \fi:
}
\cs_new_nopar:Npn \__xeCJK_CJK_class_tl:n #1
{ c__xeCJK_CJK_class_ \int_eval:n {#1} _tl }
-\cs_generate_variant:Nn \__xeCJK_CJK_class_tl:n { c }
\prg_new_conditional:Npnn \xeCJK_if_same_class:NN #1#2 { p , T , F , TF }
{
- \if_int_compare:w
- \xeCJK_token_value_class:N #1 = \xeCJK_token_value_class:N #2 \exp_stop_f:
+ \if_int_compare:w \xeCJK_token_value_class:N #1 =
+ \xeCJK_token_value_class:N #2 \exp_stop_f:
\prg_return_true: \else: \prg_return_false: \fi:
}
\keys_define:nn { xeCJK / options }
@@ -376,8 +387,10 @@
xeCJKactive / false .code:n = { \makexeCJKinactive } ,
xeCJKactive .default:n = { true }
}
-\NewDocumentCommand \makexeCJKactive { } { \xetex_interchartokenstate:D = \c_one }
-\NewDocumentCommand \makexeCJKinactive { } { \xetex_interchartokenstate:D = \c_zero }
+\NewDocumentCommand \makexeCJKactive { }
+ { \xetex_interchartokenstate:D = \c_one }
+\NewDocumentCommand \makexeCJKinactive { }
+ { \xetex_interchartokenstate:D = \c_zero }
\char_set_catcode_ignore:n { "FEFF }
\seq_new:N \g__xeCJK_class_seq
\seq_new:N \g__xeCJK_new_class_seq
@@ -386,10 +399,12 @@
\int_if_exist:cTF { \__xeCJK_class_csname:n {#1} }
{ \__xeCJK_error:nx { class-already-defined } {#1} }
{
- \exp_args:Nc \newXeTeXintercharclass { \__xeCJK_class_csname:n {#1} }
+ \exp_args:Nc \newXeTeXintercharclass
+ { \__xeCJK_class_csname:n {#1} }
\clist_new:c { g__xeCJK_#1_range_clist }
\seq_gput_right:Nn \g__xeCJK_class_seq {#1}
- \seq_gput_right:Nv \g__xeCJK_new_class_seq { \__xeCJK_class_csname:n {#1} }
+ \seq_gput_right:Nv \g__xeCJK_new_class_seq
+ { \__xeCJK_class_csname:n {#1} }
}
}
\cs_new_protected_nopar:Npn \xeCJK_save_class:nn #1#2
@@ -447,24 +462,32 @@
}
\clist_const:Nn \c__xeCJK_PR_chars_clist
{ "FE69 , "FF04 , "FFE1 , "FFE5 , "FFE6 }
-\clist_const:Nx \c__xeCJK_FullLeft_chars_clist
- {
- \c__xeCJK_OP_chars_clist ,
- \c__xeCJK_PR_chars_clist
- }
+\clist_new:N \c__xeCJK_FullLeft_chars_clist
+\clist_gconcat:NNN \c__xeCJK_FullLeft_chars_clist
+ \c__xeCJK_OP_chars_clist
+ \c__xeCJK_PR_chars_clist
\clist_const:Nn \c__xeCJK_CL_chars_clist
{
- "00B7 , "2019 , "201D , "2013 , "2014 , "2025 , "2026 , "2027 ,
+ "00B7 , "2019 , "201D , "2013 , "2014 , "2025 , "2026 , "2027 , "2E3A ,
"3001 , "3002 , "3009 , "300B , "300D , "300F , "3011 , "3015 , "3017 , "3019 ,
"301B , "301E , "301F , "FE11 , "FE12 , "FE18 , "FE36 , "FE38 , "FE3A , "FE3C ,
"FE3E , "FE40 , "FE42 , "FE44 , "FE48 , "FE50 , "FE52 , "FE5A , "FE5C , "FE5E ,
"FF09 , "FF0C , "FF0E , "FF3D , "FF5D , "FF60 , "FF61 , "FF63 , "FF64
}
-\clist_const:Nn \c__xeCJK_hyphens_chars_clist { "301C , "30A0 }
+\clist_const:Nn \c__xeCJK_hyphens_chars_clist
+ { "301C , "30A0 , "FF5E }
\clist_const:Nn \c__xeCJK_iteration_marks_chars_clist
{ "3005 , "303B , "309D , "309E , "30FD , "30FE }
\clist_const:Nn \c__xeCJK_NS_chars_clist
{ "30FB , "FE54 , "FE55 , "FF1A , "FF1B , "FF65 , "16FE0 }
+\AtEndOfPackage
+ {
+ \cs_set:Npn \__xeCJK_tmp:w #1
+ { \char_generate:nn {#1} { \c_twelve } }
+ \__xeCJK_add_special_punct:nn { middle }
+ { \clist_map_function:NN \c__xeCJK_hyphens_chars_clist \__xeCJK_tmp:w }
+ \cs_undefine:N \__xeCJK_tmp:w
+ }
\clist_const:Nn \c__xeCJK_EX_chars_clist
{ "FE15 , "FE16 , "FE56 , "FE57 , "FF01 , "FF1F }
\clist_const:Nn \c__xeCJK_IS_chars_clist { "FE10 , "FE13 , "FE14 }
@@ -478,13 +501,19 @@
"FF70
}
\clist_const:Nn \c__xeCJK_PO_chars_clist { "FE6A , "FF05 , "FFE0 }
-\clist_const:Nx \c__xeCJK_FullRight_chars_clist
+\clist_new:N \c__xeCJK_FullRight_chars_clist
+\tl_map_inline:nn
{
- \c__xeCJK_CL_chars_clist ,
- \c__xeCJK_NS_chars_clist ,
- \c__xeCJK_EX_chars_clist ,
- \c__xeCJK_IS_chars_clist ,
+ \c__xeCJK_CL_chars_clist
+ \c__xeCJK_NS_chars_clist
+ \c__xeCJK_EX_chars_clist
+ \c__xeCJK_IS_chars_clist
\c__xeCJK_PO_chars_clist
+ \c__xeCJK_hyphens_chars_clist
+ }
+ {
+ \clist_gconcat:NNN \c__xeCJK_FullRight_chars_clist
+ \c__xeCJK_FullRight_chars_clist #1
}
\clist_const:Nn \c__xeCJK_CJK_chars_clist
{
@@ -537,7 +566,8 @@
"A960 -> "A97F ,
"D7B0 -> "D7FF
}
-\cs_new_nopar:Npn \xeCJK_class_num:n #1 { \use:c { \__xeCJK_class_csname:n {#1} } }
+\cs_new_nopar:Npn \xeCJK_class_num:n #1
+ { \use:c { \__xeCJK_class_csname:n {#1} } }
\NewDocumentCommand \xeCJKDeclareCharClass { s > { \TrimSpaces } m m }
{
\xeCJK_declare_char_class:nn {#2} {#3}
@@ -565,7 +595,6 @@
\NewDocumentCommand \__xeCJK_set_char_class_aux:Nnw
{ m > { \SplitArgument { 1 } { -> } } m } { #1 #2 }
\cs_generate_variant:Nn \clist_gconcat:NNN { cc }
-\cs_generate_variant:Nn \xeCJK_declare_char_class:nn { nc }
\cs_new_protected_nopar:Npn \__xeCJK_check_num_range:nnNN #1#2#3#4
{
\bool_lazy_or:nnTF
@@ -576,8 +605,8 @@
\int_set_eq:NN #3 #4
}
{
- \int_set:Nn #3 { \int_min:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } }
- \int_set:Nn #4 { \int_max:nn {#1} { \IfNoValueTF {#2} {#1} {#2} } }
+ \int_set:Nn #3 { \int_min:nn {#1} { \tl_if_novalue:nTF {#2} {#1} {#2} } }
+ \int_set:Nn #4 { \int_max:nn {#1} { \tl_if_novalue:nTF {#2} {#1} {#2} } }
}
}
\token_if_letter:NF ^^^^ac00
@@ -636,10 +665,16 @@
}
\xeCJKResetCharClass
\cs_new_protected_nopar:Npn \xeCJK_inter_class_toks:nnn #1#2#3
- { \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} = {#3} }
-\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnx }
+ {
+ \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~
+ \xeCJK_class_num:n {#2} = {#3}
+ }
+\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnx }
\cs_new_nopar:Npn \xeCJK_get_inter_class_toks:nn #1#2
- { \tex_the:D \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~ \xeCJK_class_num:n {#2} }
+ {
+ \tex_the:D \xetex_interchartoks:D \xeCJK_class_num:n {#1} ~
+ \xeCJK_class_num:n {#2}
+ }
\cs_new_protected_nopar:Npn \xeCJK_clear_inter_class_toks:nn #1#2
{ \xeCJK_inter_class_toks:nnn {#1} {#2} { \prg_do_nothing: } }
\cs_new_protected_nopar:Npn \xeCJK_pre_inter_class_toks:nnn #1#2#3
@@ -653,13 +688,15 @@
\xeCJK_inter_class_toks:nnx {#1} {#2}
{ \xeCJK_get_inter_class_toks:nn {#1} {#2} \exp_not:n {#3} }
}
-\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnc , nnx }
+\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnx }
\cs_new_protected_nopar:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4
{
- \tl_set:Nx \l__xeCJK_tmp_tl { \xeCJK_get_inter_class_toks:nn {#3} {#4} }
+ \tl_set:Nx \l__xeCJK_tmp_tl
+ { \xeCJK_get_inter_class_toks:nn {#3} {#4} }
\tl_if_empty:NTF \l__xeCJK_tmp_tl
{
- \tl_set:Nx \l__xeCJK_tmp_tl { \xeCJK_get_inter_class_toks:nn {#1} {#2} }
+ \tl_set:Nx \l__xeCJK_tmp_tl
+ { \xeCJK_get_inter_class_toks:nn {#1} {#2} }
\tl_if_empty:NF \l__xeCJK_tmp_tl
{ \xeCJK_clear_inter_class_toks:nn {#1} {#2} }
}
@@ -667,11 +704,13 @@
}
\cs_new_protected_nopar:Npn \xeCJK_replace_inter_class_toks:nnnn #1#2#3#4
{
- \tl_set:Nx \l__xeCJK_tmp_tl { \xeCJK_get_inter_class_toks:nn {#1} {#2} }
+ \tl_set:Nx \l__xeCJK_tmp_tl
+ { \xeCJK_get_inter_class_toks:nn {#1} {#2} }
\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} { \exp_not:o \l__xeCJK_tmp_tl }
+ \xeCJK_inter_class_toks:nnx {#1} {#2}
+ { \exp_not:o \l__xeCJK_tmp_tl }
}
}
\cs_new_protected_nopar:Npn \xeCJK_clear_Boundary_and_CJK_toks:
@@ -682,8 +721,8 @@
{
\exp_not:o { \xeCJK_clear_Boundary_and_CJK_toks: }
\xetex_interchartoks:D
- \xeCJK_class_num:n { Boundary } ~ \xeCJK_class_num:n {#1}
- = { \exp_not:N \prg_do_nothing: }
+ \xeCJK_class_num:n { Boundary } ~
+ \xeCJK_class_num:n {#1} = { \exp_not:N \prg_do_nothing: }
}
}
\seq_new:N \g__xeCJK_base_class_seq
@@ -695,7 +734,9 @@
\cs_new_protected_nopar:Npn \__xeCJK_save_CJK_class:n #1
{
\seq_gput_right:Nn \g__xeCJK_CJK_class_seq {#1}
- \tl_const:cn { \__xeCJK_CJK_class_tl:c { \__xeCJK_class_csname:n {#1} } } {#1}
+ \tl_const:cn
+ { \__xeCJK_CJK_class_tl:n { \use:c { \__xeCJK_class_csname:n {#1} } } }
+ {#1}
\__xeCJK_update_clear_toks:n {#1}
}
\clist_map_function:nN
@@ -704,7 +745,7 @@
{
\c_group_begin_token
\bool_set_true:N \l__xeCJK_CJK_group_bool
- \int_gset_eq:NN \g__xeCJK_spacefactor_int \c_one_thousand
+ \int_gset_eq:NN \g__xeCJK_space_factor_int \c_one_thousand
\int_zero:N \xetex_dashbreakstate:D
}
\bool_new:N \l__xeCJK_CJK_group_bool
@@ -747,8 +788,10 @@
}
\clist_map_inline:nn { Default , HalfLeft }
{
- \xeCJK_inter_class_toks:nnn { Boundary } {#1} { \xeCJK_Boundary_and_Default: }
- \xeCJK_app_inter_class_toks:nnn { CJK } {#1} { \CJKecglue }
+ \xeCJK_inter_class_toks:nnn { Boundary } {#1}
+ { \xeCJK_Boundary_and_Default: }
+ \xeCJK_app_inter_class_toks:nnn { CJK } {#1}
+ { \CJKecglue }
}
\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_Default:
{ \xeCJK_check_for_ecglue: }
@@ -779,7 +822,9 @@
{
\xeCJK_if_last_node:nTF { CJK }
{
- \skip_if_eq:nnTF { \l__xeCJK_last_skip } { \c_xeCJK_space_skip_tl }
+ \skip_if_eq:nnTF
+ { \l__xeCJK_last_skip }
+ { \c_xeCJK_space_skip_tl }
{ \xeCJK_remove_node: \CJKecglue }
{ \skip_horizontal:N \l__xeCJK_last_skip }
}
@@ -791,7 +836,7 @@
{
\xeCJK_inter_class_toks:nnn {#1} { Boundary }
{
- \int_gset_eq:NN \g__xeCJK_spacefactor_int \tex_spacefactor:D
+ \int_gset_eq:NN \g__xeCJK_space_factor_int \tex_spacefactor:D
\peek_meaning_remove:NTF \tex_italiccorrection:D
{
\tex_italiccorrection:D
@@ -820,10 +865,11 @@
\xeCJK_if_last_node:nT { CJK-space }
{ \xeCJK_remove_node: \xeCJK_space_or_xecglue: }
}
-\cs_new_eq:NN \xeCJK_check_for_ecglue_normalsp: \__xeCJK_check_for_ecglue_normalsp:
+\cs_new_eq:NN \xeCJK_check_for_ecglue_normalsp:
+ \__xeCJK_check_for_ecglue_normalsp:
\xeCJK_inter_class_toks:nnn { NormalSpace } { Boundary }
{
- \int_gset_eq:NN \g__xeCJK_spacefactor_int \tex_spacefactor:D
+ \int_gset_eq:NN \g__xeCJK_space_factor_int \tex_spacefactor:D
\peek_meaning_remove:NTF \tex_italiccorrection:D
{
\tex_italiccorrection:D
@@ -845,21 +891,43 @@
}
\cs_new_protected_nopar:Npn \xeCJK_check_for_glue:
{
- \bool_lazy_or:nnTF
- { \xeCJK_if_last_node_p:n { CJK } }
- { \xeCJK_if_last_node_p:n { CJK-space } }
- { \xeCJK_remove_node: \CJKglue }
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_twelve
+ { \__xeCJK_check_for_glue_auxi: }
{
- \xeCJK_if_last_node:nTF { CJK-widow }
- { \xeCJK_remove_node: \xeCJK_widow_penalty: \CJKglue }
- {
- \bool_lazy_or:nnTF
- { \xeCJK_if_last_node_p:n { default } }
- { \int_compare_p:nNn \etex_lastnodetype:D = \c_ten }
- { \xeCJK_remove_node: \CJKecglue }
- { \xeCJK_check_for_xglue: }
- }
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_ten
+ { \xeCJK_remove_node: \CJKecglue }
+ { \__xeCJK_check_for_glue_auxii: }
+ }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxi:
+ {
+ \dim_case:nn { \tex_lastkern:D }
+ {
+ { \__xeCJK_node:n { CJK } }
+ { \xeCJK_remove_node: \CJKglue }
+ { \__xeCJK_node:n { CJK-space } }
+ { \xeCJK_remove_node: \CJKglue }
+ { \__xeCJK_node:n { CJK-widow } }
+ { \xeCJK_remove_node: \xeCJK_widow_penalty: \CJKglue }
+ { \__xeCJK_node:n { default } }
+ { \xeCJK_remove_node: \CJKecglue }
+ }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxii:
+ {
+ \xeCJK_if_last_punct:TF
+ { \__xeCJK_check_for_glue_auxiii: }
+ { \xeCJK_check_for_xglue: }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_check_for_glue_auxiii:
+ {
+ \bool_if:NT \l__xeCJK_last_penalty_bool
+ {
+ \__xeCJK_add_offset_skip:N \l__xeCJK_last_skip
+ \tex_penalty:D \l__xeCJK_last_penalty_int
}
+ \skip_horizontal:N \l__xeCJK_last_skip
+ \tl_if_eq:NNF \l__xeCJK_aligni_tl \c__xeCJK_left_tl { \CJKglue }
}
\cs_new_eq:NN \xeCJK_check_for_xglue: \prg_do_nothing:
\cs_new_protected_nopar:Npn \__xeCJK_check_for_xglue:
@@ -879,7 +947,9 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_check_for_xglue_aux:
{
- \skip_if_eq:nnTF { \l__xeCJK_last_skip } { \c_xeCJK_space_skip_tl }
+ \skip_if_eq:nnTF
+ { \l__xeCJK_last_skip }
+ { \c_xeCJK_space_skip_tl }
{
\xeCJK_if_last_node:nTF { CJK }
{ \xeCJK_remove_node: \__xeCJK_ccglue_or_space: }
@@ -912,11 +982,9 @@
\int_new:N \g__xeCJK_node_int
\int_gset_eq:NN \g__xeCJK_node_int \c_ten
\cs_new_protected_nopar:Npn \xeCJK_make_node:n #1
- {
- \exp_after:wN \__xeCJK_make_node:N
- \cs:w c__xeCJK_#1_node_dim \exp_after:wN \cs_end:
- \exp_after:wN \tex_spacefactor:D \int_use:N \tex_spacefactor:D \exp_stop_f:
- }
+ { \exp_args:Nc \__xeCJK_make_node:N { c__xeCJK_#1_node_dim } }
+\cs_new_nopar:Npn \__xeCJK_node:n #1
+ { \use:c { c__xeCJK_#1_node_dim } }
\cs_new_protected_nopar:Npn \__xeCJK_make_node:N #1
{
\tex_kern:D - #1
@@ -1093,8 +1161,10 @@
{ \group_align_safe_end: }
}
\cs_new_eq:NN \__xeCJK_ignore_space_end: \group_align_safe_end:
-\xeCJK_inter_class_toks:nnn { CJK } { CJK } { \xeCJK_CJK_and_CJK:N }
-\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N #1 { \CJKglue \CJKsymbol {#1} }
+\xeCJK_inter_class_toks:nnn { CJK } { CJK }
+ { \xeCJK_CJK_and_CJK:N }
+\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N
+ { \CJKglue \CJKsymbol }
\xeCJK_inter_class_toks:nnn { FullLeft } { CJK }
{ \xeCJK_FullLeft_and_CJK: \CJKsymbol }
\xeCJK_inter_class_toks:nnn { FullRight } { CJK }
@@ -1105,56 +1175,216 @@
{
\xeCJK_inter_class_toks:nnx {#1} {##1}
{ \exp_not:c { xeCJK_Default_and_##1:nN } {#1} }
- \xeCJK_inter_class_toks:nnc {##1} {#1} { xeCJK_##1_and_Default: }
+ \xeCJK_inter_class_toks:nnx {##1} {#1}
+ { \exp_not:c { xeCJK_##1_and_Default: } }
}
}
\xeCJK_inter_class_toks:nnn { Boundary } { FullLeft }
{ \xeCJK_Boundary_and_FullLeft:N }
\xeCJK_inter_class_toks:nnn { Boundary } { FullRight }
{ \xeCJK_Boundary_and_FullRight:N }
-\xeCJK_app_inter_class_toks:nnn { FullLeft } { Boundary } { \tex_ignorespaces:D }
+\xeCJK_inter_class_toks:nnn { FullLeft } { Boundary }
+ { \xeCJK_FullLeft_and_Boundary: }
\xeCJK_inter_class_toks:nnn { FullRight } { Boundary }
{ \xeCJK_FullRight_and_Boundary: }
+\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Boundary:
+ {
+ \__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
+ {
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \xeCJK_class_group_end:
+ \exp_after:wN \xeCJK_punct_node:N \g__xeCJK_last_punct_tl
+ \xeCJK_no_break:
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
+ }
+ {
+ \xeCJK_class_group_end:
+ \exp_after:wN \xeCJK_punct_node:N \g__xeCJK_last_punct_tl
+ \xeCJK_no_break: \__xeCJK_zero_glue:
+ }
+ \tex_ignorespaces:D
+ }
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Boundary:
- { \xeCJK_FullRight_and_Default: \tex_ignorespaces:D }
+ {
+ \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \xeCJK_class_group_end:
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \exp_after:wN \xeCJK_punct_node:N \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \tex_ignorespaces:D
+ }
+\cs_new_protected_nopar:Npn \xeCJK_punct_node:N #1
+ {
+ \__xeCJK_punct_bound_unitization:NN #1 \l__xeCJK_tmp_dim
+ \__xeCJK_make_node:N \l__xeCJK_tmp_dim
+ \dim_set:Nn \l__xeCJK_tmp_dim { `#1 sp }
+ \__xeCJK_make_node:N \l__xeCJK_tmp_dim
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_unitization:NN #1#2
+ {
+ \dim_set:Nn #2
+ {
+ \dim_max:nn
+ { \c_zero_dim }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 }
+ }
+ \dim_compare:nNnF {#2} < { 1pt }
+ { \dim_set:Nn #2 { -1pt * \dim_ratio:nn {#2} { \c_max_dim } } }
+ }
+\cs_new_protected_nopar:Npn \xeCJK_punct_bound_kern:N #1
+ {
+ \exp_after:wN \__xeCJK_punct_bound_kern:NN
+ \g__xeCJK_last_punct_tl #1
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern:NN #1#2
+ {
+ \xeCJK_get_punct_bounds:NN \l__xeCJK_aligni_tl #1
+ \xeCJK_get_punct_kerning:NN #1 #2
+ \__xeCJK_punct_bound_unitization:NN #1 \l__xeCJK_tmp_dim
+ \skip_set:Nn \l__xeCJK_punct_kern_skip
+ { \__xeCJK_use_dim_or_skip:nNN { bound_kern } #1 #2 }
+ \dim_compare:nNnF \l__xeCJK_tmp_dim = \l__xeCJK_last_bound_dim
+ { \__xeCJK_punct_bound_kern_ratio:NN #1 #2 }
+ \__xeCJK_add_offset_skip:N \l__xeCJK_punct_kern_skip
+ \bool_if:NTF \l__xeCJK_last_penalty_bool
+ {
+ \tex_penalty:D \l__xeCJK_last_penalty_int
+ \skip_horizontal:N
+ }
+ { \__xeCJK_punct_bound_kern_aux:NNN #1 #2 }
+ \l__xeCJK_punct_kern_skip
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_add_offset_skip:N #1
+ {
+ \tl_if_eq:NNF \l__xeCJK_aligni_tl \c__xeCJK_left_tl
+ {
+ \int_compare:nNnT \etex_lastnodetype:D = \c_eleven
+ {
+ \skip_add:Nn #1 { \tex_lastskip:D }
+ \tex_unskip:D
+ }
+ }
+ }
+\skip_new:N \l__xeCJK_punct_kern_skip
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_ratio:NN #1#2
+ {
+ \dim_set:Nn \l__xeCJK_bound_dim
+ { \__xeCJK_use_punct_dim:nNN { bound_width } #1 #2 }
+ \dim_compare:nNnT \l__xeCJK_bound_dim > \c_zero_dim
+ {
+ \dim_compare:nNnF \l__xeCJK_last_bound_dim > \c_zero_dim
+ {
+ \dim_set:Nn \l__xeCJK_last_bound_dim
+ {
+ - \l__xeCJK_last_bound_dim *
+ \dim_ratio:nn { \c_max_dim } { 1pt }
+ }
+ }
+ \__xeCJK_punct_bound_kern_ratio_aux:N #2
+ }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_ratio_aux:N #1
+ {
+ \skip_set:Nn \l__xeCJK_punct_kern_skip
+ {
+ \l__xeCJK_punct_kern_skip *
+ \dim_ratio:nn
+ {
+ \l__xeCJK_last_bound_dim
+ + \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #1
+ }
+ { \l__xeCJK_bound_dim }
+ }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:N
+ { \xeCJK_no_break: \skip_horizontal:N }
+\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:n
+ { \xeCJK_no_break: \skip_horizontal:n }
+\cs_new_eq:NN \__xeCJK_punct_bound_kern:N \__xeCJK_nobreak_hskip:N
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_breakable_kern:N
+ {
+ \tl_if_eq:NNTF \l__xeCJK_aligni_tl \c__xeCJK_right_tl
+ {
+ \tl_if_eq:NNTF \l__xeCJK_alignii_tl \c__xeCJK_left_tl
+ { \skip_horizontal:N }
+ { \__xeCJK_nobreak_hskip:N }
+ }
+ { \__xeCJK_nobreak_hskip:N }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_aux:NNN #1#2
+ {
+ \str_if_eq:nnTF {#1} {#2}
+ { \__xeCJK_punct_bound_kern:N }
+ {
+ \__xeCJK_punct_if_long:NTF #1
+ { \skip_horizontal:N }
+ {
+ \__xeCJK_punct_if_long:NTF #2
+ { \skip_horizontal:N }
+ { \__xeCJK_punct_bound_kern:N }
+ }
+ }
+ }
\clist_map_inline:nn { CJK , FullLeft , FullRight }
{
\clist_map_inline:nn { FullLeft , FullRight }
- { \xeCJK_inter_class_toks:nnc {#1} {##1} { xeCJK_#1_and_##1:N } }
+ {
+ \xeCJK_inter_class_toks:nnx {#1} {##1}
+ { \exp_not:c { xeCJK_#1_and_##1:N } }
+ }
}
\cs_new_protected_nopar:Npn \__xeCJK_punct_bound_rule:NN #1#2
{
\tex_vrule:D
- width - \__xeCJK_use_punct_dim:nnn { bound } {#1} {#2}
+ width - \__xeCJK_use_punct_dim:nNN { bound } #1 #2 ~
depth \c_zero_dim
height \c_zero_dim \scan_stop:
}
\cs_new_protected_nopar:Npn \__xeCJK_punct_rule:NN #1#2
{
\tex_vrule:D
- width \__xeCJK_use_punct_dim:nnn { rule } {#1} {#2}
+ width \__xeCJK_use_punct_dim:nNN { rule } #1 #2 ~
depth \c_zero_dim
height \c_zero_dim \scan_stop:
}
\cs_new_protected_nopar:Npn \__xeCJK_punct_offset:NN #1#2
- { \__xeCJK_punct_kern:n { - \__xeCJK_use_punct_dim:nnn { offset } {#1} {#2} } }
-\cs_new_protected_nopar:Npn \__xeCJK_punct_kern:n #1
{
- \dim_set:Nn \l__xeCJK_tmp_dim {#1}
+ \dim_set:Nn \l__xeCJK_tmp_dim
+ { - \__xeCJK_use_punct_dim:nNN { offset } #1 #2 }
\dim_compare:nNnF \l__xeCJK_tmp_dim = \c_zero_dim
- { \tex_kern:D \l__xeCJK_tmp_dim }
+ { \__xeCJK_punct_hskip:n { \l__xeCJK_tmp_dim } }
}
\cs_new_protected_nopar:Npn \__xeCJK_punct_glue:NN #1#2
- {
- \__xeCJK_punct_hskip:n
- { \__xeCJK_use_dim_or_skip:nnn { glue } {#1} {#2} }
- }
+ { \__xeCJK_punct_hskip:n { \__xeCJK_use_dim_or_skip:nNN { glue } #1 #2 } }
\cs_new_eq:NN \__xeCJK_punct_hskip:n \skip_horizontal:n
\cs_new_protected_nopar:Npn \__xeCJK_punct_kern:NN #1#2
{
- \__xeCJK_nobreak_hskip:n
- { \__xeCJK_use_dim_or_skip:nnn { kern } {#1} {#2} }
+ \str_if_eq_x:nnTF {#1} {#2}
+ { \__xeCJK_punct_nobreak_kern:NN }
+ {
+ \__xeCJK_punct_if_long:NTF #1
+ { \__xeCJK_punct_breakable_kern:NN }
+ {
+ \__xeCJK_punct_if_long:NTF #2
+ { \__xeCJK_punct_breakable_kern:NN }
+ { \__xeCJK_punct_nobreak_kern:NN }
+ }
+ }
+ #1 #2
+ }
+\cs_new_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_kern:NN
+\cs_new_protected_nopar:Npn \__xeCJK_punct_nobreak_kern:NN #1#2
+ { \__xeCJK_nobreak_hskip:n { \__xeCJK_use_dim_or_skip:nNN { kern } #1 #2 } }
+\cs_new_protected_nopar:Npn \__xeCJK_punct_breakable_kern:NN #1#2
+ {
+ \exp_after:wN \__xeCJK_punct_if_right:NT #1
+ { \__xeCJK_punct_rule:NN \c__xeCJK_right_tl #1 }
+ \__xeCJK_punct_breakable_kern:n
+ { \__xeCJK_use_dim_or_skip:nNN { break_kern } #1 #2 }
+ \__xeCJK_punct_if_right:NF #2
+ { \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #2 }
}
+\cs_new_eq:NN \__xeCJK_punct_breakable_kern:n \skip_horizontal:n
\tl_new:N \g__xeCJK_last_punct_tl
\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_CJK:
{
@@ -1162,9 +1392,10 @@
{
\__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_no_break:
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
}
- { \xeCJK_no_break: }
+ { }
+ \__xeCJK_select_font:
}
\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_Default:
{
@@ -1174,7 +1405,7 @@
\xeCJK_class_group_end: \xeCJK_no_break:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
}
- { \xeCJK_class_group_end: \xeCJK_no_break: \__xeCJK_zero_glue: }
+ { \xeCJK_class_group_end: }
}
\cs_new_protected_nopar:Npn \__xeCJK_zero_glue:
{ \skip_horizontal:N \c_zero_skip }
@@ -1183,6 +1414,7 @@
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_select_font:
\CJKglue
}
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_Default:
@@ -1194,187 +1426,339 @@
}
\cs_new_protected_nopar:Npn \xeCJK_Default_and_FullLeft:nN #1#2
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#2}
- \__xeCJK_Default_and_FullLeft_glue:N {#2}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl #2
+ \__xeCJK_Default_and_FullLeft_glue:N #2
\xeCJK_class_group_begin:
- \xeCJK_select_font:
+ \xeCJK_select_punct_font:
\xeCJK_clear_inter_class_toks:nn {#1} { FullLeft }
\xeCJK_clear_Boundary_and_CJK_toks:
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#2}
- \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#2}
- \CJKpunctsymbol {#2}
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#2}
+ \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #2
+ \CJKpunctsymbol #2
}
\cs_new_protected_nopar:Npn \__xeCJK_Default_and_FullLeft_glue:N #1
{
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl #1
}
\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullLeft:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_CJK_and_FullLeft_glue:N {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#1}
- \CJKpunctsymbol {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl #1
+ \__xeCJK_CJK_and_FullLeft_glue:N #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #1
+ \__xeCJK_select_punct_font:
+ \CJKpunctsymbol #1
}
\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullLeft_glue:N #1
{
\CJKglue
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl #1
}
\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullLeft:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_Boundary_and_FullLeft_glue:N {#1}
- \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl #1
+ \__xeCJK_Boundary_and_FullLeft_glue:N #1
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl #1
\xeCJK_class_group_begin:
- \xeCJK_select_font:
+ \xeCJK_select_punct_font:
\xeCJK_clear_Boundary_and_CJK_toks:
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_rule:NN \c__xeCJK_left_tl {#1}
- \CJKpunctsymbol {#1}
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #1
+ \CJKpunctsymbol #1
}
\cs_new_protected_nopar:Npn \__xeCJK_Boundary_and_FullLeft_glue:N #1
{
- \int_case:nnTF { \etex_lastnodetype:D }
+ \tl_set_eq:NN \l__xeCJK_alignii_tl \c__xeCJK_left_tl
+ \group_begin: \exp_args:NNc \group_end: \cs_if_exist_use:NTF
+ { __xeCJK_bound_type_ \int_use:N \etex_lastnodetype:D _glue:Nn }
+ {#1}
+ { \use:n }
+ { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1 }
+ }
+\tl_new:N \c__xeCJK_alignii_tl
+\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ -1 _glue:Nn } #1#2
+ { \__xeCJK_zero_glue: }
+\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 1 _glue:Nn } #1#2
+ {
+ \box_set_to_last:N \l__xeCJK_tmp_box
+ \int_compare:nNnTF \etex_lastnodetype:D = { -1 }
{
- { \c_one }
- {
- \box_set_to_last:N \l__xeCJK_tmp_box
- \bool_lazy_and:nnTF
- { \int_compare_p:nNn \etex_lastnodetype:D = { -1 } }
- { \dim_compare_p:nNn { \box_wd:N \l__xeCJK_tmp_box } = \tex_parindent:D }
- { \box_use_clear:N \l__xeCJK_tmp_box \use_none:n }
- { \box_use_clear:N \l__xeCJK_tmp_box \use:n }
- }
- { -1 } { \__xeCJK_zero_glue: \use_none:n }
- { \c_eleven }
- {
- \bool_lazy_or:nnTF
- { ! ( \skip_if_finite_p:n { \tex_lastskip:D } ) }
- { \skip_if_eq_p:nn { \tex_lastskip:D } { 1 sp } }
- { \__xeCJK_zero_glue: \use_none:n }
- {
- \skip_if_eq:nnTF { \tex_lastskip:D } { \labelsep }
- {
- \tex_unskip:D
- \bool_lazy_and:nnTF
- { \int_compare_p:nNn \etex_lastnodetype:D = \c_thirteen }
- { \int_compare_p:nNn \tex_lastpenalty:D = \c_zero }
- { \skip_horizontal:n { \labelsep } \use_none:n }
- { \skip_horizontal:n { \labelsep } \use:n }
- }
- { \use:n }
- }
- }
- { \c_thirteen }
- {
- \int_compare:nNnTF \tex_lastpenalty:D = \c_zero
- {
- \tex_unpenalty:D
- \int_compare:nNnTF \etex_lastnodetype:D = \c_one
- { \tex_penalty:D \c_zero \use_none:n }
- { \tex_penalty:D \c_zero \use:n }
- }
- { \use:n }
- }
+ \dim_compare:nNnTF
+ { \box_wd:N \l__xeCJK_tmp_box } = \tex_parindent:D
+ { \box_use_drop:N \l__xeCJK_tmp_box }
+ { \box_use_drop:N \l__xeCJK_tmp_box #2 }
+ }
+ { \box_use_drop:N \l__xeCJK_tmp_box #2 }
+ }
+\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 11 _glue:Nn } #1#2
+ {
+ \skip_if_finite:nTF { \tex_lastskip:D }
+ { \__xeCJK_bound_glue_auxi:Nn #1 {#2} }
+ { \__xeCJK_zero_glue: }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_bound_glue_auxi:Nn #1#2
+ {
+ \__xeCJK_if_last_punct_glue:TF
+ { \xeCJK_punct_bound_kern:N #1 }
+ { \__xeCJK_bound_glue_auxii:n {#2} }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_bound_glue_auxii:n #1
+ {
+ \skip_if_eq:nnTF { \l__xeCJK_last_skip } { 1sp }
+ { \__xeCJK_zero_glue: }
+ {
+ \skip_if_eq:nnTF { \l__xeCJK_last_skip } { \labelsep }
+ {
+ \tex_unskip:D
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_thirteen
+ {
+ \int_compare:nNnTF \tex_lastpenalty:D = \c_zero
+ { \skip_horizontal:N \l__xeCJK_last_skip }
+ { \skip_horizontal:N \l__xeCJK_last_skip #1 }
+ }
+ { \skip_horizontal:N \l__xeCJK_last_skip #1 }
+ }
+ {#1}
+ }
+ }
+\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 12 _glue:Nn } #1#2
+ {
+ \xeCJK_if_last_node:nF { CJK }
+ { \xeCJK_if_last_node:nF { CJK-space } { \use_none:nn } }
+ \xeCJK_remove_node: \CJKglue
+ #2
+ }
+\cs_new_protected_nopar:cpn { __xeCJK_bound_type_ 13 _glue:Nn } #1#2
+ {
+ \__xeCJK_if_last_punct_penalty:TF
+ { \xeCJK_punct_bound_kern:N #1 }
+ {
+ \int_compare:nNnTF \tex_lastpenalty:D = \c_zero
+ {
+ \tex_unpenalty:D
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_one
+ { \tex_penalty:D \c_zero }
+ { \tex_penalty:D \c_zero #2 }
+ }
+ {#2}
}
- { { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} } }
- { \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1} }
}
\cs_new_protected_nopar:Npn \xeCJK_Default_and_FullRight:nN #1#2
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#2}
- \__xeCJK_Default_and_FullRight_glue:N {#2}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl #2
+ \__xeCJK_Default_and_FullRight_glue:N #2
\xeCJK_class_group_begin:
- \xeCJK_select_font:
+ \xeCJK_select_punct_font:
\xeCJK_clear_inter_class_toks:nn {#1} { FullRight }
\xeCJK_clear_Boundary_and_CJK_toks:
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#2}
- \xeCJK_FullRight_symbol:N {#2}
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#2}
+ \xeCJK_FullRight_symbol:N #2
}
\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_FullRight:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
- \__xeCJK_Default_and_FullRight_glue:N {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl #1
+ \xeCJK_if_last_punct:TF
+ {
+ \tl_set_eq:NN \l__xeCJK_alignii_tl \c__xeCJK_right_tl
+ \xeCJK_punct_bound_kern:N
+ }
+ { \__xeCJK_Default_and_FullRight_glue:N }
+ #1
\xeCJK_class_group_begin:
- \xeCJK_select_font:
+ \xeCJK_select_punct_font:
\xeCJK_clear_Boundary_and_CJK_toks:
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \xeCJK_FullRight_symbol:N {#1}
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \xeCJK_FullRight_symbol:N #1
}
\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullRight:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
- \__xeCJK_CJK_and_FullRight_glue:N {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \xeCJK_FullRight_symbol:N {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl #1
+ \__xeCJK_CJK_and_FullRight_glue:N #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \__xeCJK_select_punct_font:
+ \xeCJK_FullRight_symbol:N #1
}
-\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullRight_glue:N #1
+\cs_new_protected_nopar:Npn \xeCJK_if_last_punct:TF
{
- \__xeCJK_punct_if_long:NTF {#1}
- { \CJKglue }
+ \bool_set_false:N \l__xeCJK_last_penalty_bool
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven
+ { \__xeCJK_if_last_punct_glue:TF }
{
- \__xeCJK_punct_if_middle:NTF {#1}
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_thirteen
+ { \__xeCJK_if_last_punct_penalty:TF }
+ { \use_ii:nn }
+ }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_glue:TF #1#2
+ {
+ \skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
+ \tex_unskip:D
+ \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand
+ { \__xeCJK_if_last_punct_auxi:TF }
+ {
+ \xeCJK_if_last_node:TF
+ { \__xeCJK_if_last_punct_auxii:TF }
+ { \__xeCJK_if_last_punct_auxiii:TF }
+ }
+ {#1}
+ { \skip_horizontal:N \l__xeCJK_last_skip #2 }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_penalty:TF #1#2
+ {
+ \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 \etex_lastnodetype:D = \c_eleven
+ {
+ \__xeCJK_if_last_punct_glue:TF
+ {#1}
+ { \tex_penalty:D \l__xeCJK_last_penalty_int #2 }
+ }
+ { \tex_penalty:D \l__xeCJK_last_penalty_int #2 }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxi:TF #1#2
+ {
+ \tex_unpenalty:D
+ \bool_if:NF \l__xeCJK_last_penalty_bool
+ {
+ \bool_set_true:N \l__xeCJK_last_penalty_bool
+ \int_set_eq:NN \l__xeCJK_last_penalty_int \c_ten_thousand
+ }
+ \__xeCJK_if_last_punct_auxiv:TF
+ {#1}
+ { \xeCJK_no_break: #2 }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxii:TF #1#2
+ {
+ \int_case:nnTF { \xetex_charclass:D \l__xeCJK_last_kern_dim }
+ {
+ { \xeCJK_class_num:n { FullRight } }
+ { \tl_set_eq:NN \l__xeCJK_aligni_tl \c__xeCJK_right_tl }
+ { \xeCJK_class_num:n { FullLeft } }
+ { \tl_set_eq:NN \l__xeCJK_aligni_tl \c__xeCJK_left_tl }
+ }
+ { \__xeCJK_if_last_punct_auxv:TF {#1} {#2} }
+ { \__xeCJK_make_node:N \l__xeCJK_last_kern_dim #2 }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiii:TF
+ {
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven
+ { \__xeCJK_if_last_punct_auxvi:TF }
+ { \use_ii:nn }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_if_last_punct_auxiv:TF
+ {
+ \xeCJK_if_last_node:TF
+ { \__xeCJK_if_last_punct_auxii:TF }
+ { \use_ii:nn }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxv:TF #1#2
+ {
+ \dim_set_eq:NN \l__xeCJK_tmp_dim \l__xeCJK_last_kern_dim
+ \xeCJK_if_last_node:TF
+ {
+ \tl_gset:Nx \g__xeCJK_last_punct_tl
+ { \utex_char:D \l__xeCJK_tmp_dim }
+ \dim_set_eq:NN \l__xeCJK_last_bound_dim \l__xeCJK_last_kern_dim
+ #1
+ }
+ { \__xeCJK_make_node:N \l__xeCJK_tmp_dim #2 }
+ }
+\cs_new_protected:Npn \__xeCJK_if_last_punct_auxvi:TF #1#2
+ {
+ \int_gset_eq:NN \g__xeCJK_space_factor_int \tex_spacefactor:D
+ \skip_if_eq:nnTF
+ { \l__xeCJK_last_skip }
+ { \c_xeCJK_space_skip_tl }
+ {
+ \skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D
+ \tex_unskip:D
+ \int_compare:nNnTF \tex_lastpenalty:D = \c_ten_thousand
+ { \__xeCJK_if_last_punct_auxi:TF }
+ { \__xeCJK_if_last_punct_auxiv:TF }
+ { \skip_set_eq:NN \l__xeCJK_last_skip \l__xeCJK_tmp_skip #1 }
+ { \skip_horizontal:N \l__xeCJK_tmp_skip #2 }
+ }
+ {#2}
+ }
+\tl_new:N \l__xeCJK_aligni_tl
+\tl_new:N \l__xeCJK_alignii_tl
+\int_new:N \l__xeCJK_last_penalty_int
+\dim_new:N \l__xeCJK_last_bound_dim
+\bool_new:N \l__xeCJK_last_penalty_bool
+\cs_new_protected:Npn \xeCJK_if_last_node:TF #1#2
+ {
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_twelve
+ {
+ \dim_set_eq:NN \l__xeCJK_last_kern_dim \tex_lastkern:D
+ \tex_unkern:D
+ \int_compare:nNnTF \etex_lastnodetype:D = \c_twelve
{
- \xeCJK_no_break:
- \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1}
- \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl {#1}
+ \dim_compare:nNnTF \tex_lastkern:D = { - \l__xeCJK_last_kern_dim }
+ { \tex_unkern:D #1 }
+ { \tex_kern:D \l__xeCJK_last_kern_dim #2 }
}
- { \xeCJK_no_break: }
+ { \tex_kern:D \l__xeCJK_last_kern_dim #2 }
}
+ {#2}
}
-\cs_new_eq:NN \__xeCJK_Default_and_FullRight_glue:N \__xeCJK_CJK_and_FullRight_glue:N
-\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullLeft:N #1
+\dim_new:N \l__xeCJK_last_kern_dim
+\cs_new_protected_nopar:Npn \__xeCJK_CJK_and_FullRight_glue:N #1
{
- \xeCJK_no_break:
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
- \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \CJKpunctsymbol {#1}
+ \__xeCJK_punct_if_long:NTF #1
+ { \xeCJK_allow_break: }
+ { \xeCJK_no_break: }
+ \__xeCJK_punct_if_middle:NT #1
+ {
+ \CJKglue
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
+ }
}
-\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullRight:N #1
+\cs_new_protected_nopar:Npn \__xeCJK_Default_and_FullRight_glue:N #1
{
- \xeCJK_no_break:
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
- \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \xeCJK_no_break:
- \xeCJK_FullRight_symbol:N {#1}
+ \__xeCJK_punct_if_long:NTF #1
+ { \xeCJK_allow_break: }
+ { \xeCJK_no_break: }
+ \__xeCJK_punct_if_middle:NT #1
+ {
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
+ }
}
-\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullLeft:N #1
+\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullLeft:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl {#1}
- \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl {#1}
- \xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \CJKpunctsymbol {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl #1
+ \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
+ \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \CJKpunctsymbol #1
}
-\cs_new_protected_nopar:Npn \__xeCJK_punct_nobreak_kern:NN #1#2
+\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullRight:N #1
{
- \__xeCJK_punct_kern:NN #1#2
- \xeCJK_no_break:
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl #1
+ \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
+ \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \xeCJK_FullRight_symbol:N #1
}
-\cs_new_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_nobreak_kern:NN
-\cs_new_protected_nopar:Npn \__xeCJK_punct_breakable_kern:NN #1#2
+\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullLeft:N #1
{
- \__xeCJK_punct_rule:NN \c__xeCJK_right_tl #1
- \__xeCJK_punct_breakable_kern:n
- { \__xeCJK_use_dim_or_skip:nnn { break_kern } {#1} {#2} }
- \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #2
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl #1
+ \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
+ \xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \CJKpunctsymbol #1
}
-\cs_new_eq:NN \__xeCJK_punct_breakable_kern:n \skip_horizontal:n
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullRight:N #1
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl {#1}
- \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl {#1}
- \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl {#1}
- \tl_gset:Nx \g__xeCJK_last_punct_tl {#1}
- \xeCJK_no_break:
- \xeCJK_FullRight_symbol:N {#1}
+ \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl #1
+ \xeCJK_get_punct_kerning:oN \g__xeCJK_last_punct_tl #1
+ \__xeCJK_punct_kern:NN \g__xeCJK_last_punct_tl #1
+ \tl_gset:Nn \g__xeCJK_last_punct_tl {#1}
+ \xeCJK_FullRight_symbol:N #1
}
\keys_define:nn { xeCJK / options }
{
@@ -1383,18 +1767,24 @@
{
\cs_if_eq:NNF \xeCJK_FullRight_and_Boundary: \xeCJK_check_FullRight:
{
- \cs_set_eq:NN \__xeCJK_save_FullRight_check: \xeCJK_FullRight_and_Boundary:
- \cs_set_eq:NN \__xeCJK_save_FullRight_symbol:N \xeCJK_FullRight_symbol:N
- \cs_set_eq:NN \xeCJK_FullRight_and_Boundary: \xeCJK_check_FullRight:
- \cs_set_eq:NN \xeCJK_FullRight_symbol:N \xeCJK_check_FullRight_symbol:Nw
+ \cs_set_eq:NN \__xeCJK_save_FullRight_check:
+ \xeCJK_FullRight_and_Boundary:
+ \cs_set_eq:NN \__xeCJK_save_FullRight_symbol:N
+ \xeCJK_FullRight_symbol:N
+ \cs_set_eq:NN \xeCJK_FullRight_and_Boundary:
+ \xeCJK_check_FullRight:
+ \cs_set_eq:NN \xeCJK_FullRight_symbol:N
+ \xeCJK_check_FullRight_symbol:Nw
}
} ,
CheckFullRight / false .code:n =
{
\cs_if_eq:NNT \xeCJK_FullRight_and_Boundary: \xeCJK_check_FullRight:
{
- \cs_set_eq:NN \xeCJK_FullRight_and_Boundary: \__xeCJK_save_FullRight_check:
- \cs_set_eq:NN \xeCJK_FullRight_symbol:N \__xeCJK_save_FullRight_symbol:N
+ \cs_set_eq:NN \xeCJK_FullRight_and_Boundary:
+ \__xeCJK_save_FullRight_check:
+ \cs_set_eq:NN \xeCJK_FullRight_symbol:N
+ \__xeCJK_save_FullRight_symbol:N
}
} ,
CheckFullRight .default:n = { true }
@@ -1402,20 +1792,28 @@
\cs_new_nopar:Npn \xeCJK_FullRight_symbol:N { \CJKpunctsymbol }
\cs_new_protected_nopar:Npn \xeCJK_check_FullRight:
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \xeCJK_get_punct_bounds:No \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
- \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\group_align_safe_begin:
\tl_case:NoTF \l_peek_token
{ \l__xeCJK_no_break_cs_case_tl }
- { \group_align_safe_end: \xeCJK_no_break: }
+ {
+ \group_align_safe_end:
+ \xeCJK_no_break:
+ \group_insert_after:N \xeCJK_no_break:
+ }
{ \group_align_safe_end: }
- \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \exp_after:wN \xeCJK_punct_node:N \g__xeCJK_last_punct_tl
\xeCJK_class_group_end:
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
}
-\cs_generate_variant:Nn \tl_case:NnTF { No }
+\prg_generate_conditional_variant:Nnn \tl_case:Nn { No } { TF , F }
\cs_new_protected_nopar:Npn \xeCJK_check_FullRight_symbol:Nw #1
- { \xeCJK_peek_after_ignore_spaces:nw { \__xeCJK_save_FullRight_symbol:N {#1} } }
+ {
+ \xeCJK_peek_after_ignore_spaces:nw
+ { \__xeCJK_save_FullRight_symbol:N #1 }
+ }
\cs_new_protected:Npn \xeCJK_cs_case_keys_define:nNNnn #1#2#3#4#5
{
\tl_new:N #2
@@ -1456,13 +1854,30 @@
\bool_if:NTF \l__xeCJK_tmp_bool
{
\bool_set_false:N \l__xeCJK_tmp_bool
- \skip_set_eq:NN \l__xeCJK_tmp_skip \tex_lastskip:D
+ \skip_set_eq:NN \l__xeCJK_last_skip \tex_lastskip:D
}
- { \skip_add:Nn \l__xeCJK_tmp_skip \tex_lastskip:D }
+ { \skip_add:Nn \l__xeCJK_last_skip \tex_lastskip:D }
\tex_unskip:D
}
+ \xeCJK_if_last_node:TF
+ {
+ \dim_set_eq:NN \l__xeCJK_tmp_dim \l__xeCJK_last_kern_dim
+ \xeCJK_if_last_node:TF
+ {
+ \int_compare:nNnT \etex_lastnodetype:D = \c_eleven
+ {
+ \exp_args:NNNo \tex_unskip:D \xeCJK_no_break:
+ \skip_horizontal:n { \skip_use:N \tex_lastskip:D }
+ }
+ \__xeCJK_make_node:N \l__xeCJK_last_kern_dim
+ }
+ { }
+ \__xeCJK_make_node:N \l__xeCJK_tmp_dim
+ }
+ { }
\xeCJK_no_break:
- \bool_if:NF \l__xeCJK_tmp_bool { \skip_horizontal:N \l__xeCJK_tmp_skip }
+ \bool_if:NF \l__xeCJK_tmp_bool
+ { \skip_horizontal:N \l__xeCJK_last_skip }
}
\keys_define:nn { xeCJK / options }
{
@@ -1598,7 +2013,6 @@
{ \__xeCJK_check_single_end:N #1 #2#3 }
}
\tl_new:N \l__xeCJK_check_single_cs_case_tl
-\cs_generate_variant:Nn \tl_case:NnF { No }
\cs_new_protected_nopar:Npn \xeCJK_check_single_env:nnNn #1#2#3#4
{
\str_case_x:noTF {#4}
@@ -1607,7 +2021,7 @@
{#1}
#3 {#4}
}
-\cs_generate_variant:Nn \str_case_x:nnTF { no }
+\prg_generate_conditional_variant:Nnn \str_case_x:nn { no } { TF }
\xeCJK_cs_case_keys_define:nNNnn { NewLineCS }
\l__xeCJK_new_line_cs_case_tl \l__xeCJK_new_line_cs_seq
{ \use_ii:nnn }
@@ -1686,9 +2100,9 @@
{
\int_if_exist:cTF { \__xeCJK_class_csname:n { CJK/##1 } }
{
- \xeCJK_declare_char_class:nc
+ \xeCJK_declare_char_class:nn
{ CJK \bool_if:NF \l__xeCJK_sub_cancel_bool { /##1 } }
- { g__xeCJK_CJK/##1_range_clist }
+ { \use:c { g__xeCJK_CJK/##1_range_clist } }
}
{ \__xeCJK_error:nx { SubBlock-undefined } {##1} }
}
@@ -1792,11 +2206,15 @@
{
\bool_set_true:N \l__xeCJK_punct_breakable_bool
\cs_set_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_breakable_kern:NN
+ \cs_set_eq:NN \__xeCJK_punct_bound_kern:N
+ \__xeCJK_punct_bound_breakable_kern:N
} ,
AllowBreakBetweenPuncts / false .code:n =
{
\bool_set_false:N \l__xeCJK_punct_breakable_bool
- \cs_set_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_nobreak_kern:NN
+ \cs_set_eq:NN \xeCJK_punct_kern:NN \__xeCJK_punct_kern:NN
+ \cs_set_eq:NN \__xeCJK_punct_bound_kern:N
+ \__xeCJK_nobreak_hskip:N
} ,
AllowBreakBetweenPuncts .default:n = { true } ,
KaiMingPunct .code:n = { \__xeCJK_set_special_punct:nn { mixed_width } {#1} } ,
@@ -1815,13 +2233,13 @@
RubberPunctSkip .choice: ,
RubberPunctSkip .default:n = { true } ,
RubberPunctSkip / true .code:n =
- { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nnn \__xeCJK_use_punct_skip:nnn } ,
+ { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip:nNN } ,
RubberPunctSkip / plus .code:n =
- { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nnn \__xeCJK_use_punct_skip_plus:nnn } ,
+ { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip_plus:nNN } ,
RubberPunctSkip / minus .code:n =
- { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nnn \__xeCJK_use_punct_skip_minus:nnn } ,
+ { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip_minus:nNN } ,
RubberPunctSkip / false .code:n =
- { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nnn \__xeCJK_use_punct_dim:nnn }
+ { \cs_set_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_dim:nNN }
}
\bool_new:N \l__xeCJK_punct_breakable_bool
\clist_new:N \g__xeCJK_special_punct_clist
@@ -1862,7 +2280,8 @@
}
\prg_new_conditional:Npnn \__xeCJK_punct_if_right:N #1 { p , T , F , TF }
{
- \if_int_compare:w \xeCJK_token_value_class:N #1 = \xeCJK_class_num:n { FullRight }
+ \if_int_compare:w \xeCJK_token_value_class:N #1 =
+ \xeCJK_class_num:n { FullRight }
\prg_return_true: \else: \prg_return_false: \fi:
}
\clist_map_inline:Nn \g__xeCJK_special_punct_clist
@@ -1876,27 +2295,27 @@
}
\cs_new:Npn \__xeCJK_punct_csname:n #1
{ c__xeCJK_\l_xeCJK_current_font_tl/\l_xeCJK_punct_style_tl/#1/tl }
-\cs_new:Npn \__xeCJK_use_punct_dim:nn #1#2
+\cs_new:Npn \__xeCJK_use_punct_dim:nN #1#2
{ \use:c { \__xeCJK_punct_csname:n { dim/#1/#2 } } }
-\cs_new:Npn \__xeCJK_use_punct_dim:nnn #1#2#3
+\cs_new:Npn \__xeCJK_use_punct_dim:nNN #1#2#3
{ \use:c { \__xeCJK_punct_csname:n { dim/#1/#2/#3 } } }
-\cs_new:Npn \__xeCJK_use_punct_skip:nnn #1#2#3
+\cs_new:Npn \__xeCJK_use_punct_skip:nNN #1#2#3
{ \use:c { \__xeCJK_punct_csname:n { skip/#1/#2/#3 } } }
-\cs_new:Npn \__xeCJK_use_punct_skip_plus:nnn #1#2#3
+\cs_new:Npn \__xeCJK_use_punct_skip_plus:nNN #1#2#3
{ \use:c { \__xeCJK_punct_csname:n { skip/plus/#1/#2/#3 } } }
-\cs_new:Npn \__xeCJK_use_punct_skip_minus:nnn #1#2#3
+\cs_new:Npn \__xeCJK_use_punct_skip_minus:nNN #1#2#3
{ \use:c { \__xeCJK_punct_csname:n { skip/minus/#1/#2/#3 } } }
-\cs_new_protected:Npn \__xeCJK_save_punct_dim:nnn #1#2
+\cs_new_protected:Npn \__xeCJK_save_punct_dim:nNn #1#2
{ \__xeCJK_save_punct_width_aux:nnn { dim } { #1/#2 } }
-\cs_new_protected:Npn \__xeCJK_save_punct_dim:nnnn #1#2#3
+\cs_new_protected:Npn \__xeCJK_save_punct_dim:nNNn #1#2#3
{ \__xeCJK_save_punct_width_aux:nnn { dim } { #1/#2/#3 } }
-\cs_new_protected:Npn \__xeCJK_save_punct_skip:nnnn #1#2#3#4
+\cs_new_protected:Npn \__xeCJK_save_punct_skip:nNNn #1#2#3#4
{
\__xeCJK_save_punct_width_aux:nnn { skip } { #1/#2/#3 } {#4}
\__xeCJK_save_punct_width_aux:nnn { skip } { plus/#1/#2/#3 } {#4}
\__xeCJK_save_punct_width_aux:nnn { skip } { minus/#1/#2/#3 } {#4}
}
-\cs_new_protected:Npn \__xeCJK_save_punct_skip:nnnnnn #1#2#3#4#5#6
+\cs_new_protected:Npn \__xeCJK_save_punct_skip:nNNnnn #1#2#3#4#5#6
{
\use:x
{
@@ -1908,16 +2327,19 @@
}
\cs_new_protected:Npn \__xeCJK_save_punct_skip_aux:nnnn #1#2#3#4
{
- \__xeCJK_save_punct_width_aux:nnn { skip } {#1} { #2 ~ plus ~ #3 ~ minus ~ #4 ~ }
- \__xeCJK_save_punct_width_aux:nnn { skip } { plus/#1 } { #2 ~ plus ~ #3 ~ }
- \__xeCJK_save_punct_width_aux:nnn { skip } { minus/#1 } { #2 ~ minus ~ #4 ~ }
+ \__xeCJK_save_punct_width_aux:nnn { skip }
+ {#1} { #2 ~ plus ~ #3 ~ minus ~ #4 ~ }
+ \__xeCJK_save_punct_width_aux:nnn { skip }
+ { plus/#1 } { #2 ~ plus ~ #3 ~ }
+ \__xeCJK_save_punct_width_aux:nnn { skip }
+ { minus/#1 } { #2 ~ minus ~ #4 ~ }
}
\cs_new_protected:Npn \__xeCJK_save_punct_width_aux:nnn #1#2#3
{
\tl_const:cx { \__xeCJK_punct_csname:n { #1/#2 } }
{ \use:c { #1_eval:n } {#3} }
}
-\cs_new_eq:NN \__xeCJK_use_dim_or_skip:nnn \__xeCJK_use_punct_skip:nnn
+\cs_new_eq:NN \__xeCJK_use_dim_or_skip:nNN \__xeCJK_use_punct_skip:nNN
\DeclareObjectType { xeCJK / punctuation } { \c_zero }
\DeclareTemplateInterface { xeCJK / punctuation } { basic } { \c_zero }
{
@@ -1995,32 +2417,37 @@
\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:NN #1#2
{
\tl_if_exist:cF { \__xeCJK_punct_csname:n { dim/glue/#1/#2 } }
+ { \__xeCJK_get_punct_bounds_aux:NN #1 #2 }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_get_punct_bounds_aux:NN #1#2
+ {
+ \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
{
- \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
- {
- \__xeCJK_save_punct_dim:nnnn { rule } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { offset } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim }
- \__xeCJK_save_punct_skip:nnnn { glue } {#1} {#2} { \c_zero_skip }
- }
+ \__xeCJK_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { offset } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim }
+ \__xeCJK_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip }
+ }
+ {
+ { \xeCJK_select_punct_font: \xeCJK_calc_punct_dimen:N #2 }
+ \dim_set:Nn \l__xeCJK_bound_dim
+ { \__xeCJK_use_punct_dim:nNN { bound } #1 #2 }
+ \dim_set:Nn \l__xeCJK_reverse_bound_dim
{
- { \xeCJK_select_font: \xeCJK_calc_punct_dimen:o {#2} }
- \dim_set:Nn \l__xeCJK_bound_dim
- { \__xeCJK_use_punct_dim:nnn { bound } {#1} {#2} }
- \dim_set:Nn \l__xeCJK_reverse_bound_dim
- {
- \__xeCJK_use_punct_dim:nnn { bound }
- { \xeCJK_reverse:nnn {#1} \c__xeCJK_left_tl \c__xeCJK_right_tl }
- {#2}
- }
- \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
- \xeCJK_punct_margin_process:NN {#1} {#2}
- \xeCJK_punct_offset_process:NN {#1} {#2}
+ \tl_if_eq:NNTF #1 \c__xeCJK_left_tl
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl }
+ #2
}
+ \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
+ \xeCJK_punct_margin_process:NN #1 #2
+ \xeCJK_punct_offset_process:NN #1 #2
}
}
+\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:No
+ { \exp_last_unbraced:NNo \xeCJK_get_punct_bounds:NN }
\dim_new:N \l__xeCJK_bound_dim
\dim_new:N \l__xeCJK_reverse_bound_dim
\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:NN #1#2
@@ -2029,42 +2456,36 @@
{
\tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl
{
- \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_dim:nnnn { break_kern } {#1} {#2} { \c_zero_dim }
- \__xeCJK_save_punct_skip:nnnn { kern } {#1} {#2} { \c_zero_skip }
- \__xeCJK_save_punct_skip:nnnn { break_kern } {#1} {#2} { \c_zero_skip }
+ \__xeCJK_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { break_kern } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_dim:nNNn { bound_width } #1 #2 { \c_zero_dim }
+ \__xeCJK_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip }
+ \__xeCJK_save_punct_skip:nNNn { break_kern } #1 #2 { \c_zero_skip }
+ \__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip }
}
{
\UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl }
- \xeCJK_punct_kerning_process:NN {#1} {#2}
+ \xeCJK_punct_kerning_process:NN #1 #2
}
}
}
-\cs_generate_variant:Nn \xeCJK_get_punct_kerning:NN { o }
+\cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:oN
+ { \exp_after:wN \xeCJK_get_punct_kerning:NN }
\cs_new_protected_nopar:Npn \xeCJK_punct_margin_process:NN #1#2
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
\bool_if:NTF \l__xeCJK_enabled_global_setting_bool
{
- \cs_if_exist_use:cTF { g__xeCJK_punct_width/#2/tl }
- { \use_none:n }
+ \cs_if_exist_use:cF { g__xeCJK_punct_width/#2/tl }
{
\tl_if_empty:NTF \g__xeCJK_punct_width_tl
- { \use:n }
- { \g__xeCJK_punct_width_tl \use_none:n }
- }
- }
- { \use:n }
- {
- \__xeCJK_punct_if_middle:NTF {#2}
- { \__xeCJK_punct_width_or_ratio:nN { middle } {#2} }
- {
- \__xeCJK_punct_if_mixed_width:NTF {#2}
- { \__xeCJK_punct_width_or_ratio:nN { mixed } {#2} }
- { \__xeCJK_punct_width_or_ratio:nN { fixed } {#2} }
+ { \__xeCJK_calc_punct_width:N #2 }
+ { \g__xeCJK_punct_width_tl }
}
}
+ { \__xeCJK_calc_punct_width:N #2 }
}
\dim_set:Nn \l__xeCJK_tmp_dim
{
@@ -2073,22 +2494,27 @@
{
\dim_compare:nNnTF \l__xeCJK_tmp_dim < \c_max_dim
{
- \__xeCJK_punct_if_middle:NTF {#2}
+ \__xeCJK_punct_if_middle:NTF #2
{
- (
- \l__xeCJK_tmp_dim - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ ( \l__xeCJK_tmp_dim
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #2 )
) / \c_two
}
{
\bool_if:NTF \l__xeCJK_optimize_margin_bool
{
\dim_max:nn
- { \dim_min:nn \l__xeCJK_bound_dim \l__xeCJK_reverse_bound_dim }
+ {
+ \dim_min:nn
+ { \l__xeCJK_bound_dim }
+ { \l__xeCJK_reverse_bound_dim }
+ }
}
{ \use:n }
{
- \l__xeCJK_tmp_dim - \l__xeCJK_reverse_bound_dim
- - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ \l__xeCJK_tmp_dim
+ - \l__xeCJK_reverse_bound_dim
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #2 )
}
}
}
@@ -2096,61 +2522,72 @@
\bool_if:NTF \l__xeCJK_optimize_margin_bool
{ \dim_min:nn { \l__xeCJK_bound_dim } }
{ \use:n }
- {
- \__xeCJK_punct_if_middle:NTF {#2}
- {
- \dim_compare:nNnTF \l__xeCJK_middle_margin_width_dim < \c_max_dim
- { \l__xeCJK_middle_margin_width_dim }
- {
- \fp_use:N \l__xeCJK_middle_margin_ratio_fp
- \etex_dimexpr:D
- ( \l__xeCJK_bound_dim + \l__xeCJK_reverse_bound_dim ) / \c_two
- \scan_stop:
- }
- }
- {
- \__xeCJK_punct_if_mixed_width:NTF {#2}
- { \__xeCJK_margin_width_or_ratio:n { mixed } }
- { \__xeCJK_margin_width_or_ratio:n { fixed } }
- }
- }
+ { \__xeCJK_calc_margin_width:N #2 }
}
}
}
- \__xeCJK_save_punct_dim:nnnn { glue } {#1} {#2} { \l__xeCJK_tmp_dim }
- \__xeCJK_save_punct_skip:nnnnnn { glue } {#1} {#2}
+ \__xeCJK_save_punct_dim:nNNn { glue } #1 #2 { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_skip:nNNnnn { glue } #1 #2
{ \l__xeCJK_tmp_dim }
{
- \__xeCJK_punct_if_middle:NTF {#2}
+ \__xeCJK_punct_if_middle:NTF #2
{
- ( \__xeCJK_use_punct_dim:nn { width } {#2} -
- \__xeCJK_use_punct_dim:nn { dimen } {#2} ) / \c_two
+ ( \__xeCJK_use_punct_dim:nN { width } #2 -
+ \__xeCJK_use_punct_dim:nN { dimen } #2 ) / \c_two
- \l__xeCJK_tmp_dim
}
{ \l__xeCJK_bound_dim - \l__xeCJK_tmp_dim }
}
{
- \__xeCJK_punct_if_middle:NTF {#2}
+ \__xeCJK_punct_if_middle:NTF #2
{ .5 \l__xeCJK_tmp_dim }
{ \l__xeCJK_tmp_dim - \l__xeCJK_reverse_bound_dim }
}
}
+\cs_new_nopar:Npn \__xeCJK_calc_punct_width:N #1
+ {
+ \__xeCJK_punct_if_middle:NTF #1
+ { \__xeCJK_punct_width_or_ratio:nN { middle } }
+ {
+ \__xeCJK_punct_if_mixed_width:NTF #1
+ { \__xeCJK_punct_width_or_ratio:nN { mixed } }
+ { \__xeCJK_punct_width_or_ratio:nN { fixed } }
+ }
+ #1
+ }
+\cs_new_nopar:Npn \__xeCJK_calc_margin_width:N #1
+ {
+ \__xeCJK_punct_if_middle:NTF #1
+ {
+ \dim_compare:nNnTF \l__xeCJK_middle_margin_width_dim < \c_max_dim
+ { \l__xeCJK_middle_margin_width_dim }
+ {
+ \fp_use:N \l__xeCJK_middle_margin_ratio_fp
+ \etex_dimexpr:D
+ ( \l__xeCJK_bound_dim + \l__xeCJK_reverse_bound_dim ) / \c_two
+ \scan_stop:
+ }
+ }
+ {
+ \__xeCJK_punct_if_mixed_width:NTF #1
+ { \__xeCJK_margin_width_or_ratio:n { mixed } }
+ { \__xeCJK_margin_width_or_ratio:n { fixed } }
+ }
+ }
\cs_new_protected_nopar:Npn \xeCJK_punct_offset_process:NN #1#2
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
\bool_if:NTF \l__xeCJK_enabled_global_setting_bool
{
- \cs_if_exist_use:cTF { g__xeCJK_punct_bound_width/#2/tl }
- { \use_none:n }
+ \cs_if_exist_use:cF { g__xeCJK_punct_bound_width/#2/tl }
{
\tl_if_empty:NTF \g__xeCJK_punct_bound_width_tl
- { \use:n }
- { \g__xeCJK_punct_bound_width_tl \use_none:n }
+ { \__xeCJK_punct_width_or_ratio:nN { bound } #2 }
+ { \g__xeCJK_punct_bound_width_tl }
}
}
- { \use:n }
- { \__xeCJK_punct_width_or_ratio:nN { bound } {#2} }
+ { \__xeCJK_punct_width_or_ratio:nN { bound } #2 }
}
\dim_set:Nn \l__xeCJK_tmp_dim
{
@@ -2160,15 +2597,16 @@
{
\dim_compare:nNnTF \l__xeCJK_tmp_dim < \c_max_dim
{
- \__xeCJK_punct_if_middle:NTF {#2}
+ \__xeCJK_punct_if_middle:NTF #2
{
- \l__xeCJK_tmp_dim
- - ( \__xeCJK_use_punct_dim:nnn { glue } {#1} {#2} )
- - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ \l__xeCJK_tmp_dim
+ - ( \__xeCJK_use_punct_dim:nNN { glue } #1 #2 )
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #2 )
}
{
- \l__xeCJK_tmp_dim - \l__xeCJK_reverse_bound_dim
- - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
+ \l__xeCJK_tmp_dim
+ - \l__xeCJK_reverse_bound_dim
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #2 )
}
}
{
@@ -2179,8 +2617,9 @@
}
}
}
- \__xeCJK_save_punct_dim:nnnn { offset } {#1} {#2} { \l__xeCJK_tmp_dim }
- \__xeCJK_save_punct_dim:nnnn { rule } {#1} {#2}
+ \__xeCJK_save_punct_dim:nNNn { offset } #1 #2
+ { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_dim:nNNn { rule } #1 #2
{ - \l__xeCJK_bound_dim + \l__xeCJK_tmp_dim }
}
\cs_new_nopar:Npn \__xeCJK_punct_width_or_ratio:nN #1#2
@@ -2192,7 +2631,7 @@
{ \c_max_dim }
{
\fp_use:c { l__xeCJK_#1_punct_ratio_fp }
- \etex_dimexpr:D \__xeCJK_use_punct_dim:nn { width } {#2} \scan_stop:
+ \etex_dimexpr:D \__xeCJK_use_punct_dim:nN { width } #2 \scan_stop:
}
}
}
@@ -2210,51 +2649,95 @@
\cs_new_protected_nopar:Npn \xeCJK_punct_kerning_process:NN #1#2
{
\dim_set:Nn \l__xeCJK_original_margin_dim
- { \__xeCJK_original_kerning_margin:NN {#1} {#2} }
+ { \__xeCJK_original_kerning_margin:NN #1 #2 }
\dim_set:Nn \l__xeCJK_minimum_bound_dim
- { \__xeCJK_punct_min_bound:NN {#1} {#2} }
- \__xeCJK_punct_if_long:NTF {#1}
+ { \__xeCJK_punct_min_bound:NN #1 #2 }
+ \__xeCJK_punct_if_long:NTF #1
{ \bool_set_false:N \l__xeCJK_enabled_kerning_bool }
{
- \__xeCJK_punct_if_long:NT {#2}
+ \__xeCJK_punct_if_long:NT #2
{ \bool_set_false:N \l__xeCJK_enabled_kerning_bool }
}
\dim_set:Nn \l__xeCJK_kerning_margin_dim
{
\bool_if:NTF \l__xeCJK_enabled_global_setting_bool
{
- \cs_if_exist_use:cTF { g__xeCJK_punct/kern/#1/#2/tl }
- { \use_none:n }
- { \use:n }
+ \cs_if_exist_use:cF { g__xeCJK_punct/kern/#1/#2/tl }
+ { \__xeCJK_punct_kerning_process_aux:NN #1 #2 }
+ }
+ { \__xeCJK_punct_kerning_process_aux:NN #1 #2 }
+ }
+ \__xeCJK_save_kerning:nnNN { kern } { bound } #1 #2
+ \__xeCJK_save_punct_dim:nNNn { bound_width } #1 #2
+ { \l__xeCJK_kerning_margin_dim - \l__xeCJK_tmp_dim }
+ \__xeCJK_punct_if_right:NTF #1
+ {
+ \__xeCJK_punct_if_right:NTF #2
+ {
+ \__xeCJK_save_kerning:nNNNN
+ { bound_kern } \c__xeCJK_left_tl #2 #1 #2
+ \__xeCJK_save_kerning:nnnNN
+ { break_kern } { offset } { bound }
}
- { \use:n }
{
- \bool_if:NTF \l__xeCJK_enabled_kerning_bool
- { \__xeCJK_calc_kerning_margin:NN {#1} {#2} }
- { \l__xeCJK_original_margin_dim }
+ \__xeCJK_save_kerning:nnNN
+ { break_kern } { offset } #1 #2
+ \__xeCJK_save_kerning_aux:nnNN
+ { bound_kern } { \l__xeCJK_kerning_margin_dim }
}
}
- \__xeCJK_save_kerning:nnNN { kern } { bound } {#1} {#2}
- \__xeCJK_punct_if_right:NF {#2}
{
- \__xeCJK_punct_if_right:NT {#1}
- { \__xeCJK_save_kerning:nnNN { break_kern } { offset } {#1} {#2} }
+ \__xeCJK_punct_if_right:NTF #2
+ {
+ \__xeCJK_save_kerning:nnNN
+ { bound_kern } { bound } #1 #2
+ \__xeCJK_save_kerning_aux:nnNN
+ { break_kern } { \l__xeCJK_tmp_dim }
+ }
+ {
+ \__xeCJK_save_kerning:nNNNN
+ { bound_kern } \c__xeCJK_right_tl #1 #1 #2
+ \__xeCJK_save_kerning:nnnNN
+ { break_kern } { bound } { offset }
+ }
}
+ #1 #2
+ }
+\cs_new_nopar:Npn \__xeCJK_punct_kerning_process_aux:NN #1#2
+ {
+ \bool_if:NTF \l__xeCJK_enabled_kerning_bool
+ { \__xeCJK_calc_kerning_margin:NN #1 #2 }
+ { \l__xeCJK_original_margin_dim }
}
\dim_new:N \l__xeCJK_minimum_bound_dim
\dim_new:N \l__xeCJK_kerning_margin_dim
\dim_new:N \l__xeCJK_original_margin_dim
-\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nnNN #1#2#3#4
+\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nnNN #1#2
+ { \__xeCJK_save_kerning:nnnNN {#1} {#2} {#2} }
+\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nnnNN #1#2#3#4#5
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
- \l__xeCJK_kerning_margin_dim
- - ( \__xeCJK_use_punct_dim:nnn {#2} \c__xeCJK_right_tl {#3} )
- - ( \__xeCJK_use_punct_dim:nnn {#2} \c__xeCJK_left_tl {#4} )
+ \l__xeCJK_kerning_margin_dim
+ - ( \__xeCJK_use_punct_dim:nNN {#2} \c__xeCJK_right_tl #4 )
+ - ( \__xeCJK_use_punct_dim:nNN {#3} \c__xeCJK_left_tl #5 )
}
- \__xeCJK_save_punct_dim:nnnn {#1} {#3} {#4} { \l__xeCJK_tmp_dim }
- \__xeCJK_save_punct_skip:nnnnnn {#1} {#3} {#4}
- { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_kerning_aux:nnNN {#1} { \l__xeCJK_tmp_dim } #4 #5
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_save_kerning:nNNNN #1#2#3#4#5
+ {
+ \dim_set:Nn \l__xeCJK_tmp_dim
+ {
+ \l__xeCJK_kerning_margin_dim
+ - ( \__xeCJK_use_punct_dim:nNN { bound } #2 #3 )
+ }
+ \__xeCJK_save_kerning_aux:nnNN {#1} { \l__xeCJK_tmp_dim } #4 #5
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_save_kerning_aux:nnNN #1#2#3#4
+ {
+ \__xeCJK_save_punct_dim:nNNn {#1} #3 #4 {#2}
+ \__xeCJK_save_punct_skip:nNNnnn {#1} #3 #4
+ {#2}
{ \l__xeCJK_original_margin_dim - \l__xeCJK_kerning_margin_dim }
{ \l__xeCJK_kerning_margin_dim - \l__xeCJK_minimum_bound_dim }
}
@@ -2262,12 +2745,11 @@
{
\dim_eval:n
{
- \__xeCJK_use_punct_dim:nnn
- { \__xeCJK_punct_if_right:NTF {#1} { glue } { bound } }
- { \c__xeCJK_right_tl } {#1} +
- \__xeCJK_use_punct_dim:nnn
- { \__xeCJK_punct_if_right:NTF {#2} { bound } { glue } }
- { \c__xeCJK_left_tl } {#2}
+ \__xeCJK_use_punct_dim:nNN
+ { \__xeCJK_punct_if_right:NTF #1 { glue } { bound } } \c__xeCJK_right_tl #1
+ +
+ \__xeCJK_use_punct_dim:nNN
+ { \__xeCJK_punct_if_right:NTF #2 { bound } { glue } } \c__xeCJK_left_tl #2
}
}
\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin:NN #1#2
@@ -2281,31 +2763,33 @@
\bool_if:NTF \l__xeCJK_optimize_kerning_bool
{ \dim_max:nn { \l__xeCJK_minimum_bound_dim } }
{ \use:n }
+ { \__xeCJK_calc_kerning_margin_aux:NN #1 #2 }
+ }
+ }
+ }
+\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin_aux:NN #1#2
+ {
+ \dim_compare:nNnTF \l__xeCJK_kerning_total_width_dim < \c_max_dim
+ { \__xeCJK_calc_kerning_margin:nNN \l__xeCJK_kerning_total_width_dim }
+ {
+ \fp_compare:nNnTF \l__xeCJK_kerning_total_ratio_fp ? \c_zero_fp
+ {
+ \xeCJK_if_same_class:NNTF #1 #2
+ { \__xeCJK_kerning_width_or_ratio:nNN { same } }
+ { \__xeCJK_kerning_width_or_ratio:nNN { different } }
+ }
+ {
+ \__xeCJK_calc_kerning_margin:nNN
{
- \dim_compare:nNnTF \l__xeCJK_kerning_total_width_dim < \c_max_dim
- { \__xeCJK_calc_kerning_margin:nNN \l__xeCJK_kerning_total_width_dim }
- {
- \fp_compare:nNnTF \l__xeCJK_kerning_total_ratio_fp ? \c_zero_fp
- {
- \xeCJK_if_same_class:NNTF {#1} {#2}
- { \__xeCJK_kerning_width_or_ratio:nNN { same } }
- { \__xeCJK_kerning_width_or_ratio:nNN { different } }
- }
- {
- \__xeCJK_calc_kerning_margin:nNN
- {
- \fp_use:N \l__xeCJK_kerning_total_ratio_fp
- \etex_dimexpr:D
- \__xeCJK_use_punct_dim:nn { width } {#1} +
- \__xeCJK_use_punct_dim:nn { width } {#2}
- \scan_stop:
- }
- }
- }
- {#1} {#2}
+ \fp_use:N \l__xeCJK_kerning_total_ratio_fp
+ \etex_dimexpr:D
+ \__xeCJK_use_punct_dim:nN { width } #1 +
+ \__xeCJK_use_punct_dim:nN { width } #2
+ \scan_stop:
}
}
}
+ #1 #2
}
\cs_new_nopar:Npn \__xeCJK_kerning_width_or_ratio:nNN #1#2#3
{
@@ -2327,46 +2811,46 @@
\dim_max:nn
{
\dim_min:nn
- { \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_left_tl {#1} }
- { \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_right_tl {#1} }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #1 }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 }
}
{
\dim_min:nn
- { \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_left_tl {#2} }
- { \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_right_tl {#2} }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #2 }
+ { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #2 }
}
}
\cs_new_nopar:Npn \__xeCJK_calc_kerning_margin:nNN #1#2#3
{
\dim_eval:n
{
- (#1)
- - ( \__xeCJK_use_punct_dim:nnn
- { \__xeCJK_punct_if_right:NTF {#2} { bound } { glue } }
- { \c__xeCJK_left_tl } {#2} )
- - ( \__xeCJK_use_punct_dim:nnn
- { \__xeCJK_punct_if_right:NTF {#3} { glue } { bound } }
- { \c__xeCJK_right_tl } {#3} )
- - ( \__xeCJK_use_punct_dim:nn { dimen } {#2} )
- - ( \__xeCJK_use_punct_dim:nn { dimen } {#3} )
+ (#1)
+ - ( \__xeCJK_use_punct_dim:nNN
+ { \__xeCJK_punct_if_right:NTF #2 { bound } { glue } }
+ \c__xeCJK_left_tl #2 )
+ - ( \__xeCJK_use_punct_dim:nNN
+ { \__xeCJK_punct_if_right:NTF #3 { glue } { bound } }
+ \c__xeCJK_right_tl #3 )
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #2 )
+ - ( \__xeCJK_use_punct_dim:nN { dimen } #3 )
}
}
\cs_new_protected_nopar:Npn \xeCJK_calc_punct_dimen:N #1
{
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_left_tl {#1}
- { \xeCJK_glyph_bounds:NN \c_one {#1} }
- \__xeCJK_save_punct_dim:nnnn { bound } \c__xeCJK_right_tl {#1}
- { \xeCJK_glyph_bounds:NN \c_three {#1} }
+ \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_left_tl #1
+ { \xeCJK_glyph_bounds:NN \c_one #1 }
+ \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl #1
+ { \xeCJK_glyph_bounds:NN \c_three #1 }
\dim_set:Nn \l__xeCJK_tmp_dim
{
- ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_left_tl {#1} ) +
- ( \__xeCJK_use_punct_dim:nnn { bound } \c__xeCJK_right_tl {#1} )
+ ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #1 ) +
+ ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 )
}
- \__xeCJK_save_punct_dim:nnn { width } {#1}
- { \etex_fontcharwd:D \tex_font:D \xeCJK_token_value_charcode:N #1 }
- \__xeCJK_save_punct_dim:nnn { dimen } {#1}
- { \__xeCJK_use_punct_dim:nn { width } {#1} - \l__xeCJK_tmp_dim }
- \__xeCJK_punct_if_long:NT {#1}
+ \__xeCJK_save_punct_dim:nNn { width } #1
+ { \etex_fontcharwd:D \tex_font:D `#1 }
+ \__xeCJK_save_punct_dim:nNn { dimen } #1
+ { \__xeCJK_use_punct_dim:nN { width } #1 - \l__xeCJK_tmp_dim }
+ \__xeCJK_punct_if_long:NT #1
{
\dim_set:Nn \l__xeCJK_tmp_dim
{
@@ -2375,16 +2859,12 @@
{ \c_zero_dim }
{ \dim_min:nn { - \l__xeCJK_tmp_dim } { \c_zero_dim } }
}
- \__xeCJK_save_punct_dim:nnnn { kern } {#1} {#1} { \l__xeCJK_tmp_dim }
- \__xeCJK_save_punct_skip:nnnn { kern } {#1} {#1} { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_dim:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim }
+ \__xeCJK_save_punct_skip:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim }
}
}
-\cs_generate_variant:Nn \xeCJK_calc_punct_dimen:N { o }
\cs_new_nopar:Npn \xeCJK_glyph_bounds:NN #1#2
- {
- \dim_use:N \xetex_glyphbounds:D #1 ~
- \xetex_charglyph:D \xeCJK_token_value_charcode:N #2 \exp_stop_f:
- }
+ { \xetex_glyphbounds:D #1 ~ \xetex_charglyph:D `#2 \exp_stop_f: }
\keys_define:nn { xeCJK / options }
{
PunctStyle .choice: ,
@@ -2476,13 +2956,13 @@
}
\cs_new_protected_nopar:Npn \xeCJK_fallback_test_glyph:N #1
{
- \xeCJK_glyph_if_exist:NTF {#1}
- { \__xeCJK_fallback_save_CJKsymbol:N {#1} }
+ \xeCJK_glyph_if_exist:NTF #1
+ { \__xeCJK_fallback_save_CJKsymbol:N #1 }
{
\group_begin:
- \xeCJK_aftergroup_reset_Boundary:N {#1}
+ \xeCJK_aftergroup_reset_Boundary:N #1
\tl_set_eq:NN \l__xeCJK_fallback_family_tl \l_xeCJK_family_tl
- \xeCJK_fallback_loop:Nn {#1} { \l_xeCJK_family_tl/FallBack }
+ \xeCJK_fallback_loop:No #1 { \l_xeCJK_family_tl/FallBack }
\group_end:
}
}
@@ -2498,14 +2978,14 @@
\tl_new:N \g__xeCJK_aftergroup_Boundary_tl
\cs_new_protected_nopar:Npn \xeCJK_fallback_loop:Nn #1#2
{
- \xeCJK_family_if_exist:xTF {#2}
+ \xeCJK_family_if_exist:nTF {#2}
{
- \tl_set:Nx \l_xeCJK_family_tl {#2}
+ \tl_set:Nn \l_xeCJK_family_tl {#2}
\tl_set_eq:NN \CJK@family \l__xeCJK_fontspec_family_tl
\xeCJK_select_font:
- \xeCJK_glyph_if_exist:NTF {#1}
- { \__xeCJK_fallback_save_CJKsymbol:N {#1} }
- { \xeCJK_fallback_loop:Nn {#1} { \l_xeCJK_family_tl/FallBack } }
+ \xeCJK_glyph_if_exist:NTF #1
+ { \__xeCJK_fallback_save_CJKsymbol:N #1 }
+ { \xeCJK_fallback_loop:No #1 { \l_xeCJK_family_tl/FallBack } }
}
{
\str_if_eq_x:nnTF { \CJKfamilydefault } { \l__xeCJK_fallback_family_tl }
@@ -2513,14 +2993,15 @@
\__xeCJK_warning:nxxx { missing-glyph }
{ \l_xeCJK_family_tl } {#1}
{ \int_to_Hex:n { `#1 } }
- \__xeCJK_fallback_save_CJKsymbol:N {#1}
+ \__xeCJK_fallback_save_CJKsymbol:N #1
}
{
\tl_set:Nx \l__xeCJK_fallback_family_tl { \CJKfamilydefault }
- \xeCJK_fallback_loop:Nn {#1} { \l__xeCJK_fallback_family_tl }
+ \xeCJK_fallback_loop:Nn #1 { \l__xeCJK_fallback_family_tl }
}
}
}
+\cs_generate_variant:Nn \xeCJK_fallback_loop:Nn { No }
\__xeCJK_msg_new:nn { missing-glyph }
{
CJKfamily~`\__xeCJK_msg_family_map:n {#1}'~
@@ -2537,7 +3018,7 @@
{
\group_begin:
\tl_set:Nn \l__xeCJK_fallback_family_tl {#1}
- \prop_get:NVNF \g__xeCJK_family_font_name_prop
+ \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}
@@ -2821,13 +3302,13 @@
\cs_new_protected_nopar:Npn \__xeCJK_copy_sub_family:n #1
{
\__xeCJK_check_family:V \l__xeCJK_sub_family_name_tl
- \prop_get:NVNT \g__xeCJK_family_font_name_prop
+ \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
\l__xeCJK_sub_family_name_tl \l__xeCJK_sub_font_name_tl
}
- \prop_get:NVNT \g__xeCJK_family_font_options_prop
+ \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 = * }
@@ -2867,19 +3348,37 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_copy_family:xx #1#2
{ \use:x { \__xeCJK_copy_family:nn {#1} {#2} } }
+\cs_new_nopar:Npn \__xeCJK_font_csname:n #1
+ { xeCJK/#1/\f@series/\f@shape/\f@size }
\tl_new:N \l_xeCJK_current_font_tl
-\tl_set:Nn \l_xeCJK_current_font_tl { \__xeCJK_font_csname:n { \CJK@family } }
-\cs_new_nopar:Npn \__xeCJK_font_csname:n #1 { xeCJK/#1/\f@series/\f@shape/\f@size }
+\tl_set:No \l_xeCJK_current_font_tl
+ { \__xeCJK_font_csname:n { \CJK@family } }
\cs_new_protected_nopar:Npn \xeCJK_select_font:
{
\exp_args:Nc \cs_if_exist_use:NF { \l_xeCJK_current_font_tl }
{
- \__xeCJK_family_use:x { \l_xeCJK_family_tl }
+ \__xeCJK_family_use:n { \l_xeCJK_family_tl }
\xeCJK_font_gset_to_current:c { \l_xeCJK_current_font_tl }
}
}
\tl_new:N \l__xeCJK_current_coor_tl
\cs_new_eq:NN \xeCJK@setfont \xeCJK_select_font:
+\cs_new_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font:
+\cs_new_protected_nopar:Npn \__xeCJK_select_punct_font_aux:
+ {
+ \exp_args:Nc \cs_if_exist_use:NF { \l_xeCJK_current_punct_font_tl }
+ {
+ \__xeCJK_family_use:n { \l_xeCJK_punct_family_tl }
+ \xeCJK_font_gset_to_current:c { \l_xeCJK_current_punct_font_tl }
+ }
+ }
+\tl_new:N \CJK@punctfamily
+\tl_new:N \l_xeCJK_punct_family_tl
+\tl_new:N \l_xeCJK_current_punct_font_tl
+\tl_set:No \l_xeCJK_current_punct_font_tl
+ { \__xeCJK_font_csname:n { \CJK@punctfamily } }
+\cs_new_eq:NN \__xeCJK_select_font: \prg_do_nothing:
+\cs_new_eq:NN \__xeCJK_select_punct_font: \prg_do_nothing:
\cs_new_protected_nopar:Npn \__xeCJK_switch_font:nn #1#2
{
\str_if_eq:nnF {#1} {#2}
@@ -2893,10 +3392,11 @@
\__xeCJK_msg_new:nn { CJK-block } { Switch~from~block~`#1'~to~`#2'. }
\cs_new_protected_nopar:Npn \xeCJK_select_font:n #1
{
- \exp_args:Nc \cs_if_exist_use:NF { \__xeCJK_font_csname:n { \CJK@family/#1 } }
+ \exp_args:Nc \cs_if_exist_use:NF
+ { \__xeCJK_font_csname:n { \CJK@family/#1 } }
{
\xeCJK_block_family:nn { \l_xeCJK_family_tl } {#1}
- \__xeCJK_family_use:x { \l_xeCJK_family_tl/#1 }
+ \__xeCJK_family_use:n { \l_xeCJK_family_tl/#1 }
\xeCJK_font_gset_to_current:c
{ \__xeCJK_font_csname:n { \CJK@family/#1 } }
}
@@ -2913,73 +3413,113 @@
}
}
}
-\cs_new_nopar:Npn \__xeCJK_family_csname:n #1 { xeCJK/family/#1 }
-\cs_new_nopar:Npn \__xeCJK_family_nfss_csname:n #1 { xeCJK/family/nfss/#1 }
-\cs_new_nopar:Npn \__xeCJK_family_use:x #1 { \use:c { \__xeCJK_family_nfss_csname:n {#1} } }
-\cs_new_protected_nopar:Npn \__xeCJK_gset_family_nfss_cs:xx #1#2
+\cs_new_nopar:Npn \__xeCJK_family_csname:n #1
+ { xeCJK/family/#1 }
+\cs_new_nopar:Npn \__xeCJK_family_nfss_csname:n #1
+ { xeCJK/family/nfss/#1 }
+\cs_new_nopar:Npn \__xeCJK_family_use:n #1
+ { \use:c { \__xeCJK_family_nfss_csname:n {#1} } }
+\cs_new_protected_nopar:Npn \__xeCJK_gset_family_nfss_cs:nn #1#2
{
- \prop_gput:Nxx \g__xeCJK_family_name_prop {#1} {#2}
- \cs_gset_protected_nopar:cpx { \__xeCJK_family_nfss_csname:n {#1} }
+ \prop_gput:Nnn \g__xeCJK_family_name_prop {#1} {#2}
+ \cs_gset_protected_nopar:cpx
+ { \__xeCJK_family_nfss_csname:n {#1} }
{
\exp_not:N \fontencoding { \c__xeCJK_encoding_tl }
- \tl_set:Nx \exp_not:N \f@family {#2}
+ \tl_set:Nn \exp_not:N \f@family {#2}
\exp_not:N \selectfont
}
}
-\cs_generate_variant:Nn \prop_gput:Nnn { Nxx }
+\cs_generate_variant:Nn \__xeCJK_gset_family_nfss_cs:nn { xx }
\prg_new_protected_conditional:Npnn \xeCJK_family_if_exist:n #1 { T , F , TF }
{
- \prop_get:NnNTF \g__xeCJK_family_name_prop {#1} \l__xeCJK_fontspec_family_tl
+ \prop_get:NnNTF \g__xeCJK_family_name_prop
+ {#1} \l__xeCJK_fontspec_family_tl
{ \prg_return_true: }
{
- \exp_args:Nc \cs_if_exist_use:NTF { \__xeCJK_family_csname:n {#1} }
- { \prg_return_true: } { \prg_return_false: }
+ \cs_if_exist_use:cTF { \__xeCJK_family_csname:n {#1} }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
}
-\cs_generate_variant:Nn \xeCJK_family_if_exist:nT { x }
-\cs_generate_variant:Nn \xeCJK_family_if_exist:nF { x }
-\cs_generate_variant:Nn \xeCJK_family_if_exist:nTF { x }
+\prg_generate_conditional_variant:Nnn \xeCJK_family_if_exist:n { x } { T , F , TF }
\NewDocumentCommand \CJKfamily { t+ t- m }
{
- \xeCJK_if_blank_x:nTF {#3}
+ \xeCJK_family:NNx #1 #2 {#3}
+ \tex_ignorespaces:D
+ }
+\cs_new_protected_nopar:Npn \xeCJK_family:NNn #1#2#3
+ {
+ \tl_if_blank:nTF {#3}
{
- \IfBooleanF {#1} { \IfBooleanF {#2} { \use_none:nn } }
+ \bool_if:NF #1 { \bool_if:NF #2 { \use_none:nn } }
\xeCJK_family_if_exist_use:x { \l_xeCJK_family_tl }
}
{
- \IfBooleanTF {#2} { \xeCJK_family_if_exist_use:x {#3} }
+ \bool_if:NTF #2
+ { \xeCJK_family_if_exist_use:n {#3} }
{
- \xeCJK_family_if_exist:xTF {#3}
+ \xeCJK_family_if_exist:nTF {#3}
{
- \tl_set:Nx \l_xeCJK_family_tl {#3}
+ \tl_set:Nn \l_xeCJK_family_tl {#3}
\tl_set_eq:NN \CJK@family \l__xeCJK_fontspec_family_tl
- \IfBooleanT {#1} { \__xeCJK_family_use:x {#3} }
+ \bool_if:NT #1 { \__xeCJK_family_use:n {#3} }
}
- { \__xeCJK_family_unknown_warning:x {#3} }
+ { \__xeCJK_family_unknown_warning:n {#3} }
}
}
- \tex_ignorespaces:D
}
+\cs_generate_variant:Nn \xeCJK_family:NNn { NNx }
\cs_new_protected_nopar:Npn \xeCJK_switch_family:n #1
{
- \xeCJK_family_if_exist:xTF {#1}
+ \xeCJK_family_if_exist:nTF {#1}
{
- \tl_set:Nx \l_xeCJK_family_tl {#1}
+ \tl_set:Nn \l_xeCJK_family_tl {#1}
\tl_set_eq:NN \CJK@family \l__xeCJK_fontspec_family_tl
}
- { \__xeCJK_family_unknown_warning:x {#1} }
+ { \__xeCJK_family_unknown_warning:n {#1} }
+ }
+\cs_generate_variant:Nn \xeCJK_switch_family:n { x , o }
+\keys_define:nn { xeCJK / options }
+ {
+ PunctFamily .choice: ,
+ PunctFamily .value_required:n = { true } ,
+ PunctFamily / false .code:n =
+ {
+ \tl_clear:N \l_xeCJK_punct_family_tl
+ \tl_clear:N \CJK@punctfamily
+ \xeCJK_cs_clear:N \__xeCJK_select_font:
+ \xeCJK_cs_clear:N \__xeCJK_select_punct_font:
+ \cs_set_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font:
+ } ,
+ PunctFamily / unknown .code:n =
+ { \xeCJK_punct_family:x {#1} } ,
+ }
+\cs_new_protected_nopar:Npn \xeCJK_punct_family:n #1
+ {
+ \xeCJK_family_if_exist:nTF {#1}
+ {
+ \tl_set:Nn \l_xeCJK_punct_family_tl {#1}
+ \tl_set_eq:NN \CJK@punctfamily \l__xeCJK_fontspec_family_tl
+ \cs_set_eq:NN \__xeCJK_select_font: \xeCJK_select_font:
+ \cs_set_eq:NN \__xeCJK_select_punct_font: \__xeCJK_select_punct_font_aux:
+ \cs_set_eq:NN \xeCJK_select_punct_font: \__xeCJK_select_punct_font:
+ }
+ { \__xeCJK_family_unknown_warning:n {#1} }
}
+\cs_generate_variant:Nn \xeCJK_punct_family:n { x }
\tl_new:N \l_xeCJK_family_tl
\tl_new:N \CJK@family
\cs_new_protected_nopar:Npn \__xeCJK_gobble_CJKfamily:
{ \cs_set_eq:NN \CJKfamily \__xeCJK_gobble_CJKfamily:wn }
\DeclareExpandableDocumentCommand \__xeCJK_gobble_CJKfamily:wn { t+ t- m } { }
-\cs_new_protected_nopar:Npn \xeCJK_family_if_exist_use:x #1
+\cs_new_protected_nopar:Npn \xeCJK_family_if_exist_use:n #1
{
- \xeCJK_family_if_exist:xTF {#1}
- { \__xeCJK_family_use:x {#1} }
- { \__xeCJK_family_unknown_warning:x {#1} }
+ \xeCJK_family_if_exist:nTF {#1}
+ { \__xeCJK_family_use:n {#1} }
+ { \__xeCJK_family_unknown_warning:n {#1} }
}
+\cs_generate_variant:Nn \xeCJK_family_if_exist_use:n { x }
\cs_new_protected_nopar:Npn \__xeCJK_family_unknown_warning:n #1
{
\prop_if_empty:NF \g__xeCJK_family_font_name_prop
@@ -3021,7 +3561,7 @@
}
\cs_new_protected:Npn \__xeCJK_pass_args:nnnn #1#2#3#4
{
- \IfNoValueTF {#2}
+ \tl_if_novalue:nTF {#2}
{ \__xeCJK_post_arg:w {#1} {#3} {#4} }
{
\use:x { #1 {#2} {#3} }
@@ -3065,8 +3605,10 @@
}
\NewDocumentCommand \newCJKfontfamily { o m o m }
{
- \tl_set:Nx \l__xeCJK_tmp_tl { \IfNoValueTF {#1} { \cs_to_str:N #2 } {#1} }
- \cs_new_protected_nopar:Npx #2 { \xeCJK_switch_family:n { \l__xeCJK_tmp_tl } }
+ \tl_set:Nx \l__xeCJK_tmp_tl
+ { \tl_if_novalue:nTF {#1} { \cs_to_str:N #2 } {#1} }
+ \cs_new_protected_nopar:Npx #2
+ { \xeCJK_switch_family:n { \l__xeCJK_tmp_tl } }
\__xeCJK_pass_args:nnnn
{ \xeCJK_set_family:nnn { \l__xeCJK_tmp_tl } } {#3} {#4}
{ }
@@ -3081,7 +3623,7 @@
{
\prop_get:NnNTF \g__xeCJK_fontspec_prop
{ CJKfontspec/#1/#2/id } \l_xeCJK_family_tl
- { \xeCJK_switch_family:n { \l_xeCJK_family_tl } }
+ { \xeCJK_switch_family:o { \l_xeCJK_family_tl } }
{
\__xeCJK_fontspec:xnn
{ CJKfontspec ( \int_eval:n { \g__xeCJK_family_int + \c_one } ) }
@@ -3109,7 +3651,7 @@
\cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures
\cs_new_protected_nopar:Npn \xeCJK_add_font_features:Nnn #1#2#3
{
- \prop_get:NVNTF \g__xeCJK_family_font_name_prop
+ \prop_get:NoNTF \g__xeCJK_family_font_name_prop
\l_xeCJK_family_tl \l__xeCJK_font_name_tl
{
\clist_set:Nn \l__xeCJK_add_font_features_clist {#3}
@@ -3133,7 +3675,7 @@
\seq_map_function:NN
\g__xeCJK_sub_key_seq \__xeCJK_add_sub_class_features:n
}
- \prop_get:NVNT \g__xeCJK_family_font_options_prop
+ \prop_get:NoNT \g__xeCJK_family_font_options_prop
\l_xeCJK_family_tl \l__xeCJK_font_options_clist
{
\bool_lazy_or:nnT
@@ -3174,7 +3716,7 @@
{ \CJKfamilydefault/#1 } \l__xeCJK_sub_font_options_clist
}
{
- \prop_get:NVN \g__xeCJK_family_font_options_prop
+ \prop_get:NoN \g__xeCJK_family_font_options_prop
\l_xeCJK_family_tl \l__xeCJK_sub_font_options_clist
\tl_set_eq:NN \l__xeCJK_sub_font_name_tl \l__xeCJK_font_name_tl
}
@@ -3190,8 +3732,8 @@
}
}
}
-\cs_generate_variant:Nn \prop_get:NnN { Nx }
-\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
+\cs_generate_variant:Nn \prop_get:NnN { Nx }
+\prg_generate_conditional_variant:Nnn \prop_get:NnN { Nx } { TF }
\keys_define:nn { xeCJK / options }
{ LoadFandol .bool_gset:N = \g__xeCJK_fandol_bool }
\cs_new_protected_nopar:Npn \__xeCJK_load_fandol:
@@ -3255,7 +3797,7 @@
\__xeCJK_warning:nxx { CJKfamilydefault-undefined }
{ \l__xeCJK_tmp_tl } { \CJKfamilydefault }
}
- \xeCJK_switch_family:n { \CJKfamilydefault }
+ \xeCJK_switch_family:x { \CJKfamilydefault }
\bool_if:NT \g__xeCJK_math_bool { \xeCJK_set_mathfont: }
}
\__xeCJK_msg_new:nn { no-CJKfamily }
@@ -3298,14 +3840,19 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_set_mathfont_aux:
{
- \tl_const:Nx \c__xeCJK_math_family_tl { \l__xeCJK_fontspec_family_tl }
- \xeCJK_declare_mathfont:nn { \c__xeCJK_math_tl } { \c__xeCJK_math_family_tl }
- \int_const:Nn \c_xeCJK_math_fam_int { \use:c { sym \c__xeCJK_math_tl } }
- \clist_concat:NNN \g__xeCJK_math_chars_clist
+ \tl_const:Nx \c__xeCJK_math_family_tl
+ { \l__xeCJK_fontspec_family_tl }
+ \xeCJK_declare_mathfont:xx
+ { \c__xeCJK_math_tl }
+ { \c__xeCJK_math_family_tl }
+ \int_const:Nn \c_xeCJK_math_fam_int
+ { \use:c { sym \c__xeCJK_math_tl } }
+ \clist_gconcat:NNN \g__xeCJK_math_chars_clist
\g__xeCJK_CJK_range_clist \g__xeCJK_FullLeft_range_clist
- \clist_concat:NNN \g__xeCJK_math_chars_clist
+ \clist_gconcat:NNN \g__xeCJK_math_chars_clist
\g__xeCJK_math_chars_clist \g__xeCJK_FullRight_range_clist
- \xeCJK_gset_mathcode:Nn \g__xeCJK_math_chars_clist { \c_xeCJK_math_fam_int }
+ \xeCJK_gset_mathcode:Nn \g__xeCJK_math_chars_clist
+ { \c_xeCJK_math_fam_int }
\xeCJK_set_mathfont_block:
}
\clist_new:N \g__xeCJK_math_chars_clist
@@ -3323,12 +3870,14 @@
{
\xeCJK_block_family:nn { \c__xeCJK_math_tl } {#1}
\prop_get:NoNTF \g__xeCJK_fam_prop
- { \l__xeCJK_fontspec_family_tl } \l__xeCJK_tmp_tl
+ \l__xeCJK_fontspec_family_tl \l__xeCJK_tmp_tl
{ \int_set:Nn \l__xeCJK_fam_int { \l__xeCJK_tmp_tl } }
{
- \xeCJK_declare_mathfont:nn
- { \c__xeCJK_math_tl / #1 } { \l__xeCJK_fontspec_family_tl }
- \__xeCJK_set_mathfont_block_aux:cn { sym \c__xeCJK_math_tl / #1 } {#1}
+ \xeCJK_declare_mathfont:xx
+ { \c__xeCJK_math_tl / #1 }
+ { \l__xeCJK_fontspec_family_tl }
+ \__xeCJK_set_mathfont_block_aux:cn
+ { sym \c__xeCJK_math_tl / #1 } {#1}
}
\xeCJK_gset_mathcode:cn { g__xeCJK_CJK/#1_range_clist } { \l__xeCJK_fam_int }
}
@@ -3350,8 +3899,10 @@
\SetSymbolFont {#1} { bold } { \c__xeCJK_encoding_tl }
{#2} { \bfdefault } { \updefault }
}
- \prop_gput:Nxx \g__xeCJK_fam_prop {#2} { \exp_not:c { sym #1 } }
+ \prop_gput:Nnx \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_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
@@ -3474,8 +4025,6 @@
{ \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ccglue_skip }
\cs_new_protected_nopar:Npn \__xeCJK_nobreak_ecglue:
{ \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ecglue_skip }
-\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:n
- { \xeCJK_no_break: \skip_horizontal:n }
\cs_new_protected_nopar:Npn \__xeCJK_reset_shipout_skip:
{
\cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue
@@ -3493,8 +4042,8 @@
\cs_set_eq:NN \CJKglue \__xeCJK_shipout_CJKglue:
\cs_set_eq:NN \CJKecglue \__xeCJK_shipout_CJKecglue:
\cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_shipout_punct_hskip:n
- \cs_set_eq:NN
- \__xeCJK_punct_breakable_kern:n \__xeCJK_shipout_punct_breakable_kern:n
+ \cs_set_eq:NN \__xeCJK_punct_breakable_kern:n
+ \__xeCJK_shipout_punct_breakable_kern:n
\l__xeCJK_reset_shipout_skip_hook_tl
}
}
@@ -3596,10 +4145,10 @@
}
{
\tl_set:Nx \l__xeCJK_current_coor_tl { \CJK@family/\curr@fontshape }
- \prop_get:NVNTF \g__xeCJK_scale_family_prop
+ \prop_get:NoNTF \g__xeCJK_scale_family_prop
\l__xeCJK_current_coor_tl \l_xeCJK_family_tl
{
- \xeCJK_switch_family:n { \l_xeCJK_family_tl }
+ \xeCJK_switch_family:o { \l_xeCJK_family_tl }
\skip_zero:N \l__xeCJK_verb_exspace_skip
}
{
@@ -3676,7 +4225,8 @@
} }
\cs_new_protected_nopar:Npn \xeCJK_set_visible_space_font:
{
- \tl_set:Nx \l__xeCJK_current_coor_tl { xeCJK/space/\curr@fontshape/\f@size }
+ \tl_set:Nx \l__xeCJK_current_coor_tl
+ { xeCJK/space/\curr@fontshape/\f@size }
\exp_after:wN \__xeCJK_set_visible_space_size:n
\exp_after:wN { \dim_use:N \tex_fontdimen:D \c_two \tex_font:D }
\xeCJK_font_gset_to_current:c { \l__xeCJK_current_coor_tl }
@@ -3759,7 +4309,7 @@
}
\__xeCJK_msg_new:nn { key-unknown }
{
- Sorry,~but~\l__keys_module_tl \ does~not~have~a~key~called~`#1'.\\\\
+ Sorry,~but~xeCJK/options~does~not~have~a~key~called~`#1'.\\\\
The~key~`#1'~is~being~ignored.
}
\cs_new_nopar:Npn \CJKsymbol #1 {#1}
@@ -3787,8 +4337,8 @@
WidowPenalty = \c_ten_thousand ,
NoBreakCS = { \footnote \footnotemark \nobreak } ,
KaiMingPunct = { ^^^^3002 ^^^^ff0e ^^^^ff1f ^^^^ff01 } ,
- LongPunct = { ^^^^2014 ^^^^2025 ^^^^2026 } ,
- MiddlePunct = { ^^^^2013 ^^^^2014 ^^^^2027 ^^^^00b7 ^^^^30fb ^^^^ff65 } ,
+ LongPunct = { ^^^^2014 ^^^^2e3a ^^^^2025 ^^^^2026 } ,
+ MiddlePunct = { ^^^^2013 ^^^^2014 ^^^^2e3a ^^^^2027 ^^^^00b7 ^^^^30fb ^^^^ff65 } ,
AllowBreakBetweenPuncts = false
}
\defaultCJKfontfeatures { Script = CJK }
@@ -3863,7 +4413,7 @@
\cs_set_protected_nopar:Npx \hbar
{ {
\mathchar
- \int_eval:n { \symlegacymaths * \c_two_hundred_fifty_six + '26 } ~
+ \int_eval:n { \symlegacymaths * 256 + '26 } ~
\mkern -9mu h
} }
\fi:
@@ -4040,17 +4590,17 @@
\cs_new_protected_nopar:Npn \xeCJK@fontfamily #1
{
\str_if_eq:nnTF {#1} { \familydefault }
- { \xeCJK_switch_family:n { \CJKfamilydefault } }
+ { \xeCJK_switch_family:x { \CJKfamilydefault } }
{ \__xeCJK_update_family_aux: }
}
\cs_new_protected_nopar:Npn \__xeCJK_update_family_aux:
{
\str_case_x:nn { \f@family }
{
- { \rmdefault } { \xeCJK_switch_family:n { \CJKrmdefault } }
- { \sfdefault } { \xeCJK_switch_family:n { \CJKsfdefault } }
- { \ttdefault } { \xeCJK_switch_family:n { \CJKttdefault } }
- { \familydefault } { \xeCJK_switch_family:n { \CJKfamilydefault } }
+ { \rmdefault } { \xeCJK_switch_family:x { \CJKrmdefault } }
+ { \sfdefault } { \xeCJK_switch_family:x { \CJKsfdefault } }
+ { \ttdefault } { \xeCJK_switch_family:x { \CJKttdefault } }
+ { \familydefault } { \xeCJK_switch_family:x { \CJKfamilydefault } }
}
}
\cs_new_eq:NN \xeCJK@fix@penalty \fix@penalty
@@ -4059,36 +4609,45 @@
\cs_new_protected_nopar:Npn \xeCJK@italiccorr
{
\int_compare:nNnTF \xetex_interchartokenstate:D > \c_zero
+ { \xeCJK_italic_correction: }
+ { \@@italiccorr }
+ }
+\cs_new_protected_nopar:Npn \xeCJK_italic_correction:
+ {
+ \int_compare:nNnT \etex_lastnodetype:D = \c_twelve
+ { \__xeCJK_italic_correction: }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_italic_correction:
+ {
+ \dim_case:nnF { \tex_lastkern:D }
{
- \xeCJK_if_last_node:nTF { default }
- {
- \xeCJK_remove_node: \@@italiccorr
- { \xeCJK_make_node:n { default } }
- }
- {
- \xeCJK_if_last_node:nTF { CJK }
- {
- \xeCJK_remove_node: \@@italiccorr
- { \xeCJK_make_node:n { CJK } } \use:n
- }
- {
- \xeCJK_if_last_node:nTF { CJK-space }
- {
- \xeCJK_remove_node: \@@italiccorr
- { \xeCJK_make_node:n { CJK-space } } \use:n
- }
- { \@@italiccorr \use_none:n }
- }
- {
- \exp_after:wN \exp_after:wN \exp_after:wN
- \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
- \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
- \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
- \xeCJK_ignore_spaces:w
- }
- }
+ { \__xeCJK_node:n { default } }
+ {
+ \xeCJK_remove_node: \tex_italiccorrection:D
+ \xeCJK_make_node:n { default }
+ }
+ { \__xeCJK_node:n { CJK } }
+ {
+ \xeCJK_remove_node: \tex_italiccorrection:D
+ \xeCJK_make_node:n { CJK }
+ \__xeCJK_italic_correction_aux:
+ }
+ { \__xeCJK_node:n { CJK-space } }
+ {
+ \xeCJK_remove_node: \tex_italiccorrection:D
+ \xeCJK_make_node:n { CJK-space }
+ \__xeCJK_italic_correction_aux:
+ }
}
- { \@@italiccorr }
+ { \tex_italiccorrection:D }
+ }
+\cs_new_protected_nopar:Npn \__xeCJK_italic_correction_aux:
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
+ \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
+ \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
+ \xeCJK_ignore_spaces:w
}
\cs_new_eq:NN \g__xeCJK_xetex_allocator_int \xe@alloc@intercharclass
\__xeCJK_after_end_preamble:n
@@ -4098,7 +4657,9 @@
{ \g__xeCJK_xetex_allocator_int }
{
\int_step_inline:nnnn
- { \c__xeCJK_class_begin_int + \c_one } \c_one \g__xeCJK_xetex_allocator_int
+ { \c__xeCJK_class_begin_int + \c_one }
+ { \c_one }
+ { \g__xeCJK_xetex_allocator_int }
{
\seq_if_in:NnF \g__xeCJK_new_class_seq {#1}
{ \__xeCJK_set_others_toks:n {#1} }
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
index 827bf5e5f01..f7c67505480 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `fntef')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2017 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2017 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{xeCJK font effect}
\ProvidesExplPackage{xeCJKfntef}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
\PassOptionsToPackage { normalem } { ulem }
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
\ProcessOptions \scan_stop:
@@ -70,7 +70,6 @@
\cs_set_eq:NN \__xeCJK_ulem_hskip_aux:n \xeCJK_ulem_hskip:n
}
{
- \xeCJK_swap_cs:NN \__xeCJK_punct_kern:n \__xeCJK_ulem_punct_kern:n
\xeCJK_swap_cs:NN \__xeCJK_punct_hskip:n \__xeCJK_ulem_punct_hskip:n
\xeCJK_cs_clear:N \__xeCJK_ulem_skip_punct_begin:
\xeCJK_cs_clear:N \__xeCJK_ulem_skip_punct_end:
@@ -96,6 +95,8 @@
{ \__xeCJK_ulem_glue:n \l__xeCJK_ecglue_skip }
\cs_set_protected_nopar:Npn \xeCJK_space_glue:
{ \__xeCJK_ulem_glue:n \l__xeCJK_space_skip }
+ \cs_set_eq:NN \xeCJK_punct_node:N \use_none:n
+ \cs_set_eq:NN \xeCJK_if_last_punct:TF \use_ii:nn
\keys_set:nn { xeCJK / options }
{ CheckFullRight = false , xCJKecglue = false }
}
@@ -247,7 +248,7 @@
\int_compare:nNnTF \etex_lastnodetype:D = \c_twelve
{ \__xeCJK_ulem_right_skip_kern: }
{ \__xeCJK_ulem_right_skip_glue: }
- \box_use_clear:N \l__xeCJK_tmp_box
+ \box_use_drop:N \l__xeCJK_tmp_box
}
\cs_new_protected_nopar:Npn \__xeCJK_ulem_right_skip_kern:
{
@@ -303,18 +304,20 @@
\cs_new_protected_nopar:Npn \__xeCJK_ulem_skip_putbox:
{
\tl_if_empty:NF \UL@start
- { \box_use_clear:N \UL@box }
+ { \box_use_drop:N \UL@box }
}
\cs_new_protected_nopar:Npn \__xeCJK_ulem_initial:
{
\__xeCJK_ulem_swap_cs:NN
- \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_FullLeft_and_Default:
- \xeCJK_FullLeft_and_CJK: \__xeCJK_ulem_FullLeft_and_CJK:
- \xeCJK_FullRight_and_Default: \__xeCJK_ulem_FullRight_and_Default:
- \xeCJK_FullRight_and_CJK: \__xeCJK_ulem_FullRight_and_CJK:
- \xeCJK_CJK_and_CJK:N \__xeCJK_ulem_CJK_and_CJK:N
- \xeCJK_CJK_and_Boundary:w \__xeCJK_ulem_CJK_and_Boundary:w
- \xeCJK@fix@penalty \__xeCJK_ulem_fix_penalty:
+ \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_FullLeft_and_Default:
+ \xeCJK_FullLeft_and_CJK: \__xeCJK_ulem_FullLeft_and_CJK:
+ \xeCJK_FullLeft_and_Boundary: \__xeCJK_ulem_FullLeft_and_Boundary:
+ \xeCJK_FullRight_and_Default: \__xeCJK_ulem_FullRight_and_Default:
+ \xeCJK_FullRight_and_CJK: \__xeCJK_ulem_FullRight_and_CJK:
+ \xeCJK_FullRight_and_Boundary: \__xeCJK_ulem_FullRight_and_Boundary:
+ \xeCJK_CJK_and_CJK:N \__xeCJK_ulem_CJK_and_CJK:N
+ \xeCJK_CJK_and_Boundary:w \__xeCJK_ulem_CJK_and_Boundary:w
+ \xeCJK@fix@penalty \__xeCJK_ulem_fix_penalty:
\__xeCJK_punct_breakable_kern:n \__xeCJK_ulem_punct_breakable_kern:n
\__xeCJK_Default_and_FullLeft_glue:N \__xeCJK_ulem_Default_and_FullLeft_glue:N
\__xeCJK_Default_and_FullRight_glue:N \__xeCJK_ulem_Default_and_FullRight_glue:N
@@ -392,6 +395,7 @@
\xeCJK_class_group_end:
\UL@stop \__xeCJK_ulem_ccglue: \UL@start
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_font:
\CJKsymbol
}
{ \__xeCJK_ulem_CJK_and_CJK:N }
@@ -400,7 +404,6 @@
{
\xeCJK_class_group_begin:
\xeCJK_clear_Boundary_and_CJK_toks:
- \xeCJK_select_font:
}
\cs_new_protected_nopar:Npn \__xeCJK_ulem_between_CJK_blocks:nnN #1#2
{
@@ -425,8 +428,8 @@
{
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl #1
\UL@start
}
{ \__xeCJK_ulem_Default_and_FullLeft_glue:N #1 }
@@ -437,7 +440,7 @@
{
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
\UL@start
}
{ \__xeCJK_ulem_Boundary_and_FullLeft_glue:N #1 }
@@ -449,11 +452,12 @@
\xeCJK_class_group_end:
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
- \__xeCJK_ulem_ccglue:
- \__xeCJK_punct_glue:NN \c__xeCJK_left_tl {#1}
- \__xeCJK_punct_offset:NN \c__xeCJK_left_tl {#1}
+ \__xeCJK_ulem_punct_ccglue:
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
+ \__xeCJK_punct_offset:NN \c__xeCJK_left_tl #1
\UL@start
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_punct_font:
}
{ \__xeCJK_ulem_CJK_and_FullLeft_glue:N #1 }
}
@@ -463,16 +467,13 @@
{
\UL@stop
\__xeCJK_ulem_skip_punct_begin:
- \__xeCJK_punct_if_long:NTF {#1}
- { \__xeCJK_ulem_ccglue: }
+ \__xeCJK_punct_if_long:NTF #1
+ { \xeCJK_allow_break: }
+ { \xeCJK_no_break: }
+ \__xeCJK_punct_if_middle:NT #1
{
- \__xeCJK_punct_if_middle:NTF {#1}
- {
- \xeCJK_no_break:
- \__xeCJK_punct_glue:NN \c__xeCJK_right_tl {#1}
- \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl {#1}
- }
- { \xeCJK_no_break: }
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
}
\UL@start
}
@@ -483,8 +484,20 @@
\xeCJK_if_ulem_patch:TF
{
\xeCJK_class_group_end:
- \__xeCJK_Default_and_FullRight_glue:N {#1}
+ \UL@stop
+ \__xeCJK_ulem_skip_punct_begin:
+ \__xeCJK_punct_if_long:NTF #1
+ { \xeCJK_allow_break: }
+ { \xeCJK_no_break: }
+ \__xeCJK_punct_if_middle:NT #1
+ {
+ \__xeCJK_ulem_punct_ccglue:
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_left_tl #1
+ }
+ \UL@start
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_punct_font:
}
{ \__xeCJK_ulem_CJK_and_FullRight_glue:N #1 }
}
@@ -494,7 +507,7 @@
{
\__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
{
- \xeCJK_get_punct_bounds:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
+ \xeCJK_get_punct_bounds:No \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
\__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
@@ -506,12 +519,32 @@
}
{ \__xeCJK_ulem_FullLeft_and_Default: }
}
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_FullLeft_and_Boundary:
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
+ {
+ \xeCJK_get_punct_bounds:No \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_bound_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
+ \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
+ }
+ { \xeCJK_class_group_end: \UL@stop }
+ \__xeCJK_ulem_skip_punct_end:
+ \xeCJK_no_break:
+ \UL@start
+ \tex_ignorespaces:D
+ }
+ { \__xeCJK_ulem_FullLeft_and_Boundary: }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_ulem_FullLeft_and_CJK:
{
\xeCJK_if_ulem_patch:TF
{
\xeCJK_FullLeft_and_Default:
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_font:
}
{ \__xeCJK_ulem_FullLeft_and_CJK: }
}
@@ -529,6 +562,21 @@
}
{ \__xeCJK_ulem_FullRight_and_Default: }
}
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_FullRight_and_Boundary:
+ {
+ \xeCJK_if_ulem_patch:TF
+ {
+ \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \xeCJK_class_group_end:
+ \UL@stop
+ \__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
+ \__xeCJK_ulem_skip_punct_end:
+ \UL@start
+ \tex_ignorespaces:D
+ }
+ { \__xeCJK_ulem_FullRight_and_Boundary: }
+ }
\cs_new_protected_nopar:Npn \__xeCJK_ulem_FullRight_and_CJK:
{
\xeCJK_if_ulem_patch:TF
@@ -538,10 +586,11 @@
\UL@stop
\__xeCJK_punct_offset:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
\__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
- \__xeCJK_ulem_ccglue:
+ \__xeCJK_ulem_punct_ccglue:
\__xeCJK_ulem_skip_punct_end:
\UL@start
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_font:
}
{ \__xeCJK_ulem_FullRight_and_CJK: }
}
@@ -551,15 +600,6 @@
{ \xeCJK_ulem_hskip:n }
{ \__xeCJK_ulem_punct_hskip:n }
}
-\cs_new_protected_nopar:Npn \__xeCJK_ulem_punct_kern:n #1
- {
- \xeCJK_if_ulem_patch:TF
- {
- \dim_compare:nNnF {#1} = \c_zero_dim
- { \xeCJK_ulem_hskip:n {#1} }
- }
- { \__xeCJK_ulem_punct_kern:n {#1} }
- }
\cs_new_protected_nopar:Npn \__xeCJK_ulem_punct_breakable_kern:n #1
{
\xeCJK_if_ulem_patch:TF
@@ -567,6 +607,7 @@
\xeCJK_class_group_end:
\UL@stop \xeCJK_ulem_hskip:n {#1} \UL@start
\__xeCJK_ulem_class_group_begin:
+ \xeCJK_select_punct_font:
}
{ \__xeCJK_ulem_punct_breakable_kern:n {#1} }
}
@@ -594,9 +635,11 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_ulem_ccglue:
{ { \skip_set_eq:NN \UL@skip \l__xeCJK_ccglue_skip \UL@leaders } }
+\cs_new_protected_nopar:Npn \__xeCJK_ulem_punct_ccglue:
+ { \__xeCJK_punct_hskip:n { \l__xeCJK_ccglue_skip } }
\cs_new_protected_nopar:Npn \xeCJK_ulem_group_begin:
{
- \xeCJK_leave_vmode:
+ \mode_leave_vertical:
\c_group_begin_token
}
\cs_new_protected_nopar:Npn \xeCJK_ulem_group_end:
@@ -608,7 +651,7 @@
{ \__xeCJK_ulem_on:n { \xeCJK_ulem_left: #1 \xeCJK_ulem_right: } }
\NewDocumentCommand \xeCJKfntefon { s t- s o }
{
- \xeCJK_leave_vmode:
+ \mode_leave_vertical:
\xeCJK_ulem_boot:NNNn #1#2#3 {#4}
\xeCJK_ulem_on:n
}
@@ -725,9 +768,9 @@
{
\bool_lazy_or:nnT {#3} {#5}
{ \bool_set_false:c { l__xeCJK_#2_skip_bool } }
- \IfBooleanT #4
+ \bool_if:NT #4
{ \bool_set_true:c { l__xeCJK_#2_subtract_bool } }
- \IfNoValueF {#6}
+ \tl_if_novalue:nF {#6}
{ \keys_set:nn { xeCJK / options / #1 } {#6} }
\bool_set_eq:Nc \l__xeCJK_ulem_skip_bool { l__xeCJK_#2_skip_bool }
\bool_set_eq:Nc \l__xeCJK_ulem_hidden_bool { l__xeCJK_#2_hidden_bool }
@@ -738,9 +781,9 @@
{
\bool_lazy_or:nnT {#1} {#3}
{ \bool_set_false:N \l__xeCJK_ulem_skip_bool }
- \IfBooleanT #2
+ \bool_if:NT #2
{ \bool_set_true:N \l__xeCJK_ulem_subtract_bool }
- \IfNoValueF {#4}
+ \tl_if_novalue:nF {#4}
{ \keys_set:nn { xeCJK / options / ulem } {#4} }
}
\cs_new_protected_nopar:Npn \xeCJK_fntef_initial:n
@@ -793,12 +836,6 @@
\color_group_end:
}
}
-\cs_new_protected_nopar:Npn \xeCJK_leave_vmode:
- {
- \if_mode_vertical:
- \exp_after:wN \tex_indent:D
- \fi:
- }
\keys_define:nn { xeCJK / options }
{
underdot / symbol .tl_set:N = \l__xeCJK_udot_symbol_tl ,
@@ -930,7 +967,7 @@
}
\cs_new_protected:Npn \__xeCJK_under_symbol_auxii:nnnnnn #1#2#3#4#5#6
{
- \xeCJK_leave_vmode:
+ \mode_leave_vertical:
\group_begin:
\xeCJK_under_symbol_initial:nnnnn {#1} {#2} {#3} {#4} {#5}
\__xeCJK_under_symbol_text_format:c { l__xeCJK_#2_text_format_tl }
@@ -941,7 +978,7 @@
}
\cs_new_protected:Npn \xeCJK_under_symbol_initial:nnnnn #1#2#3#4#5
{
- \IfNoValueF {#3}
+ \tl_if_novalue:nF {#3}
{ \keys_set:nn { xeCJK / options / #1 } {#3} }
\xeCJK_fntef_sbox:n {#5}
\bool_if:NTF \l__xeCJK_fntef_bool
@@ -1016,7 +1053,7 @@
}
\NewEnviron { CJKfilltwosides* } [ 2 ] [ c ]
{
- \xeCJK_leave_vmode:
+ \mode_leave_vertical:
\cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
\tl_set:Nn \arraystretch { 1 }
\cs_if_free:NF \extrarowheight
@@ -1050,8 +1087,7 @@
}
\cs_new_protected_nopar:Npn \xeCJK_fntef_hfilll:
{ \skip_horizontal:N \c__xeCJK_filll_skip }
-\skip_new:N \c__xeCJK_filll_skip
-\skip_set:Nn \c__xeCJK_filll_skip { \c_zero_dim plus 1 filll }
+\skip_const:Nn \c__xeCJK_filll_skip { \c_zero_dim plus 1 filll }
%%
%% This package consists of the files xeCJK.dtx,
%% full-stop.map,
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
index a552e9929c0..b23c5ffde29 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `xunicode')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2017 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2017 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{addon file for xunicode}
\ProvidesExplPackage{xunicode-addon}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
\bool_lazy_or:nnF
{ \sys_if_engine_xetex_p: }
{ \sys_if_engine_luatex_p: }
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def
index 2baaceb1e05..3cfa45114c5 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `xunextra')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2017 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2017 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -27,10 +27,10 @@
%%
%% ----------------------------------------------------------------------
%%
-\GetIdInfo$Id: xeCJK.dtx 5a18688 2017-11-22 19:12:51 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 54327e6 2018-01-28 19:10:14 +0800 Qing Lee <sobenlee@gmail.com> $
{extra definition for xunicode}
\ProvidesExplFile{xunicode-extra.def}
- {\ExplFileDate}{3.5.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.6.0}{\ExplFileDescription}
\DeclareUTFComposite\textsuperscript
\DeclareUTFComposite\textsubscript
\DeclareUTFEncodedAccent\textsbleftarrow{"20EE}{"20FF}