diff options
author | Norbert Preining <preining@logic.at> | 2012-10-17 11:33:19 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2012-10-17 11:33:19 +0000 |
commit | 61bbf7315791604a62f8d29b532b96f9b89383c8 (patch) | |
tree | 7a63ae947605e78e053829d5d4e7bd1d3902317d /Master/texmf-dist/source/xelatex/xecjk | |
parent | ae7944d2e8e313e33e65a23696b241bd4ae087b3 (diff) |
xecjk update (17Oct)
git-svn-id: svn://tug.org/texlive/trunk@27996 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xecjk')
-rw-r--r-- | Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx | 2251 | ||||
-rw-r--r-- | Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins | 6 |
2 files changed, 1153 insertions, 1104 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx index 65241928dad..92a173eabfa 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx @@ -65,12 +65,12 @@ CJK scripts fonts (TrueType or OpenType). %</internal> %<*batchfile> -\input docstrip.tex +\input l3docstrip.tex \keepsilent \askforoverwritefalse \preamble -$Id: xeCJK.dtx 356 2012-09-03 02:18:08Z sobenlee $ +$Id: xeCJK.dtx 357 2012-10-16 18:42:20Z sobenlee $ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ ----------------------------------------------------------------- Author: @@ -134,7 +134,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %<*driver|package> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 356 2012-09-03 02:18:08Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 357 2012-10-16 18:42:20Z sobenlee $ {package for typesetting CJK scripts with XeLaTeX} %<*driver> \ProvidesExplFile @@ -142,7 +142,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %</driver> %<package>\ProvidesExplPackage %<package> {\ExplFileName} - {\ExplFileDate}{3.0.8}{\ExplFileDescription} + {\ExplFileDate}{3.0.9}{\ExplFileDescription} %<*driver> \ExplSyntaxOff %</driver> @@ -200,7 +200,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %</driver> % \fi % -% \CheckSum{3061} +% \CheckSum{3074} % \DoNotIndex{\T,\F,\C,\J,\K,\O,\U,\Z,\E,\R,\M,\A,\Y,\R,\;,\t,\c,\:,\\,\@} % \GetFileInfo{\jobname.dtx} % @@ -225,8 +225,8 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{enumerate} % % \pkg{xeCJK} 使用了 \XeTeX 的一些最新特性,需要 \XeTeX{} |0.9995.0 [2009/06/29]| 以 -% 后的版本。\pkg{xeCJK} 的依赖 \LaTeX~3 项目的 \pkg{expl3},\pkg{xparse} 和 -% \pkg{l3keys2e} 宏包,并依赖 \pkg{fontspec}^^A +% 后的版本。\pkg{xeCJK} 依赖 \LaTeX~3 项目的 \pkg{expl3},\pkg{xparse} 和 +% \pkg{l3keys2e} 宏包。\pkg{xeCJK} 还通过 \pkg{fontspec}^^A % \footnote{\url{http://mirrors.ctan.org/macros/latex/contrib/fontspec/}} % 宏包来调用系统字体。个别兼容性功能需要 \pkg{CJK} 宏包的支持。 % @@ -909,6 +909,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %<*package> % \end{macrocode} % +% \begin{macrocode} +%<@@=xeCJK> +% \end{macrocode} +% % \subsection{运行环境检查} % % \pkg{xeCJK} 必须使用 \XeTeX 引擎的支持。 @@ -933,7 +937,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ using~your~TeX~package~manager~or~from~CTAN.\\ Loading~xeCJK~will~abort! } -\@ifpackagelater { expl3 } { 2012/07/16 } { } +\@ifpackagelater { expl3 } { 2012/09/10 } { } { \msg_critical:nn { xeCJK } { l3-too-old } } % \end{macrocode} % @@ -946,76 +950,76 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \msg_new:nnn { xeCJK } { XeTeX-too-old } { - \token_to_str:N \XeTeXglyphbounds\c_space_tl is~not~defined.\\\\ + \token_to_str:N \XeTeXglyphbounds \ is~not~defined.\\\\ You~have~to~update~XeTeX~to~the~version~0.9995.0~or~later. } \cs_if_free:NT \XeTeXglyphbounds { \msg_error:nn { xeCJK } { XeTeX-too-old } - \AtEndOfPackage { \xeCJK_AfterPreamble:n { \punctstyle { plain } } } + \AtEndOfPackage { \@@_AfterPreamble:n { \punctstyle { plain } } } } % \end{macrocode} % % \subsection{内部工具} % % 分配临时变量。 -% \begin{macro}[internal,var]{\l_xeCJK_tmpa_int,\l_xeCJK_tmpb_int,\l_xeCJK_tmpc_int} +% \begin{macro}[internal,var]{\l_@@_tmpa_int,\l_@@_tmpb_int,\l_@@_tmpc_int} % \begin{macrocode} -\int_new:N \l_xeCJK_tmpa_int -\int_new:N \l_xeCJK_tmpb_int -\int_new:N \l_xeCJK_tmpc_int +\int_new:N \l_@@_tmpa_int +\int_new:N \l_@@_tmpb_int +\int_new:N \l_@@_tmpc_int % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,var]{\l_xeCJK_tmpa_dim,\l_xeCJK_tmpb_dim,\l_xeCJK_tmpc_dim} +% \begin{macro}[internal,var]{\l_@@_tmpa_dim,\l_@@_tmpb_dim,\l_@@_tmpc_dim} % \begin{macrocode} -\dim_new:N \l_xeCJK_tmpa_dim -\dim_new:N \l_xeCJK_tmpb_dim -\dim_new:N \l_xeCJK_tmpc_dim +\dim_new:N \l_@@_tmpa_dim +\dim_new:N \l_@@_tmpb_dim +\dim_new:N \l_@@_tmpc_dim % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,var]{\l_xeCJK_tmpa_tl,\l_xeCJK_tmpb_tl} +% \begin{macro}[internal,var]{\l_@@_tmpa_tl,\l_@@_tmpb_tl} % \begin{macrocode} -\tl_new:N \l_xeCJK_tmpa_tl -\tl_new:N \l_xeCJK_tmpb_tl +\tl_new:N \l_@@_tmpa_tl +\tl_new:N \l_@@_tmpb_tl % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,var]{\l_xeCJK_tmpa_clist,\l_xeCJK_tmpb_clist,\l_xeCJK_tmpc_clist} +% \begin{macro}[internal,var]{\l_@@_tmpa_clist,\l_@@_tmpb_clist,\l_@@_tmpc_clist} % \begin{macrocode} -\clist_new:N \l_xeCJK_tmpa_clist -\clist_new:N \l_xeCJK_tmpb_clist -\clist_new:N \l_xeCJK_tmpc_clist +\clist_new:N \l_@@_tmpa_clist +\clist_new:N \l_@@_tmpb_clist +\clist_new:N \l_@@_tmpc_clist % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_no_break:} +% \begin{macro}[internal]{\@@_no_break:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_no_break: { \tex_penalty:D \c_ten_thousand } +\cs_new_protected_nopar:Npn \@@_no_break: { \tex_penalty:D \c_ten_thousand } % \end{macrocode} % \end{macro} % % \begin{macro}[internal] -% {\xeCJK_AtEndPreamble:n,\xeCJK_AfterPreamble:n,\xeCJK_AfterEndPreamble:n} +% {\@@_AtEndPreamble:n,\@@_AfterPreamble:n,\@@_AfterEndPreamble:n} % 在 |\document| 前后加上各种钩子。 % \begin{macrocode} -\tl_new:N \g_xeCJK_at_end_preamble_hook -\tl_new:N \g_xeCJK_after_preamble_hook -\tl_new:N \g_xeCJK_after_end_preamble_hook -\cs_new_protected:Npn \xeCJK_AtEndPreamble:n #1 - { \tl_gput_right:Nn \g_xeCJK_at_end_preamble_hook {#1} } -\cs_new_protected:Npn \xeCJK_AfterPreamble:n #1 - { \tl_gput_right:Nn \g_xeCJK_after_preamble_hook {#1} } -\cs_new_protected:Npn \xeCJK_AfterEndPreamble:n #1 - { \tl_gput_right:Nn \g_xeCJK_after_end_preamble_hook {#1} } -\AtBeginDocument { \g_xeCJK_after_preamble_hook } -\tl_put_left:Nn \document { \group_end: \g_xeCJK_at_end_preamble_hook \group_begin: } -\tl_put_right:Nn \document { \g_xeCJK_after_end_preamble_hook \tex_ignorespaces:D } +\tl_new:N \g_@@_at_end_preamble_hook_tl +\tl_new:N \g_@@_after_preamble_hook_tl +\tl_new:N \g_@@_after_end_preamble_hook_tl +\cs_new_protected:Npn \@@_AtEndPreamble:n #1 + { \tl_gput_right:Nn \g_@@_at_end_preamble_hook_tl {#1} } +\cs_new_protected:Npn \@@_AfterPreamble:n #1 + { \tl_gput_right:Nn \g_@@_after_preamble_hook_tl {#1} } +\cs_new_protected:Npn \@@_AfterEndPreamble:n #1 + { \tl_gput_right:Nn \g_@@_after_end_preamble_hook_tl {#1} } +\AtBeginDocument { \g_@@_after_preamble_hook_tl } +\tl_put_left:Nn \document { \group_end: \g_@@_at_end_preamble_hook_tl \group_begin: } +\tl_put_right:Nn \document { \g_@@_after_end_preamble_hook_tl \tex_ignorespaces:D } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_outer_macro:c} +% \begin{macro}[pTF,internal]{\@@_if_outer_macro:c} % 判断是否是 |\outer| 宏,输入的是控制序列的名字。 % \begin{macrocode} \group_begin: @@ -1028,67 +1032,67 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \tl_to_lowercase:n { \group_end: - \prg_new_conditional:Npnn \xeCJK_if_outer_macro:c #1 { p , T , F , TF } + \prg_new_conditional:Npnn \@@_if_outer_macro:c #1 { p , T , F , TF } { - \exp_last_unbraced:Nf \xeCJK_if_outer_macro_aux:w + \exp_last_unbraced:Nf \@@_if_outer_macro_aux:w { \cs_meaning:c {#1} } OUZER ~ MAYRO ; \q_stop } - \cs_new_nopar:Npn \xeCJK_if_outer_macro_aux:w #1 OUZER ~ MAYRO ; #2 \q_stop + \cs_new_nopar:Npn \@@_if_outer_macro_aux:w #1 OUZER ~ MAYRO ; #2 \q_stop { - \if_cs_exist:w c_xeCJK_prefix_ #1 _aux_tl \cs_end: + \if_cs_exist:w c_@@_prefix_ #1 _aux_tl \cs_end: \prg_return_true: \else: \prg_return_false: \fi: } - \tl_new:c { c_xeCJK_prefix_/_aux_tl } - \tl_new:c { c_xeCJK_prefix_/long/_aux_tl } - \tl_new:c { c_xeCJK_prefix_/protected/_aux_tl } - \tl_new:c { c_xeCJK_prefix_/protected/long/_aux_tl } + \tl_new:c { c_@@_prefix_/_aux_tl } + \tl_new:c { c_@@_prefix_/long/_aux_tl } + \tl_new:c { c_@@_prefix_/protected/_aux_tl } + \tl_new:c { c_@@_prefix_/protected/long/_aux_tl } } % \end{macrocode} % \end{macro} % -% \begin{macro}[TF,internal]{\xeCJK_peek_catcode_ignore_spaces:N} -% 对 \pkg{l3token} 打的补丁,使 \cs{xeCJK_peek_catcode_ignore_spaces:NTF} 可 +% \begin{macro}[TF,internal]{\@@_peek_catcode_ignore_spaces:N} +% 对 \pkg{l3token} 打的补丁,使 \cs{__xeCJK_peek_catcode_ignore_spaces:NTF} 等可 % 用于 \cs{outer} 宏。 % \begin{macrocode} -\token_new:Nn \l_xeCJK_peek_search_token { ? } -\cs_new_protected:Npn \xeCJK_peek_catcode_ignore_spaces:NTF #1#2#3 +\token_new:Nn \l_@@_peek_search_token { ? } +\cs_new_protected:Npn \@@_peek_catcode_ignore_spaces:NTF #1#2#3 { - \cs_set_eq:NN \l_xeCJK_peek_search_token #1 - \tl_set:Nn \xeCJK_peek_true:w { \group_align_safe_end: #2 } - \tl_set:Nn \xeCJK_peek_false:w { \group_align_safe_end: #3 } + \cs_set_eq:NN \l_@@_peek_search_token #1 \prg_do_nothing: + \tl_set:Nn \@@_peek_true:w { \group_align_safe_end: #2 } + \tl_set:Nn \@@_peek_false:w { \group_align_safe_end: #3 } \group_align_safe_begin: - \peek_after:Nw \xeCJK_peek_ignore_spaces_execute_branches: + \peek_after:Nw \@@_peek_ignore_spaces_execute_branches: } -\cs_new_protected:Npn \xeCJK_peek_catcode_ignore_spaces:NT #1#2 - { \xeCJK_peek_catcode_ignore_spaces:NTF #1 {#2} { } } -\cs_new_protected:Npn \xeCJK_peek_catcode_ignore_spaces:NF #1#2 - { \xeCJK_peek_catcode_ignore_spaces:NTF #1 { } {#2} } -\cs_new_nopar:Npn \xeCJK_peek_ignore_spaces_execute_branches: +\cs_new_protected:Npn \@@_peek_catcode_ignore_spaces:NT #1#2 + { \@@_peek_catcode_ignore_spaces:NTF #1 {#2} { } } +\cs_new_protected:Npn \@@_peek_catcode_ignore_spaces:NF #1#2 + { \@@_peek_catcode_ignore_spaces:NTF #1 { } {#2} } +\cs_new_nopar:Npn \@@_peek_ignore_spaces_execute_branches: { \if_meaning:w \l_peek_token \c_space_token - \tex_afterassignment:D \xeCJK_peek_ignore_spaces_execute_branches_aux: - \exp_after:wN \cs_set_eq:NN \exp_after:wN \xeCJK_peek_tmp:w + \tex_afterassignment:D \@@_peek_ignore_spaces_execute_branches_aux: + \exp_after:wN \cs_set_eq:NN \exp_after:wN \@@_peek_tmp:w \else: - \exp_after:wN \xeCJK_peek_execute_branches_catcode: + \exp_after:wN \@@_peek_execute_branches_catcode: \fi: } -\cs_new_protected_nopar:Npn \xeCJK_peek_ignore_spaces_execute_branches_aux: - { \peek_after:Nw \xeCJK_peek_ignore_spaces_execute_branches: } -\cs_new_nopar:Npn \xeCJK_peek_execute_branches_catcode: +\cs_new_protected_nopar:Npn \@@_peek_ignore_spaces_execute_branches_aux: + { \peek_after:Nw \@@_peek_ignore_spaces_execute_branches: } +\cs_new_nopar:Npn \@@_peek_execute_branches_catcode: { - \if_catcode:w \exp_not:N \l_peek_token \exp_not:N \l_xeCJK_peek_search_token - \exp_after:wN \xeCJK_peek_true:w + \if_catcode:w \exp_not:N \l_peek_token \exp_not:N \l_@@_peek_search_token + \exp_after:wN \@@_peek_true:w \else: - \exp_after:wN \xeCJK_peek_false:w + \exp_after:wN \@@_peek_false:w \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_blank_x:n} +% \begin{macro}[pTF,internal]{\@@_if_blank_x:n} % 判断是否为空或者仅含一个空格。 % \begin{macrocode} -\prg_new_conditional:Npnn \xeCJK_if_blank_x:n #1 { p , T , F , TF } +\prg_new_conditional:Npnn \@@_if_blank_x:n #1 { p , T , F , TF } { \if_int_compare:w \pdftex_strcmp:D { \c_empty_tl } {#1} = \c_zero \prg_return_true: @@ -1100,31 +1104,31 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_package_loaded:n} +% \begin{macro}[pTF,internal]{\@@_if_package_loaded:n} % 判断宏包是否载入,可用于文档中。 % \begin{macrocode} -\prg_new_conditional:Npnn \xeCJK_if_package_loaded:n #1 { p , T , F , TF } +\prg_new_conditional:Npnn \@@_if_package_loaded:n #1 { p , T , F , TF } { - \tl_if_exist:cTF { ver@ #1 . \c_xeCJK_pkg_extension_tl } + \tl_if_exist:cTF { ver@ #1 . \c_@@_pkg_extension_tl } { \prg_return_true: } { \prg_return_false: } } -\tl_const:Nx \c_xeCJK_pkg_extension_tl { \@pkgextension } +\tl_const:Nx \c_@@_pkg_extension_tl { \@pkgextension } % \end{macrocode} % \end{macro} % % \begin{macro}[internal] -% {\xeCJK_msg_new:nn ,\xeCJK_error:n,\xeCJK_error:nx, -% \xeCJK_warning:nx,\xeCJK_info:nx,\xeCJK_info:nxx} +% {\@@_msg_new:nn ,\@@_error:n,\@@_error:nx, +% \@@_warning:nx,\@@_info:nx,\@@_info:nxx} % 各种信息函数的缩略形式。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_msg_new:nn { \msg_new:nnn { xeCJK } } -\cs_new_nopar:Npn \xeCJK_error:n { \msg_error:nn { xeCJK } } -\cs_new_nopar:Npn \xeCJK_error:nx { \msg_error:nnx { xeCJK } } -\cs_new_nopar:Npn \xeCJK_warning:n { \msg_warning:nn { xeCJK } } -\cs_new_nopar:Npn \xeCJK_warning:nx { \msg_warning:nnx { xeCJK } } -\cs_new_nopar:Npn \xeCJK_warning:nxx { \msg_warning:nnxx { xeCJK } } -\cs_new_nopar:Npn \xeCJK_info:nx { \msg_info:nnx { xeCJK } } -\cs_new_nopar:Npn \xeCJK_info:nxx { \msg_info:nnxx { xeCJK } } +\cs_new_nopar:Npn \@@_msg_new:nn { \msg_new:nnn { xeCJK } } +\cs_new_nopar:Npn \@@_error:n { \msg_error:nn { xeCJK } } +\cs_new_nopar:Npn \@@_error:nx { \msg_error:nnx { xeCJK } } +\cs_new_nopar:Npn \@@_warning:n { \msg_warning:nn { xeCJK } } +\cs_new_nopar:Npn \@@_warning:nx { \msg_warning:nnx { xeCJK } } +\cs_new_nopar:Npn \@@_warning:nxx { \msg_warning:nnxx { xeCJK } } +\cs_new_nopar:Npn \@@_info:nx { \msg_info:nnx { xeCJK } } +\cs_new_nopar:Npn \@@_info:nxx { \msg_info:nnxx { xeCJK } } % \end{macrocode} % \end{macro} % @@ -1176,93 +1180,93 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{center} % % \begin{macro}[internal,var] -% { \xeCJK_Default_class, \xeCJK_CJK_class, \xeCJK_FullLeft_class, -% \xeCJK_FullRight_class, \xeCJK_Boundary_class } +% { \c_@@_Default_class_int, \c_@@_CJK_class_int, \c_@@_FullLeft_class_int, +% \c_@@_FullRight_class_int, \c_@@_Boundary_class_int } % 这五类是 \XeTeX\ 预定义的类别。 % \begin{macrocode} -\int_const:Nn \xeCJK_Default_class { 0 } -\int_const:Nn \xeCJK_CJK_class { 1 } -\int_const:Nn \xeCJK_FullLeft_class { 2 } -\int_const:Nn \xeCJK_FullRight_class { 3 } -\int_const:Nn \xeCJK_Boundary_class { 255 } +\int_const:Nn \c_@@_Default_class_int { 0 } +\int_const:Nn \c_@@_CJK_class_int { 1 } +\int_const:Nn \c_@@_FullLeft_class_int { 2 } +\int_const:Nn \c_@@_FullRight_class_int { 3 } +\int_const:Nn \c_@@_Boundary_class_int { 255 } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_new_class:n,\g_xeCJK_class_seq} +% \begin{macro}[internal]{\@@_new_class:n,\g_@@_class_seq} % 新建一个字符类别。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_new_class:n #1 +\cs_new_protected_nopar:Npn \@@_new_class:n #1 { - \exp_args:Nc \newXeTeXintercharclass { xeCJK_#1_class } - \clist_gclear_new:c { g_xeCJK_#1_range_clist } - \seq_gput_right:Nv \g_xeCJK_class_seq { xeCJK_#1_class } + \exp_args:Nc \newXeTeXintercharclass { c_@@_#1_class_int } + \clist_gclear_new:c { g_@@_#1_range_clist } + \seq_gput_right:Nv \g_@@_class_seq { c_@@_#1_class_int } } -\seq_new:N \g_xeCJK_class_seq +\seq_new:N \g_@@_class_seq % \end{macrocode} % \end{macro} % % \begin{macro}[internal,var] -% { \xeCJK_HalfLeft_class, \xeCJK_HalfRight_class, \xeCJK_NormalSpace_class } +% { \c_@@_HalfLeft_class_int, \c_@@_HalfRight_class_int, \c_@@_NormalSpace_class_int } % 新增西文半角左/右标点和前后原始间距的符号类。 % \begin{macrocode} -\xeCJK_new_class:n { HalfLeft } -\xeCJK_new_class:n { HalfRight } -\xeCJK_new_class:n { NormalSpace } +\@@_new_class:n { HalfLeft } +\@@_new_class:n { HalfRight } +\@@_new_class:n { NormalSpace } % \end{macrocode} % \end{macro} % % \begin{macro}[internal,var] -% {\g_xeCJK_base_class_clist,\g_xeCJK_CJK_class_clist,\g_xeCJK_CJK_class_prop} +% {\g_@@_base_class_clist,\g_@@_CJK_class_clist,\g_@@_CJK_class_prop} % \begin{macrocode} -\clist_set:Nn \g_xeCJK_base_class_clist +\clist_set:Nn \g_@@_base_class_clist { Default, CJK, FullLeft, FullRight, Boundary, HalfLeft, HalfRight, NormalSpace } -\clist_map_inline:Nn \g_xeCJK_base_class_clist - { \clist_gclear_new:c { g_xeCJK_#1_range_clist } } -\clist_new:N \g_xeCJK_CJK_class_clist -\prop_new:N \g_xeCJK_CJK_class_prop -\cs_new_protected_nopar:Npn \xeCJK_save_CJK_class:n #1 +\clist_map_inline:Nn \g_@@_base_class_clist + { \clist_gclear_new:c { g_@@_#1_range_clist } } +\clist_new:N \g_@@_CJK_class_clist +\prop_new:N \g_@@_CJK_class_prop +\cs_new_protected_nopar:Npn \@@_save_CJK_class:n #1 { - \clist_gput_right:Nx \g_xeCJK_CJK_class_clist {#1} - \prop_gput:Nvx \g_xeCJK_CJK_class_prop { xeCJK_#1_class } {#1} + \clist_gput_right:Nx \g_@@_CJK_class_clist {#1} + \prop_gput:Nvx \g_@@_CJK_class_prop { c_@@_#1_class_int } {#1} } \cs_generate_variant:Nn \prop_gput:Nnn { Nvx } -\clist_map_function:nN { CJK, FullLeft, FullRight } \xeCJK_save_CJK_class:n +\clist_map_function:nN { CJK, FullLeft, FullRight } \@@_save_CJK_class:n % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_class_num:n} +% \begin{macro}[internal]{\@@_class_num:n} % |#1| 为字符类别名称,用于取得字符类别对应的编号。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_class_num:n #1 { \tl_use:c { xeCJK_#1_class } } +\cs_new_nopar:Npn \@@_class_num:n #1 { \tl_use:c { c_@@_#1_class_int } } % \end{macrocode} % \end{macro} % % \begin{macro}{\xeCJKDeclareCharClass} -% \begin{macro}[aux]{\xeCJK_set_char_class_aux:Nn} +% \begin{macro}[aux]{\@@_set_char_class_aux:Nn} % 用于设置字符所属的类别,|#1| 为类别名称,|#2| 为字符的 |Unicode|,相邻字符用 % 半角逗号隔开,支持类似 |"1100 -> "11FF| 起止范围的使用方式。 % \begin{macrocode} \NewDocumentCommand \xeCJKDeclareCharClass { s > { \TrimSpaces } m m } { - \xeCJK_declare_char_class:nn {#2} {#3} + \@@_declare_char_class:nn {#2} {#3} \IfBooleanT {#1} { \xeCJKResetPunctClass } } -\cs_new_protected_nopar:Npn \xeCJK_declare_char_class:nn #1#2 +\cs_new_protected_nopar:Npn \@@_declare_char_class:nn #1#2 { - \clist_gput_right:cx { g_xeCJK_#1_range_clist } {#2} + \clist_gput_right:cx { g_@@_#1_range_clist } {#2} \clist_map_inline:xn {#2} { \str_if_eq_x:nnF {##1} { -> } { - \xeCJK_set_char_class_aux:Nn \xeCJK_set_char_class:nnn {##1} - { \xeCJK_class_num:n {#1} } + \@@_set_char_class_aux:Nn \@@_set_char_class:nnn {##1} + { \@@_class_num:n {#1} } } } } -\NewDocumentCommand \xeCJK_set_char_class_aux:Nn +\NewDocumentCommand \@@_set_char_class_aux:Nn { m > { \SplitArgument { 1 } { -> } } m } { #1 #2 } \cs_generate_variant:Nn \clist_map_inline:nn { x } % \end{macrocode} @@ -1274,31 +1278,50 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \xeCJKsetcharclass { s m m m } { - \xeCJK_set_char_class:nnn {#2} {#3} {#4} + \@@_set_char_class:nnn {#2} {#3} {#4} \IfBooleanF {#1} { \xeCJKResetPunctClass } } -\cs_new_protected_nopar:Npn \xeCJK_set_char_class:nnn #1#2#3 +\cs_new_protected_nopar:Npn \@@_set_char_class:nnn #1#2#3 + { + \@@_check_num_range:nnNN {#1} {#2} \l_@@_tmpa_int \l_@@_tmpb_int + \int_set:Nn \l_@@_tmpc_int {#3} + \prop_if_in:NVTF \g_@@_CJK_class_prop \l_@@_tmpc_int + { \cs_set_eq:NN \@@_set_char_catcode:n \char_set_catcode_other:n } + { \cs_set_eq:NN \@@_set_char_catcode:n \use_none:n } + \@@_int_until_do:nn { \l_@@_tmpa_int > \l_@@_tmpb_int } + { + \@@_set_char_catcode:n { \l_@@_tmpa_int } + \XeTeXcharclass \l_@@_tmpa_int = \l_@@_tmpc_int + \int_incr:N \l_@@_tmpa_int + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[internal]{\@@_int_until_do:nn} +% \begin{macro}[aux]{\@@_int_until_do_aux:wn} +% \begin{macrocode} +\cs_new_protected:Npn \@@_int_until_do:nn #1#2 + { + \@@_int_until_do_aux:wn \use_none:n + { \reverse_if:N \if_int_compare:w #1#2 } + } +\cs_new_protected:Npn \@@_int_until_do_aux:wn \use_none:n #1 { - \xeCJK_check_num_range:nnNN {#1} {#2} \l_xeCJK_tmpa_int \l_xeCJK_tmpb_int - \int_set:Nn \l_xeCJK_tmpc_int {#3} - \prop_if_in:NVTF \g_xeCJK_CJK_class_prop \l_xeCJK_tmpc_int - { \loop \char_set_catcode_other:n \l_xeCJK_tmpa_int } - { \loop } - \XeTeXcharclass \l_xeCJK_tmpa_int = \l_xeCJK_tmpc_int - \if_int_compare:w \l_xeCJK_tmpa_int < \l_xeCJK_tmpb_int - \int_incr:N \l_xeCJK_tmpa_int - \repeat + #1 \exp_after:wN \@@_int_until_do_aux:wn \fi: + \use_none:n {#1} } % \end{macrocode} % \end{macro} +% \end{macro} % -% \begin{macro}[internal]{\xeCJK_check_num_range:nnNN} +% \begin{macro}[internal]{\@@_check_num_range:nnNN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_num_range:nnNN #1#2#3#4 +\cs_new_protected_nopar:Npn \@@_check_num_range:nnNN #1#2#3#4 { - \bool_if:nTF { \xeCJK_if_blank_x_p:n {#1} || \xeCJK_if_blank_x_p:n {#2} } + \bool_if:nTF { \@@_if_blank_x_p:n {#1} || \@@_if_blank_x_p:n {#2} } { - \int_set:Nn #3 { \xeCJK_if_blank_x:nTF {#1} {#2} {#1} } + \int_set:Nn #3 { \@@_if_blank_x:nTF {#1} {#2} {#1} } \int_set_eq:NN #3 #4 } { @@ -1314,18 +1337,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \xeCJKResetPunctClass { } { - \xeCJK_declare_char_class:nn { HalfLeft } + \@@_declare_char_class:nn { HalfLeft } { "28 , "2D , "5B , "60 , "7B } - \xeCJK_declare_char_class:nn { HalfRight } + \@@_declare_char_class:nn { HalfRight } { "21 , "22 , "25 , "27 , "29 , "2C , "2E , "3A , "3B , "3F , "5D , "7D , } - \xeCJK_declare_char_class:nn { FullLeft } + \@@_declare_char_class:nn { FullLeft } { "2018 , "201C , "2116 , "3008 , "300A , "300C , "300E , "3010 , "3012 , "3014 , "3016 , "3018 , "301A , "301D , "3036 , "E76C , "FE59 , "FE5B , "FE5D , "FE5F , "FE60 , "FE69 , "FE6B , "FF03 , "FF04 , "FF08 , "FF20 , "FF3B , "FF5B , "FFE0 , "FFE1 , "FFE5 , "FFE6 , } - \xeCJK_declare_char_class:nn { FullRight } + \@@_declare_char_class:nn { FullRight } { "00B7 , "2019 , "201D , "2014 , "2025 , "2026 , "2030 , "2500 , "3001 , "3002 , "3005 , "3006 , "3009 , "300B , "300D , "300F , "3011 , "3015 , @@ -1344,7 +1367,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \hypertarget{CJKcharclass}{设置 CJK 文字的范围}。 % \begin{macrocode} -\xeCJK_declare_char_class:nn { CJK } +\@@_declare_char_class:nn { CJK } { % \end{macrocode} % \begin{itemize} @@ -1488,79 +1511,79 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \NewDocumentCommand \normalspacedchars { m } { \tl_map_inline:nn {#1} - { \XeTeXcharclass `##1 = \xeCJK_class_num:n { NormalSpace } } + { \XeTeXcharclass `##1 = \@@_class_num:n { NormalSpace } } } \normalspacedchars{/} % \end{macrocode} % \end{macro} % % \begin{macro}[internal] -% {\xeCJK_inter_class_toks:nnn,\xeCJK_inter_class_toks:nnc,\xeCJK_inter_class_toks:nnx} +% {\@@_inter_class_toks:nnn,\@@_inter_class_toks:nnc,\@@_inter_class_toks:nnx} % 在相邻类别之间插入内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_inter_class_toks:nnn #1#2#3 - { \XeTeXinterchartoks \xeCJK_class_num:n {#1} \xeCJK_class_num:n {#2} = {#3} } -\cs_generate_variant:Nn \xeCJK_inter_class_toks:nnn { nnc , nnx } +\cs_new_protected_nopar:Npn \@@_inter_class_toks:nnn #1#2#3 + { \XeTeXinterchartoks \@@_class_num:n {#1} \@@_class_num:n {#2} = {#3} } +\cs_generate_variant:Nn \@@_inter_class_toks:nnn { nnc , nnx } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_inter_class_toks:nn} +% \begin{macro}[internal]{\@@_get_inter_class_toks:nn} % 取出相邻类别之间的内容。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_get_inter_class_toks:nn #1#2 - { \tex_the:D \XeTeXinterchartoks \xeCJK_class_num:n {#1} \xeCJK_class_num:n {#2} } +\cs_new_nopar:Npn \@@_get_inter_class_toks:nn #1#2 + { \tex_the:D \XeTeXinterchartoks \@@_class_num:n {#1} \@@_class_num:n {#2} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_clear_inter_class_toks:nn} +% \begin{macro}[internal]{\@@_clear_inter_class_toks:nn} % 清除相邻类别之间的内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_clear_inter_class_toks:nn #1#2 - { \xeCJK_inter_class_toks:nnn {#1} {#2} { \c_empty_tl } } +\cs_new_protected_nopar:Npn \@@_clear_inter_class_toks:nn #1#2 + { \@@_inter_class_toks:nnn {#1} {#2} { \c_empty_tl } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_pre_inter_class_toks:nnn} +% \begin{macro}[internal]{\@@_pre_inter_class_toks:nnn} % 在相邻类别之间已有的内容前增加内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_pre_inter_class_toks:nnn #1#2#3 +\cs_new_protected_nopar:Npn \@@_pre_inter_class_toks:nnn #1#2#3 { - \xeCJK_inter_class_toks:nnx {#1} {#2} - { \exp_not:n {#3} \xeCJK_get_inter_class_toks:nn {#1} {#2} } + \@@_inter_class_toks:nnx {#1} {#2} + { \exp_not:n {#3} \@@_get_inter_class_toks:nn {#1} {#2} } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_app_inter_class_toks:nnn,\xeCJK_app_inter_class_toks:nnc} +% \begin{macro}[internal]{\@@_app_inter_class_toks:nnn,\@@_app_inter_class_toks:nnc} % 在相邻类别之间已有的内容后追加内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_app_inter_class_toks:nnn #1#2#3 +\cs_new_protected_nopar:Npn \@@_app_inter_class_toks:nnn #1#2#3 { - \xeCJK_inter_class_toks:nnx {#1} {#2} - { \xeCJK_get_inter_class_toks:nn {#1} {#2} \exp_not:n {#3} } + \@@_inter_class_toks:nnx {#1} {#2} + { \@@_get_inter_class_toks:nn {#1} {#2} \exp_not:n {#3} } } -\cs_generate_variant:Nn \xeCJK_app_inter_class_toks:nnn { nnc } +\cs_generate_variant:Nn \@@_app_inter_class_toks:nnn { nnc } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_copy_inter_class_toks:nnnn} +% \begin{macro}[internal]{\@@_copy_inter_class_toks:nnnn} % 将 |#3| 和 |#4| 之间的内容复制到 |#1| 和 |#2| 之间。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_copy_inter_class_toks:nnnn #1#2#3#4 +\cs_new_protected_nopar:Npn \@@_copy_inter_class_toks:nnnn #1#2#3#4 { - \xeCJK_inter_class_toks:nnx {#1} {#2} - { \xeCJK_get_inter_class_toks:nn {#3} {#4} } + \@@_inter_class_toks:nnx {#1} {#2} + { \@@_get_inter_class_toks:nn {#3} {#4} } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_clear_CJK_toks:} +% \begin{macro}[internal]{\@@_clear_CJK_toks:} % 清除边界与 CJK 文字、全角左右标点之间的内容。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_clear_CJK_toks: +\cs_new_protected_nopar:Npn \@@_clear_CJK_toks: { - \clist_map_inline:Nn \g_xeCJK_CJK_class_clist - { \xeCJK_clear_inter_class_toks:nn { Boundary } {##1} } + \clist_map_inline:Nn \g_@@_CJK_class_clist + { \@@_clear_inter_class_toks:nn { Boundary } {##1} } } % \end{macrocode} % \end{macro} @@ -1648,18 +1671,18 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \clist_map_inline:nn { CJK, FullLeft, FullRight } { - \xeCJK_inter_class_toks:nnn {#1} {##1} + \@@_inter_class_toks:nnn {#1} {##1} { \c_group_begin_token \xeCJK_select_font: - \xeCJK_clear_inter_class_toks:nn {#1} {##1} - \xeCJK_clear_CJK_toks: + \@@_clear_inter_class_toks:nn {#1} {##1} + \@@_clear_CJK_toks: } - \xeCJK_inter_class_toks:nnn {##1} {#1} { \c_group_end_token } + \@@_inter_class_toks:nnn {##1} {#1} { \c_group_end_token } } - \xeCJK_app_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } + \@@_app_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } \clist_map_inline:nn { FullLeft, FullRight } - { \xeCJK_app_inter_class_toks:nnc {#1} {##1} { xeCJK_CJK_and_##1:N } } + { \@@_app_inter_class_toks:nnc {#1} {##1} { @@_CJK_and_##1:N } } } % \end{macrocode} % @@ -1667,27 +1690,27 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \clist_map_inline:nn { Default, HalfLeft, NormalSpace } { - \xeCJK_inter_class_toks:nnn { Boundary } {#1} + \@@_inter_class_toks:nnn { Boundary } {#1} { \bool_if:nTF { - \l_xeCJK_xecglue_bool && + \l_@@_xecglue_bool && \int_compare_p:nNn \etex_lastnodetype:D = \c_eleven && - \skip_if_eq_p:nn \tex_lastskip:D \l_xeCJK_space_glue_tl + \skip_if_eq_p:nn \tex_lastskip:D \l_@@_space_glue_tl } { \tex_unskip:D \bool_if:nTF - { \xeCJK_if_last_node_p:n { CJK } || \xeCJK_if_last_node_p:n { CJK_space } } + { \@@_if_last_node_p:n { CJK } || \@@_if_last_node_p:n { CJK_space } } { \CJKecglue } { \c_space_token } } { - \xeCJK_if_last_node:nTF { CJK } { \CJKecglue } - { \xeCJK_if_last_node:nT { CJK_space } { \xeCJK_space_or_xecglue: } } + \@@_if_last_node:nTF { CJK } { \CJKecglue } + { \@@_if_last_node:nT { CJK_space } { \@@_space_or_xecglue: } } } } \str_if_eq_x:nnF {#1} { NormalSpace } - { \xeCJK_app_inter_class_toks:nnn { CJK } {#1} { \CJKecglue } } + { \@@_app_inter_class_toks:nnn { CJK } {#1} { \CJKecglue } } } % \end{macrocode} % @@ -1695,77 +1718,77 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \clist_map_inline:nn { Default, HalfRight, NormalSpace } { - \xeCJK_inter_class_toks:nnn {#1} { Boundary } + \@@_inter_class_toks:nnn {#1} { Boundary } { \peek_catcode:NTF \c_space_token - { { \xeCJK_make_node:n { default_space } } } - { { \xeCJK_make_node:n { default } } } + { { \@@_make_node:n { default_space } } } + { { \@@_make_node:n { default } } } } \str_if_eq_x:nnF {#1} { NormalSpace } - { \xeCJK_pre_inter_class_toks:nnn {#1} { CJK } { \CJKecglue } } + { \@@_pre_inter_class_toks:nnn {#1} { CJK } { \CJKecglue } } } % \end{macrocode} % % \hypertarget{bound-cjk}{} % \begin{macrocode} -\xeCJK_inter_class_toks:nnn { Boundary } { CJK } { \xeCJK_Boundary_and_CJK: } +\@@_inter_class_toks:nnn { Boundary } { CJK } { \@@_Boundary_and_CJK: } % \end{macrocode} % -% \begin{macro}[internal]{\xeCJK_Boundary_and_CJK:,\xeCJK_check_for_glue:} +% \begin{macro}[internal]{\@@_Boundary_and_CJK:,\@@_check_for_glue:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_Boundary_and_CJK: +\cs_new_protected_nopar:Npn \@@_Boundary_and_CJK: { - { \xeCJK_check_for_glue: } + { \@@_check_for_glue: } \c_group_begin_token - \xeCJK_clear_CJK_toks: + \@@_clear_CJK_toks: \xeCJK_select_font: \CJKsymbol } -\cs_new_protected_nopar:Npn \xeCJK_check_for_glue: +\cs_new_protected_nopar:Npn \@@_check_for_glue: { \bool_if:nTF - { \xeCJK_if_last_node_p:n { CJK } || \xeCJK_if_last_node_p:n { CJK_space } } + { \@@_if_last_node_p:n { CJK } || \@@_if_last_node_p:n { CJK_space } } { \CJKglue } { \bool_if:nTF { - \xeCJK_if_last_node_p:n { default } || + \@@_if_last_node_p:n { default } || \int_compare_p:nNn \etex_lastnodetype:D = \c_ten || - \xeCJK_if_last_node_p:n { default_itcorr } + \@@_if_last_node_p:n { default_itcorr } } { \CJKecglue } { \bool_if:nT { - \l_xeCJK_xecglue_bool && + \l_@@_xecglue_bool && \int_compare_p:nNn \etex_lastnodetype:D = \c_eleven && - ( \skip_if_eq_p:nn \tex_lastskip:D \l_xeCJK_space_glue_tl || - \dim_compare_p:nNn \tex_lastskip:D = \l_xeCJK_ecglue_dim ) + ( \skip_if_eq_p:nn \tex_lastskip:D \l_@@_space_glue_tl || + \dim_compare_p:nNn \tex_lastskip:D = \l_@@_ecglue_dim ) } { \tex_unskip:D \bool_if:nTF { - \xeCJK_if_last_node_p:n { default_space } || + \@@_if_last_node_p:n { default_space } || \int_compare_p:nNn \etex_lastnodetype:D = \c_ten || - \xeCJK_if_last_node_p:n { default } || - \xeCJK_if_last_node_p:n { default_itcorr } + \@@_if_last_node_p:n { default } || + \@@_if_last_node_p:n { default_itcorr } } { \CJKecglue } { \bool_if:nTF { - \xeCJK_if_last_node_p:n { CJK } || - \xeCJK_if_last_node_p:n { CJK_space } + \@@_if_last_node_p:n { CJK } || + \@@_if_last_node_p:n { CJK_space } } - { \bool_if:NTF \l_xeCJK_space_bool \c_space_token \CJKglue } + { \bool_if:NTF \l_@@_space_bool \c_space_token \CJKglue } { \c_space_token } } } } } } -\tl_set:Nn \l_xeCJK_space_glue_tl +\tl_set:Nn \l_@@_space_glue_tl { \tex_fontdimen:D \c_two \tex_font:D \@plus \tex_fontdimen:D \c_three \tex_font:D @@ -1776,22 +1799,22 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \hypertarget{cjk-bound}{} % \begin{macrocode} -\xeCJK_inter_class_toks:nnn { CJK } { Boundary } +\@@_inter_class_toks:nnn { CJK } { Boundary } { \c_group_end_token - { \xeCJK_make_node:n { CJK } } - \xeCJK_ignorespaces: + { \@@_make_node:n { CJK } } + \@@_ignorespaces: } % \end{macrocode} % % \hypertarget{cjk-cjk}{} % \begin{macrocode} -\xeCJK_inter_class_toks:nnn { CJK } { CJK } { \xeCJK_CJK_and_CJK:N } +\@@_inter_class_toks:nnn { CJK } { CJK } { \@@_CJK_and_CJK:N } % \end{macrocode} % -% \begin{macro}[internal]{\xeCJK_CJK_and_CJK:N} +% \begin{macro}[internal]{\@@_CJK_and_CJK:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_CJK:N #1 { \CJKglue \CJKsymbol {#1} } +\cs_new_protected_nopar:Npn \@@_CJK_and_CJK:N #1 { \CJKglue \CJKsymbol {#1} } % \end{macrocode} % \end{macro} % @@ -1799,26 +1822,26 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \clist_map_inline:nn { FullLeft, FullRight } { - \xeCJK_inter_class_toks:nnn { Boundary } {#1} + \@@_inter_class_toks:nnn { Boundary } {#1} { \c_group_begin_token - \xeCJK_clear_CJK_toks: + \@@_clear_CJK_toks: \xeCJK_select_font: - \use:c { xeCJK_CJK_and_#1:N } + \use:c { @@_CJK_and_#1:N } } - \xeCJK_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } - \xeCJK_inter_class_toks:nnn {#1} { Boundary } { \c_group_end_token \tex_ignorespaces:D } + \@@_inter_class_toks:nnn {#1} { CJK } { \CJKsymbol } + \@@_inter_class_toks:nnn {#1} { Boundary } { \c_group_end_token \tex_ignorespaces:D } } % \end{macrocode} % % \begin{macrocode} -\clist_map_inline:Nn \g_xeCJK_base_class_clist +\clist_map_inline:Nn \g_@@_base_class_clist { \bool_if:nF { \str_if_eq_x_p:nn {#1} { FullLeft } || \str_if_eq_x_p:nn {#1} { FullRight } } { - \xeCJK_pre_inter_class_toks:nnn { FullLeft } {#1} { \xeCJK_no_break: } - \xeCJK_pre_inter_class_toks:nnn { FullRight } {#1} { \xeCJK_after_FullRight: } + \@@_pre_inter_class_toks:nnn { FullLeft } {#1} { \@@_no_break: } + \@@_pre_inter_class_toks:nnn { FullRight } {#1} { \@@_after_FullRight: } } } % \end{macrocode} @@ -1828,43 +1851,43 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \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 } } + { \@@_inter_class_toks:nnc {#1} {##1} { @@_#1_and_##1:N } } } % \end{macrocode} % -% \begin{macro}[internal]{\xeCJK_punct_rule:n} +% \begin{macro}[internal]{\@@_punct_rule:n} % 用于抹去标点符号的左/右空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_rule:n #1 +\cs_new_protected_nopar:Npn \@@_punct_rule:n #1 { \tex_vrule:D - \@width \dim_eval:c { \l_xeCJK_punct_coor_tl/rule/#1 } + \@width \dim_eval:c { \l_@@_punct_coor_tl/rule/#1 } \@depth \c_zero_dim \@height \c_zero_dim \scan_stop: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_punct_glue:n} +% \begin{macro}[internal]{\@@_punct_glue:n} % 根据所选的标点处理方式在标点符号左/右增加的空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_glue:n #1 +\cs_new_protected_nopar:Npn \@@_punct_glue:n #1 { \skip_horizontal:n { - \dim_eval:c { \l_xeCJK_punct_coor_tl/glue/#1 } - \@plus \dim_eval:n { ( \tl_use:c { \l_xeCJK_punct_coor_tl/glue/#1 } ) /4 } - \@minus \dim_eval:n { ( \tl_use:c { \l_xeCJK_punct_coor_tl/glue/#1 } ) /2 } + \dim_eval:c { \l_@@_punct_coor_tl/glue/#1 } + \@plus \dim_eval:n { ( \tl_use:c { \l_@@_punct_coor_tl/glue/#1 } ) /4 } + \@minus \dim_eval:n { ( \tl_use:c { \l_@@_punct_coor_tl/glue/#1 } ) /2 } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_punct_kern:n} +% \begin{macro}[internal]{\@@_punct_kern:n} % 相邻两个标点之间的间距。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_punct_kern:n #1 - { \tex_kern:D \dim_eval:c { \l_xeCJK_punct_coor_tl/kern/#1 } } +\cs_new_protected_nopar:Npn \@@_punct_kern:n #1 + { \tex_kern:D \dim_eval:c { \l_@@_punct_coor_tl/kern/#1 } } % \end{macrocode} % \end{macro} % @@ -1874,151 +1897,151 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_before_FullLeft:N} +% \begin{macro}[internal]{\@@_before_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_before_FullLeft:N #1 +\cs_new_protected_nopar:Npn \@@_before_FullLeft:N #1 { - \tl_set:Nx \l_xeCJK_lastpunct_tl {#1} - \xeCJK_punct_rule:n { l/#1 } + \tl_set:Nx \l_@@_lastpunct_tl {#1} + \@@_punct_rule:n { l/#1 } \CJKpunctsymbol {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_after_FullRight:} +% \begin{macro}[internal]{\@@_after_FullRight:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_after_FullRight: +\cs_new_protected_nopar:Npn \@@_after_FullRight: { - \xeCJK_get_punct_bounds:nV { r } \l_xeCJK_lastpunct_tl - \xeCJK_punct_rule:n { r/\l_xeCJK_lastpunct_tl } - \xeCJK_punct_glue:n { r/\l_xeCJK_lastpunct_tl } + \@@_get_punct_bounds:nV { r } \l_@@_lastpunct_tl + \@@_punct_rule:n { r/\l_@@_lastpunct_tl } + \@@_punct_glue:n { r/\l_@@_lastpunct_tl } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_CJK_and_FullLeft:N} +% \begin{macro}[internal]{\@@_CJK_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullLeft:N #1 +\cs_new_protected_nopar:Npn \@@_CJK_and_FullLeft:N #1 { - \xeCJK_get_punct_bounds:nN { l } {#1} + \@@_get_punct_bounds:nN { l } {#1} \int_compare:nNnF \etex_lastnodetype:D = \c_one - { \xeCJK_punct_glue:n { l/#1 } } - \xeCJK_before_FullLeft:N {#1} - \xeCJK_punct_if_middle:NT {#1} + { \@@_punct_glue:n { l/#1 } } + \@@_before_FullLeft:N {#1} + \@@_punct_if_middle:NT {#1} { - \xeCJK_punct_rule:n { m/#1 } - \xeCJK_punct_glue:n { l/#1 } + \@@_punct_rule:n { m/#1 } + \@@_punct_glue:n { l/#1 } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_CJK_and_FullRight:N} +% \begin{macro}[internal]{\@@_CJK_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_CJK_and_FullRight:N #1 +\cs_new_protected_nopar:Npn \@@_CJK_and_FullRight:N #1 { - \xeCJK_get_punct_bounds:nN { r } {#1} - \xeCJK_punct_if_long:NTF {#1} \CJKglue + \@@_get_punct_bounds:nN { r } {#1} + \@@_punct_if_long:NTF {#1} \CJKglue { - \xeCJK_no_break: - \xeCJK_punct_if_middle:NT {#1} + \@@_no_break: + \@@_punct_if_middle:NT {#1} { - \xeCJK_punct_glue:n { r/#1 } - \xeCJK_punct_rule:n { m/#1 } + \@@_punct_glue:n { r/#1 } + \@@_punct_rule:n { m/#1 } } } - \tl_gset:Nx \l_xeCJK_lastpunct_tl {#1} + \tl_gset:Nx \l_@@_lastpunct_tl {#1} \CJKpunctsymbol {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_FullLeft_and_FullLeft:N} +% \begin{macro}[internal]{\@@_FullLeft_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullLeft:N #1 +\cs_new_protected_nopar:Npn \@@_FullLeft_and_FullLeft:N #1 { - \xeCJK_no_break: - \xeCJK_get_punct_bounds:nN { l } {#1} - \xeCJK_get_kern:VN \l_xeCJK_lastpunct_tl {#1} - \xeCJK_punct_kern:n { \l_xeCJK_lastpunct_tl - #1 } - \xeCJK_before_FullLeft:N {#1} + \@@_no_break: + \@@_get_punct_bounds:nN { l } {#1} + \@@_get_kern:VN \l_@@_lastpunct_tl {#1} + \@@_punct_kern:n { \l_@@_lastpunct_tl - #1 } + \@@_before_FullLeft:N {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_FullLeft_and_FullRight:N} +% \begin{macro}[internal]{\@@_FullLeft_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullLeft_and_FullRight:N #1 +\cs_new_protected_nopar:Npn \@@_FullLeft_and_FullRight:N #1 { - \xeCJK_no_break: - \xeCJK_get_punct_bounds:nN { r } {#1} - \xeCJK_get_kern:VN \l_xeCJK_lastpunct_tl {#1} - \xeCJK_punct_kern:n { \l_xeCJK_lastpunct_tl - #1 } - \xeCJK_no_break: - \tl_set:Nx \l_xeCJK_lastpunct_tl {#1} + \@@_no_break: + \@@_get_punct_bounds:nN { r } {#1} + \@@_get_kern:VN \l_@@_lastpunct_tl {#1} + \@@_punct_kern:n { \l_@@_lastpunct_tl - #1 } + \@@_no_break: + \tl_set:Nx \l_@@_lastpunct_tl {#1} \CJKpunctsymbol {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_FullRight_and_FullLeft:N} +% \begin{macro}[internal]{\@@_FullRight_and_FullLeft:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullLeft:N #1 +\cs_new_protected_nopar:Npn \@@_FullRight_and_FullLeft:N #1 { - \xeCJK_punct_rule:n { r/\l_xeCJK_lastpunct_tl } - \xeCJK_get_punct_bounds:nN { l } {#1} - \xeCJK_get_kern:VN \l_xeCJK_lastpunct_tl {#1} - \xeCJK_punct_kern:n { \l_xeCJK_lastpunct_tl - #1 } - \xeCJK_punct_nobreak: - \xeCJK_before_FullLeft:N {#1} + \@@_punct_rule:n { r/\l_@@_lastpunct_tl } + \@@_get_punct_bounds:nN { l } {#1} + \@@_get_kern:VN \l_@@_lastpunct_tl {#1} + \@@_punct_kern:n { \l_@@_lastpunct_tl - #1 } + \@@_punct_nobreak: + \@@_before_FullLeft:N {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_FullRight_and_FullRight:N} +% \begin{macro}[internal]{\@@_FullRight_and_FullRight:N} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_FullRight:N #1 +\cs_new_protected_nopar:Npn \@@_FullRight_and_FullRight:N #1 { - \xeCJK_punct_rule:n { r/\l_xeCJK_lastpunct_tl } - \xeCJK_get_punct_bounds:nN { r } {#1} - \xeCJK_get_kern:VN \l_xeCJK_lastpunct_tl {#1} - \xeCJK_punct_kern:n { \l_xeCJK_lastpunct_tl - #1 } - \xeCJK_no_break: - \tl_set:Nx \l_xeCJK_lastpunct_tl {#1} + \@@_punct_rule:n { r/\l_@@_lastpunct_tl } + \@@_get_punct_bounds:nN { r } {#1} + \@@_get_kern:VN \l_@@_lastpunct_tl {#1} + \@@_punct_kern:n { \l_@@_lastpunct_tl - #1 } + \@@_no_break: + \tl_set:Nx \l_@@_lastpunct_tl {#1} \CJKpunctsymbol {#1} } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_last_node:n} +% \begin{macro}[pTF,internal]{\@@_if_last_node:n} % \begin{macrocode} - \prg_new_conditional:Npnn \xeCJK_if_last_node:n #1 { p , T , F , TF } + \prg_new_conditional:Npnn \@@_if_last_node:n #1 { p , T , F , TF } { - \if_dim:w \dim_use:c { c_xeCJK_#1_node_dim } = \tex_lastkern:D + \if_dim:w \dim_use:c { c_@@_#1_node_dim } = \tex_lastkern:D \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_def_node:nn,\xeCJK_make_node:n} +% \begin{macro}[internal]{\@@_def_node:nn,\@@_make_node:n} % 用于判断插入的各种 |kern|。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_def_node:nn #1#2 +\cs_new_protected_nopar:Npn \@@_def_node:nn #1#2 { - \dim_if_exist:cTF { c_xeCJK_#1_node_dim } + \dim_if_exist:cTF { c_@@_#1_node_dim } { \dim_gset:cn } { \dim_const:cn } - { c_xeCJK_#1_node_dim } {#2} + { c_@@_#1_node_dim } {#2} } -\cs_new_protected_nopar:Npn \xeCJK_make_node:n #1 +\cs_new_protected_nopar:Npn \@@_make_node:n #1 { - \tex_kern:D - \dim_use:c { c_xeCJK_#1_node_dim } - \tex_kern:D \dim_use:c { c_xeCJK_#1_node_dim } + \tex_kern:D - \dim_use:c { c_@@_#1_node_dim } + \tex_kern:D \dim_use:c { c_@@_#1_node_dim } } -\xeCJK_def_node:nn { CJK } { 11 sp } -\xeCJK_def_node:nn { CJK_space } { 12 sp } -\xeCJK_def_node:nn { default } { 13 sp } -\xeCJK_def_node:nn { default_space } { 14 sp } -\xeCJK_def_node:nn { default_itcorr } { 15 sp } +\@@_def_node:nn { CJK } { 11 sp } +\@@_def_node:nn { CJK_space } { 12 sp } +\@@_def_node:nn { default } { 13 sp } +\@@_def_node:nn { default_space } { 14 sp } +\@@_def_node:nn { default_itcorr } { 15 sp } % \end{macrocode} % \end{macro} % @@ -2037,30 +2060,30 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ CJKecglue .code:n = { \cs_set:Npn \CJKecglue {#1} - \settowidth \l_xeCJK_ecglue_dim \CJKecglue + \settowidth \l_@@_ecglue_dim \CJKecglue }, xCJKecglue .choice:, xCJKecglue / true .code:n = { - \bool_set_true:N \l_xeCJK_xecglue_bool - \cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue + \bool_set_true:N \l_@@_xecglue_bool + \cs_set_eq:NN \@@_space_or_xecglue: \CJKecglue }, xCJKecglue / false .code:n = { - \bool_set_false:N \l_xeCJK_xecglue_bool - \cs_set_eq:NN \xeCJK_space_or_xecglue: \c_space_token + \bool_set_false:N \l_@@_xecglue_bool + \cs_set_eq:NN \@@_space_or_xecglue: \c_space_token }, xCJKecglue / unknown .code:n = { - \bool_set_true:N \l_xeCJK_xecglue_bool + \bool_set_true:N \l_@@_xecglue_bool \cs_set:Npn \CJKecglue {#1} - \settowidth \l_xeCJK_ecglue_dim \CJKecglue - \cs_set_eq:NN \xeCJK_space_or_xecglue: \CJKecglue + \settowidth \l_@@_ecglue_dim \CJKecglue + \cs_set_eq:NN \@@_space_or_xecglue: \CJKecglue }, xCJKecglue .default:n = { true } , } -\dim_new:N \l_xeCJK_ecglue_dim -\bool_new:N \l_xeCJK_xecglue_bool +\dim_new:N \l_@@_ecglue_dim +\bool_new:N \l_@@_xecglue_bool % \end{macrocode} % \end{macro} % @@ -2084,55 +2107,55 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \CJKspace { } { - \bool_set_true:N \l_xeCJK_space_bool - \cs_set_eq:NN \xeCJK_ignorespaces: \xeCJK_peek_math: + \bool_set_true:N \l_@@_space_bool + \cs_set_eq:NN \@@_ignorespaces: \@@_peek_math: } \NewDocumentCommand \CJKnospace { } { - \bool_set_false:N \l_xeCJK_space_bool - \cs_set_eq:NN \xeCJK_ignorespaces: \xeCJK_ignore_spaces: + \bool_set_false:N \l_@@_space_bool + \cs_set_eq:NN \@@_ignorespaces: \@@_ignore_spaces: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_ignore_spaces:,\xeCJK_peek_math:} +% \begin{macro}[internal]{\@@_ignore_spaces:,\@@_peek_math:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ignore_spaces: +\cs_new_protected_nopar:Npn \@@_ignore_spaces: { \peek_catcode:NTF \c_space_token { - \xeCJK_if_last_node:nT { CJK } - { \tex_unkern:D \tex_unkern:D { \xeCJK_make_node:n { CJK_space } } } - \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token - { \xeCJK_space_or_xecglue: } + \@@_if_last_node:nT { CJK } + { \tex_unkern:D \tex_unkern:D { \@@_make_node:n { CJK_space } } } + \@@_peek_catcode_ignore_spaces:NTF \c_math_toggle_token + { \@@_space_or_xecglue: } { \bool_if:nT { - \xeCJK_if_outer_macro_p:c { l_peek_token } || + \@@_if_outer_macro_p:c { l_peek_token } || \token_if_cs_p:c { l_peek_token } } - { \xeCJK_space_or_xecglue: } + { \@@_space_or_xecglue: } } } { - \xeCJK_if_outer_macro:cF { l_peek_token } + \@@_if_outer_macro:cF { l_peek_token } { \token_if_math_toggle:cTF { l_peek_token } \CJKecglue { \cs_if_exist:cF { l_peek_token } \exp_not:N } } } } -\cs_new_protected_nopar:Npn \xeCJK_peek_math: +\cs_new_protected_nopar:Npn \@@_peek_math: { \peek_catcode:NTF \c_space_token { - \xeCJK_if_last_node:nT { CJK } - { \tex_unkern:D \tex_unkern:D { \xeCJK_make_node:n { CJK_space } } } - \xeCJK_peek_catcode_ignore_spaces:NF \c_space_token - { \xeCJK_space_or_xecglue: } + \@@_if_last_node:nT { CJK } + { \tex_unkern:D \tex_unkern:D { \@@_make_node:n { CJK_space } } } + \@@_peek_catcode_ignore_spaces:NF \c_space_token + { \@@_space_or_xecglue: } } { - \xeCJK_if_outer_macro:cF { l_peek_token } + \@@_if_outer_macro:cF { l_peek_token } { \token_if_math_toggle:cTF { l_peek_token } \CJKecglue { \cs_if_exist:cF { l_peek_token } \exp_not:N } @@ -2161,53 +2184,53 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macro}[internal]{\xeCJKenablechecksingle,\xeCJKdisablechecksingle} % 孤字处理功能开关。 % \begin{macrocode} -\bool_new:N \l_xeCJK_checksingle_bool +\bool_new:N \l_@@_checksingle_bool \NewDocumentCommand \xeCJKenablechecksingle { } { - \bool_if:NF \l_xeCJK_checksingle_bool + \bool_if:NF \l_@@_checksingle_bool { - \bool_set_true:N \l_xeCJK_checksingle_bool - \cs_set_eq:NN \xeCJK_checksingle_save_CJKsymbol:N \xeCJK_CJK_and_CJK:N - \cs_set_eq:NN \xeCJK_CJK_and_CJK:N \xeCJK_checksingle:N + \bool_set_true:N \l_@@_checksingle_bool + \cs_set_eq:NN \@@_checksingle_save_CJKsymbol:N \@@_CJK_and_CJK:N + \cs_set_eq:NN \@@_CJK_and_CJK:N \@@_checksingle:N } } \NewDocumentCommand \xeCJKdisablechecksingle { } { - \bool_if:NT \l_xeCJK_checksingle_bool + \bool_if:NT \l_@@_checksingle_bool { - \bool_set_false:N \l_xeCJK_checksingle_bool - \cs_set_eq:NN \xeCJK_CJK_and_CJK:N \xeCJK_checksingle_save_CJKsymbol:N + \bool_set_false:N \l_@@_checksingle_bool + \cs_set_eq:NN \@@_CJK_and_CJK:N \@@_checksingle_save_CJKsymbol:N } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_checksingle:N,\xeCJK_checksingle:NN,\xeCJK_checksingle:NNN} +% \begin{macro}[internal]{\@@_checksingle:N,\@@_checksingle:NN,\@@_checksingle:NNN} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_checksingle:N #1 +\cs_new_protected_nopar:Npn \@@_checksingle:N #1 { \peek_catcode:NTF \c_catcode_other_token - { \xeCJK_checksingle:NN {#1} } + { \@@_checksingle:NN {#1} } { \bool_if:nTF { - ! ( \xeCJK_if_outer_macro_p:c { l_peek_token } ) && - \xeCJK_if_blank_x_p:n { \token_get_arg_spec:c { l_peek_token } } && + ! ( \@@_if_outer_macro_p:c { l_peek_token } ) && + \@@_if_blank_x_p:n { \token_get_arg_spec:c { l_peek_token } } && \exp_args:NNc \exp_args:No \tl_if_single_token_p:n { l_peek_token } && \exp_args:NNc \exp_after:wN \token_if_other_p:N { l_peek_token } } - { \xeCJK_checksingle:NN {#1} } - { \xeCJK_checksingle_save_CJKsymbol:N {#1} } + { \@@_checksingle:NN {#1} } + { \@@_checksingle_save_CJKsymbol:N {#1} } } } -\cs_new_protected_nopar:Npn \xeCJK_checksingle:NN #1#2 +\cs_new_protected_nopar:Npn \@@_checksingle:NN #1#2 { \peek_catcode:NTF \c_catcode_other_token - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2 } + { \@@_checksingle_save_CJKsymbol:N {#1} #2 } { \bool_if:nTF { - ! ( \xeCJK_if_outer_macro_p:c { l_peek_token } ) && + ! ( \@@_if_outer_macro_p:c { l_peek_token } ) && ( \token_if_space_p:c { l_peek_token } || \token_if_math_toggle_p:c { l_peek_token } || \token_if_cs_p:c { l_peek_token } ) @@ -2215,62 +2238,62 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \bool_if:nTF { \token_if_space_p:c { l_peek_token } } { - \xeCJK_peek_catcode_ignore_spaces:NTF \c_catcode_other_token - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2 \c_space_token } + \@@_peek_catcode_ignore_spaces:NTF \c_catcode_other_token + { \@@_checksingle_save_CJKsymbol:N {#1} #2 \c_space_token } { \bool_if:nTF { - ! ( \xeCJK_if_outer_macro_p:c { l_peek_token } ) && + ! ( \@@_if_outer_macro_p:c { l_peek_token } ) && ( \token_if_math_toggle_p:c { l_peek_token } || \token_if_cs_p:c { l_peek_token } ) } - { \xeCJK_checksingle:NNN {#1} {#2} \c_space_token } - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2 \c_space_token } + { \@@_checksingle:NNN {#1} {#2} \c_space_token } + { \@@_checksingle_save_CJKsymbol:N {#1} #2 \c_space_token } } } - { \xeCJK_checksingle:NNN {#1} {#2} { } } + { \@@_checksingle:NNN {#1} {#2} { } } } - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2 } + { \@@_checksingle_save_CJKsymbol:N {#1} #2 } } } -\cs_new_protected_nopar:Npn \xeCJK_checksingle:NNN #1#2#3 +\cs_new_protected_nopar:Npn \@@_checksingle:NNN #1#2#3 { \bool_if:nTF { \token_if_eq_meaning_p:NN \l_peek_token \par || \token_if_eq_meaning_p:NN \l_peek_token \[ % \] } - { \CJKsymbol {#1} \xeCJK_no_break: #2 } - { \xeCJK_checksingle_env:NNN {#1} {#2} {#3} } + { \CJKsymbol {#1} \@@_no_break: #2 } + { \@@_checksingle_env:NNN {#1} {#2} {#3} } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_checksingle_env:NNN,\xeCJK_checksingle_env:NNNNn} +% \begin{macro}[internal]{\@@_checksingle_env:NNN,\@@_checksingle_env:NNNNn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_checksingle_env:NNN #1#2#3 +\cs_new_protected_nopar:Npn \@@_checksingle_env:NNN #1#2#3 { \peek_catcode_remove:NTF \c_math_toggle_token { \peek_catcode:NTF \c_math_toggle_token - { \CJKsymbol {#1} \xeCJK_no_break: #2 \c_math_toggle_token } - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2#3 \c_math_toggle_token } + { \CJKsymbol {#1} \@@_no_break: #2 \c_math_toggle_token } + { \@@_checksingle_save_CJKsymbol:N {#1} #2#3 \c_math_toggle_token } } { \peek_meaning_remove:NTF \begin - { \xeCJK_checksingle_env:NNNNn {#1} {#2} {#3} \begin } + { \@@_checksingle_env:NNNNn {#1} {#2} {#3} \begin } { \peek_meaning_remove:NTF \end - { \xeCJK_checksingle_env:NNNNn {#1} {#2} {#3} \end } - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2#3 } + { \@@_checksingle_env:NNNNn {#1} {#2} {#3} \end } + { \@@_checksingle_save_CJKsymbol:N {#1} #2#3 } } } } -\cs_new_protected_nopar:Npn \xeCJK_checksingle_env:NNNNn #1#2#3#4#5 +\cs_new_protected_nopar:Npn \@@_checksingle_env:NNNNn #1#2#3#4#5 { - \clist_if_in:NnTF \g_xeCJK_inline_env_clist {#5} - { \xeCJK_checksingle_save_CJKsymbol:N {#1} #2#3 } - { \CJKsymbol {#1} \xeCJK_no_break: #2 } + \clist_if_in:NnTF \g_@@_inline_env_clist {#5} + { \@@_checksingle_save_CJKsymbol:N {#1} #2#3 } + { \CJKsymbol {#1} \@@_no_break: #2 } \scan_stop: #4 {#5} } % \end{macrocode} @@ -2280,16 +2303,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \keys_define:nn { xeCJK / options } { - InlineEnv .clist_gset:N = \g_xeCJK_inline_env_clist , + InlineEnv .clist_gset:N = \g_@@_inline_env_clist , InlineEnv+ .code:n = { - \clist_gput_right:Nx \g_xeCJK_inline_env_clist {#1} - \clist_gremove_duplicates:N \g_xeCJK_inline_env_clist + \clist_gput_right:Nx \g_@@_inline_env_clist {#1} + \clist_gremove_duplicates:N \g_@@_inline_env_clist }, InlineEnv- .code:n = { \clist_map_inline:xn {#1} - { \clist_gremove_all:Nn \g_xeCJK_inline_env_clist {##1} } + { \clist_gremove_all:Nn \g_@@_inline_env_clist {##1} } }, } % \end{macrocode} @@ -2305,21 +2328,21 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \subsection{增加 CJK 子分区} % -% \begin{macro}[internal]{\xeCJK_UL_subclass_patch_tl,\g_xeCJK_CJK_subclass_clist} +% \begin{macro}[internal]{\@@_UL_subclass_patch_tl,\g_@@_CJK_subclass_clist} % \begin{macrocode} -\tl_new:N \xeCJK_UL_subclass_patch_tl -\clist_new:N \g_xeCJK_CJK_subclass_clist +\tl_new:N \@@_UL_subclass_patch_tl +\clist_new:N \g_@@_CJK_subclass_clist % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_erase_CJKsymbol:, \xeCJK_restore_CJKsymbol:} +% \begin{macro}[internal]{\@@_erase_CJKsymbol:, \@@_restore_CJKsymbol:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_erase_CJKsymbol: +\cs_new_protected_nopar:Npn \@@_erase_CJKsymbol: { \cs_gset_eq:NN \CJKsymbol_Block \CJKsymbol \cs_gset_eq:NN \CJKsymbol \prg_do_nothing: } -\cs_new_protected_nopar:Npn \xeCJK_restore_CJKsymbol: +\cs_new_protected_nopar:Npn \@@_restore_CJKsymbol: { \cs_gset_eq:NN \CJKsymbol \CJKsymbol_Block \CJKsymbol @@ -2342,42 +2365,42 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macro}{\xeCJKCancelSubCJKBlock,\xeCJKRestoreSubCJKBlock} % 取消和恢复对 CJK 子区的声明。 % \begin{macrocode} -\bool_new:N \l_xeCJK_sub_cancel_bool +\bool_new:N \l_@@_sub_cancel_bool \NewDocumentCommand \xeCJKCancelSubCJKBlock { s m } { - \bool_if:NF \l_xeCJK_sub_cancel_bool + \bool_if:NF \l_@@_sub_cancel_bool { - \bool_set_true:N \l_xeCJK_sub_cancel_bool - \xeCJK_sub_restore_or_cancel:n {#2} + \bool_set_true:N \l_@@_sub_cancel_bool + \@@_sub_restore_or_cancel:n {#2} \IfBooleanT {#1} { \xeCJKResetPunctClass } } } \NewDocumentCommand \xeCJKRestoreSubCJKBlock { s m } { - \bool_if:NT \l_xeCJK_sub_cancel_bool + \bool_if:NT \l_@@_sub_cancel_bool { - \bool_set_false:N \l_xeCJK_sub_cancel_bool - \xeCJK_sub_restore_or_cancel:n {#2} + \bool_set_false:N \l_@@_sub_cancel_bool + \@@_sub_restore_or_cancel:n {#2} \IfBooleanT {#1} { \xeCJKResetPunctClass } } } -\cs_new_protected_nopar:Npn \xeCJK_sub_restore_or_cancel:n #1 +\cs_new_protected_nopar:Npn \@@_sub_restore_or_cancel:n #1 { \clist_map_inline:xn {#1} { - \cs_if_free:cTF { xeCJK_ CJK/##1 _class } - { \xeCJK_error:nx { SubBlock-undefined } {##1} } + \int_if_exist:cTF { c_@@_ CJK/##1 _class_int } { - \xeCJK_declare_char_class:nn - { CJK \bool_if:NF \l_xeCJK_sub_cancel_bool { /##1 } } - { \tl_use:c { g_xeCJK_CJK/##1_range_clist } } + \@@_declare_char_class:nn + { CJK \bool_if:NF \l_@@_sub_cancel_bool { /##1 } } + { \tl_use:c { g_@@_CJK/##1_range_clist } } } + { \@@_error:nx { SubBlock-undefined } {##1} } } } -\xeCJK_msg_new:nn { SubBlock-undefined } +\@@_msg_new:nn { SubBlock-undefined } { The~CJK~sub~block~'#1'~is~undefined.\\\\ - Try~to~use~\token_to_str:N \xeCJKDeclareSubCJKBlock \c_space_tl + Try~to~use~\token_to_str:N \xeCJKDeclareSubCJKBlock \ to~declare~it. } % \end{macrocode} @@ -2388,80 +2411,80 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \NewDocumentCommand \xeCJKDeclareSubCharClass { > { \TrimSpaces } m > { \TrimSpaces } m m } { - \cs_if_free:cT { xeCJK_ #1/#2 _class } + \int_if_exist:cF { c_@@_ #1/#2 _class_int } { - \xeCJK_new_class:n { #1/#2 } - \xeCJK_set_sub_class_toks:nn {#1} {#2} - \xeCJK_new_sub_key:n {#2} - \xeCJK_UL_subclass_patch:nn {#1} {#2} + \@@_new_class:n { #1/#2 } + \@@_set_sub_class_toks:nn {#1} {#2} + \@@_new_sub_key:n {#2} + \@@_UL_subclass_patch:nn {#1} {#2} } - \xeCJK_declare_char_class:nn { #1/#2 } {#3} + \@@_declare_char_class:nn { #1/#2 } {#3} } \@onlypreamble \xeCJKDeclareSubCharClass % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_sub_class_toks:nn} +% \begin{macro}[internal]{\@@_set_sub_class_toks:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_sub_class_toks:nn #1#2 +\cs_new_protected_nopar:Npn \@@_set_sub_class_toks:nn #1#2 { - \clist_map_inline:Nn \g_xeCJK_base_class_clist + \clist_map_inline:Nn \g_@@_base_class_clist { - \xeCJK_copy_inter_class_toks:nnnn { #1/#2 } {##1} {#1} {##1} - \xeCJK_copy_inter_class_toks:nnnn {##1} { #1/#2 } {##1} {#1} + \@@_copy_inter_class_toks:nnnn { #1/#2 } {##1} {#1} {##1} + \@@_copy_inter_class_toks:nnnn {##1} { #1/#2 } {##1} {#1} \str_if_eq_x:nnTF {##1} { CJK } { - \xeCJK_pre_inter_class_toks:nnn {##1} { #1/#2 } - { \xeCJK_switch_font:nn {#1} {#2} } + \@@_pre_inter_class_toks:nnn {##1} { #1/#2 } + { \@@_switch_font:nn {#1} {#2} } } { - \xeCJK_pre_inter_class_toks:nnn {##1} { #1/#2 } - { \xeCJK_erase_CJKsymbol: } - \xeCJK_app_inter_class_toks:nnn {##1} { #1/#2 } - { \xeCJK_switch_font:nn {#1} {#2} \xeCJK_restore_CJKsymbol: } + \@@_pre_inter_class_toks:nnn {##1} { #1/#2 } + { \@@_erase_CJKsymbol: } + \@@_app_inter_class_toks:nnn {##1} { #1/#2 } + { \@@_switch_font:nn {#1} {#2} \@@_restore_CJKsymbol: } } } - \xeCJK_copy_inter_class_toks:nnnn { #1/#2 } { #1/#2 } {#1} {#1} - \clist_if_empty:NF \g_xeCJK_CJK_subclass_clist + \@@_copy_inter_class_toks:nnnn { #1/#2 } { #1/#2 } {#1} {#1} + \clist_if_empty:NF \g_@@_CJK_subclass_clist { - \clist_map_inline:Nn \g_xeCJK_CJK_subclass_clist + \clist_map_inline:Nn \g_@@_CJK_subclass_clist { - \xeCJK_copy_inter_class_toks:nnnn { #1/#2 } { #1/##1 } {#1} {#1} - \xeCJK_copy_inter_class_toks:nnnn { #1/##1 } { #1/#2 } {#1} {#1} - \xeCJK_pre_inter_class_toks:nnn { #1/#2 } { #1/##1 } - { \xeCJK_switch_font:nn {#2} {##1} } - \xeCJK_pre_inter_class_toks:nnn { #1/##1 } { #1/#2 } - { \xeCJK_switch_font:nn {##1} {#2} } + \@@_copy_inter_class_toks:nnnn { #1/#2 } { #1/##1 } {#1} {#1} + \@@_copy_inter_class_toks:nnnn { #1/##1 } { #1/#2 } {#1} {#1} + \@@_pre_inter_class_toks:nnn { #1/#2 } { #1/##1 } + { \@@_switch_font:nn {#2} {##1} } + \@@_pre_inter_class_toks:nnn { #1/##1 } { #1/#2 } + { \@@_switch_font:nn {##1} {#2} } } } - \clist_gput_right:Nn \g_xeCJK_CJK_subclass_clist {#2} - \xeCJK_save_CJK_class:n { #1/#2 } + \clist_gput_right:Nn \g_@@_CJK_subclass_clist {#2} + \@@_save_CJK_class:n { #1/#2 } \clist_map_inline:nn { CJK, FullLeft, FullRight } { - \xeCJK_pre_inter_class_toks:nnn { #1/#2 } {##1} - { \xeCJK_switch_font:nn {#2} {#1} } + \@@_pre_inter_class_toks:nnn { #1/#2 } {##1} + { \@@_switch_font:nn {#2} {#1} } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_UL_subclass_patch:nn} +% \begin{macro}[internal]{\@@_UL_subclass_patch:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_UL_subclass_patch:nn #1#2 +\cs_new_protected_nopar:Npn \@@_UL_subclass_patch:nn #1#2 { - \tl_put_right:Nn \xeCJK_UL_subclass_patch_tl + \tl_put_right:Nn \@@_UL_subclass_patch_tl { \clist_map_inline:nn { Default, HalfLeft, HalfRight } { \str_if_eq_x:nnTF {##1} { HalfLeft } - { \xeCJK_inter_class_toks:nnn {#1} { #1/#2 } { \CJKecglue \CJKsymbol } } - { \xeCJK_inter_class_toks:nnn {#1} { #1/#2 } { \CJKsymbol } } - \xeCJK_inter_class_toks:nnn { Boundary } { #1/#2 } + { \@@_inter_class_toks:nnn {#1} { #1/#2 } { \CJKecglue \CJKsymbol } } + { \@@_inter_class_toks:nnn {#1} { #1/#2 } { \CJKsymbol } } + \@@_inter_class_toks:nnn { Boundary } { #1/#2 } { - \xeCJK_erase_CJKsymbol: - \xeCJK_Boundary_and_CJK: - \xeCJK_switch_font:nn {#1} {#2} - \xeCJK_restore_CJKsymbol: + \@@_erase_CJKsymbol: + \@@_Boundary_and_CJK: + \@@_switch_font:nn {#1} {#2} + \@@_restore_CJKsymbol: } } } @@ -2471,14 +2494,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \subsection{标点处理} % -% \begin{macro}[internal,var]{\g_xeCJK_punctstyle_clist} +% \begin{macro}[internal,var]{\g_@@_punctstyle_clist} % 标点处理方式。 % \begin{macrocode} -\clist_new:N \g_xeCJK_punctstyle_clist -\clist_set:Nn \g_xeCJK_punctstyle_clist +\clist_new:N \g_@@_punctstyle_clist +\clist_set:Nn \g_@@_punctstyle_clist { CCT , halfwidth , fullwidth , marginkerning , mixedwidth , plain } -\clist_map_inline:Nn \g_xeCJK_punctstyle_clist - { \tl_const:cn { c_xeCJK_ps_#1_tl } {#1} } +\clist_map_inline:Nn \g_@@_punctstyle_clist + { \tl_const:cn { c_@@_ps_#1_tl } {#1} } % \end{macrocode} % \end{macro} % @@ -2494,13 +2517,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { PunctStyle .choice_code:n = { - \tl_set:Nx \l_xeCJK_punctstyle_tl { \l_keys_choice_tl } - \tl_if_eq:NNT \l_xeCJK_punctstyle_tl \c_xeCJK_ps_plain_tl + \tl_set:Nx \l_@@_punctstyle_tl { \l_keys_choice_tl } + \tl_if_eq:NNT \l_@@_punctstyle_tl \c_@@_ps_plain_tl { \xeCJKallowbreakbetweenpuncts } }, } \keys_define:nx { xeCJK / options } - { PunctStyle .generate_choices:n = { \exp_not:V \g_xeCJK_punctstyle_clist } } + { PunctStyle .generate_choices:n = { \exp_not:V \g_@@_punctstyle_clist } } \keys_define:nn { xeCJK / options } { PunctStyle / banjiao .meta:n = { PunctStyle = halfwidth }, @@ -2508,13 +2531,13 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ PunctStyle / kaiming .meta:n = { PunctStyle = mixedwidth }, PunctStyle / hangmobanjiao .meta:n = { PunctStyle = marginkerning }, PunctStyle / unknown .code:n = - { \xeCJK_error:nx { PunctStyle-undefined } \l_keys_value_tl }, + { \@@_error:nx { PunctStyle-undefined } \l_keys_value_tl }, } -\xeCJK_msg_new:nn { PunctStyle-undefined } +\@@_msg_new:nn { PunctStyle-undefined } { Punctstyle~"#1"~is~not~available. \\\\ You~can~only~use~one~of\\\\ - "\g_xeCJK_punctstyle_clist".\\ + "\g_@@_punctstyle_clist".\\ } % \end{macrocode} % \end{macro} @@ -2529,16 +2552,16 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ AllowBreakBetweenPuncts / true .code:n = { \xeCJKallowbreakbetweenpuncts }, AllowBreakBetweenPuncts / false .code:n = { \xeCJKnobreakbetweenpuncts }, AllowBreakBetweenPuncts .default:n = { true }, - KaiMingPunct .code:n = { \xeCJK_set_special_punct:nn { mixedwidth } {#1} }, - KaiMingPunct+ .code:n = { \xeCJK_add_special_punct:nn { mixedwidth } {#1} }, - KaiMingPunct- .code:n = { \xeCJK_sub_special_punct:nn { mixedwidth } {#1} }, - LongPunct .code:n = { \xeCJK_set_special_punct:nn { long } {#1} }, - LongPunct+ .code:n = { \xeCJK_add_special_punct:nn { long } {#1} }, - LongPunct- .code:n = { \xeCJK_sub_special_punct:nn { long } {#1} }, - MiddlePunct+ .code:n = { \xeCJK_add_special_punct:nn { middle } {#1} }, - MiddlePunct .code:n = { \xeCJK_set_special_punct:nn { middle } {#1} }, - MiddlePunct- .code:n = { \xeCJK_sub_special_punct:nn { middle } {#1} }, - PunctWidth .tl_gset:N = \g_xeCJK_punct_width_tl , + KaiMingPunct .code:n = { \@@_set_special_punct:nn { mixedwidth } {#1} }, + KaiMingPunct+ .code:n = { \@@_add_special_punct:nn { mixedwidth } {#1} }, + KaiMingPunct- .code:n = { \@@_sub_special_punct:nn { mixedwidth } {#1} }, + LongPunct .code:n = { \@@_set_special_punct:nn { long } {#1} }, + LongPunct+ .code:n = { \@@_add_special_punct:nn { long } {#1} }, + LongPunct- .code:n = { \@@_sub_special_punct:nn { long } {#1} }, + MiddlePunct+ .code:n = { \@@_add_special_punct:nn { middle } {#1} }, + MiddlePunct .code:n = { \@@_set_special_punct:nn { middle } {#1} }, + MiddlePunct- .code:n = { \@@_sub_special_punct:nn { middle } {#1} }, + PunctWidth .tl_gset:N = \g_@@_punct_width_tl , } % \end{macrocode} % \end{macro} @@ -2546,328 +2569,346 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macro}[internal]{\xeCJKallowbreakbetweenpuncts, \xeCJKnobreakbetweenpuncts} % \begin{macrocode} \NewDocumentCommand \xeCJKallowbreakbetweenpuncts { } - { \cs_set_eq:NN \xeCJK_punct_nobreak: \xeCJK_zero_glue: } + { \cs_set_eq:NN \@@_punct_nobreak: \@@_zero_glue: } \NewDocumentCommand \xeCJKnobreakbetweenpuncts { } - { \cs_set_eq:NN \xeCJK_punct_nobreak: \xeCJK_no_break: } -\cs_new_protected_nopar:Npn \xeCJK_zero_glue: { \skip_horizontal:N \c_zero_skip } + { \cs_set_eq:NN \@@_punct_nobreak: \@@_no_break: } +\cs_new_protected_nopar:Npn \@@_zero_glue: { \skip_horizontal:N \c_zero_skip } % \end{macrocode} % \end{macro} % % \begin{macro}[internal] -% {\g_xeCJK_special_ps_clist, \xeCJK_set_special_punct:nn, -% \xeCJK_add_special_punct:nn, \xeCJK_sub_special_punct:nn} +% {\g_@@_special_ps_clist, \@@_set_special_punct:nn, +% \@@_add_special_punct:nn, \@@_sub_special_punct:nn} % \begin{macrocode} -\clist_set:Nn \g_xeCJK_special_ps_clist { mixedwidth , long , middle } -\clist_map_inline:Nn \g_xeCJK_special_ps_clist +\clist_set:Nn \g_@@_special_ps_clist { mixedwidth , long , middle } +\clist_map_inline:Nn \g_@@_special_ps_clist { - \tl_new:c { l_xeCJK_#1_punct_tl } - \prop_new:c { l_xeCJK_#1_punct_prop } + \tl_new:c { l_@@_#1_punct_tl } + \prop_new:c { l_@@_#1_punct_prop } } -\cs_new_protected_nopar:Npn \xeCJK_set_special_punct:nn #1#2 +\cs_new_protected_nopar:Npn \@@_set_special_punct:nn #1#2 { - \tl_set:cx { l_xeCJK_#1_punct_tl } {#2} - \prop_clear:c { l_xeCJK_#1_punct_prop } - \tl_map_inline:cn { l_xeCJK_#1_punct_tl } - { \prop_put:cnn { l_xeCJK_#1_punct_prop } {##1} { } } + \tl_set:cx { l_@@_#1_punct_tl } {#2} + \prop_clear:c { l_@@_#1_punct_prop } + \tl_map_inline:cn { l_@@_#1_punct_tl } + { \prop_put:cnn { l_@@_#1_punct_prop } {##1} { } } } -\cs_new_protected_nopar:Npn \xeCJK_add_special_punct:nn #1#2 +\cs_new_protected_nopar:Npn \@@_add_special_punct:nn #1#2 { - \tl_put_right:cx { l_xeCJK_#1_punct_tl } {#2} - \tl_map_inline:cn { l_xeCJK_#1_punct_tl } - { \prop_put:cnn { l_xeCJK_#1_punct_prop } {##1} { } } + \tl_put_right:cx { l_@@_#1_punct_tl } {#2} + \tl_map_inline:cn { l_@@_#1_punct_tl } + { \prop_put:cnn { l_@@_#1_punct_prop } {##1} { } } } -\cs_new_protected_nopar:Npn \xeCJK_sub_special_punct:nn #1#2 +\cs_new_protected_nopar:Npn \@@_sub_special_punct:nn #1#2 { \tl_map_inline:xn {#2} { - \tl_remove_all:cn { l_xeCJK_#1_punct_tl } {##1} - \prop_remove:cn { l_xeCJK_#1_punct_prop } {##1} + \tl_remove_all:cn { l_@@_#1_punct_tl } {##1} + \prop_remove:cn { l_@@_#1_punct_prop } {##1} } } \cs_generate_variant:Nn \tl_map_inline:nn { x } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\dim_set:Nc,\dim_add:Nc,\dim_set_min:Nc} +% \begin{macro}[internal]{\dim_set:Nc,\dim_add:Nc,\dim_min:cc} % \begin{macrocode} \cs_generate_variant:Nn \dim_set:Nn { Nc } \cs_generate_variant:Nn \dim_add:Nn { Nc } -\cs_generate_variant:Nn \dim_set_min:Nn { Nc } +\cs_generate_variant:Nn \dim_min:nn { cc } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[internal]{\@@_dim_set_max:Nn,\@@_dim_set_min:Nn} +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_dim_set_max:Nn #1#2 + { \dim_set:Nn #1 { \dim_max:nn {#1} {#2} } } +\cs_new_protected_nopar:Npn \@@_dim_set_min:Nn #1#2 + { \dim_set:Nn #1 { \dim_min:nn {#1} {#2} } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal,var]{\l_xeCJK_punct_coor_tl} +% \begin{macro}[internal,var]{\l_@@_punct_coor_tl} % 记录当前字体状态下的标点处理方式。 % \begin{macrocode} -\tl_set:Nn \l_xeCJK_punct_coor_tl { \l_xeCJK_font_coor_tl/\l_xeCJK_punctstyle_tl } +\tl_set:Nn \l_@@_punct_coor_tl { \l_@@_font_coor_tl/\l_@@_punctstyle_tl } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_punct_bounds:nN} +% \begin{macro}[internal]{\@@_get_punct_bounds:nN} % |#1| 为 |l/r|,|#2| 为标点字符,返回标点的实际左/右空白的负值和根据标点处理方式 % 决定添加的左/右空白。全角方式直接添加标点的实际左/右空白;半角方式添加标点左右空白 % 中的最小值;开明方式与半角相同,只在开明标点再增加实际左/右空白的一半。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:nN #1#2 +\cs_new_protected_nopar:Npn \@@_get_punct_bounds:nN #1#2 { - \tl_if_exist:cF { \l_xeCJK_punct_coor_tl/rule/#1/#2 } + \tl_if_exist:cF { \l_@@_punct_coor_tl/rule/#1/#2 } { - \tl_if_eq:NNTF \l_xeCJK_punctstyle_tl \c_xeCJK_ps_plain_tl + \tl_if_eq:NNTF \l_@@_punctstyle_tl \c_@@_ps_plain_tl { \clist_map_inline:nn { glue , rule , bound } - { \tl_gset:cV { \l_xeCJK_punct_coor_tl/##1/#1/#2 } \c_zero_dim } - \tl_gset:cV { \l_xeCJK_punct_coor_tl/rule/m/#2 } \c_zero_dim + { \tl_gset:cV { \l_@@_punct_coor_tl/##1/#1/#2 } \c_zero_dim } + \tl_gset:cV { \l_@@_punct_coor_tl/rule/m/#2 } \c_zero_dim } { - \tl_if_exist:cF { \l_xeCJK_punct_coor_tl/bound/#1/#2 } - { { \xeCJK_select_font: \xeCJK_get_punct_dimen:N {#2} } } - \xeCJK_punct_if_long:NTF {#2} + \tl_if_exist:cF { \l_@@_punct_coor_tl/bound/#1/#2 } + { { \xeCJK_select_font: \@@_get_punct_dimen:N {#2} } } + \@@_punct_if_long:NTF {#2} { - \dim_zero:N \l_xeCJK_tmpa_dim - \dim_zero:N \l_xeCJK_tmpb_dim - \dim_zero:N \l_xeCJK_tmpc_dim + \dim_zero:N \l_@@_tmpa_dim + \dim_zero:N \l_@@_tmpb_dim + \dim_zero:N \l_@@_tmpc_dim } { - \dim_set:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/#1/#2 } - \dim_set:Nc \l_xeCJK_tmpb_dim - { \l_xeCJK_punct_coor_tl/bound/\str_if_eq_x:nnTF {#1} lrl/#2 } - \dim_set:Nn \l_xeCJK_tmpc_dim + \dim_set:Nc \l_@@_tmpa_dim { \l_@@_punct_coor_tl/bound/#1/#2 } + \dim_set:Nc \l_@@_tmpb_dim + { \l_@@_punct_coor_tl/bound/\str_if_eq_x:nnTF {#1} lrl/#2 } + \dim_set:Nn \l_@@_tmpc_dim { - \cs_if_exist_use:cF { g_xeCJK_punct_width/#2 } + \cs_if_exist_use:cF { g_@@_punct_width/#2 } { - \xeCJK_if_blank_x:nTF \g_xeCJK_punct_width_tl + \@@_if_blank_x:nTF \g_@@_punct_width_tl { \c_zero_dim } - { \g_xeCJK_punct_width_tl } + { \g_@@_punct_width_tl } } } - \xeCJK_punct_if_middle:NTF {#2} + \@@_punct_if_middle:NTF {#2} { - \dim_set:Nn \l_xeCJK_tmpc_dim + \dim_set:Nn \l_@@_tmpc_dim { - \dim_compare:nNnTF \l_xeCJK_tmpc_dim > \c_zero_dim - { \l_xeCJK_tmpc_dim } + \dim_compare:nNnTF \l_@@_tmpc_dim > \c_zero_dim + { \l_@@_tmpc_dim } { - \tl_case:Nnn \l_xeCJK_punctstyle_tl + \tl_case:Nnn \l_@@_punctstyle_tl { - \c_xeCJK_ps_halfwidth_tl { .5 em } - \c_xeCJK_ps_mixedwidth_tl { .5 em } - \c_xeCJK_ps_CCT_tl { .7 em } - \c_xeCJK_ps_fullwidth_tl { 1 em } + \c_@@_ps_halfwidth_tl { .5 em } + \c_@@_ps_mixedwidth_tl { .5 em } + \c_@@_ps_CCT_tl { .7 em } + \c_@@_ps_fullwidth_tl { 1 em } } { 1 em } } - - \tl_use:c { \l_xeCJK_punct_coor_tl/dimen/#2 } + - \tl_use:c { \l_@@_punct_coor_tl/dimen/#2 } } - \dim_set:Nn \l_xeCJK_tmpc_dim { .5 \l_xeCJK_tmpc_dim } + \dim_set:Nn \l_@@_tmpc_dim { .5 \l_@@_tmpc_dim } } { - \dim_compare:nNnTF \l_xeCJK_tmpc_dim > \c_zero_dim + \dim_compare:nNnTF \l_@@_tmpc_dim > \c_zero_dim { - \dim_set:Nn \l_xeCJK_tmpc_dim + \dim_set:Nn \l_@@_tmpc_dim { - \l_xeCJK_tmpc_dim - \l_xeCJK_tmpb_dim - - \tl_use:c { \l_xeCJK_punct_coor_tl/dimen/#2 } + \l_@@_tmpc_dim - \l_@@_tmpb_dim + - \tl_use:c { \l_@@_punct_coor_tl/dimen/#2 } } } { - \dim_set_eq:NN \l_xeCJK_tmpc_dim \l_xeCJK_tmpa_dim - \dim_set_min:Nn \l_xeCJK_tmpc_dim \l_xeCJK_tmpb_dim - \tl_case:Nnn \l_xeCJK_punctstyle_tl + \dim_set:Nn \l_@@_tmpc_dim + { \dim_min:nn \l_@@_tmpa_dim \l_@@_tmpb_dim } + \tl_case:Nnn \l_@@_punctstyle_tl { - \c_xeCJK_ps_halfwidth_tl { \prg_do_nothing: } - \c_xeCJK_ps_mixedwidth_tl + \c_@@_ps_halfwidth_tl { \prg_do_nothing: } + \c_@@_ps_mixedwidth_tl { - \xeCJK_punct_if_mixedwidth:NT {#2} + \@@_punct_if_mixedwidth:NT {#2} { - \dim_add:Nn \l_xeCJK_tmpc_dim { .5 \l_xeCJK_tmpa_dim } - \dim_set_min:Nn \l_xeCJK_tmpc_dim \l_xeCJK_tmpa_dim + \dim_add:Nn \l_@@_tmpc_dim { .5 \l_@@_tmpa_dim } + \@@_dim_set_min:Nn \l_@@_tmpc_dim \l_@@_tmpa_dim } } - \c_xeCJK_ps_CCT_tl + \c_@@_ps_CCT_tl { - \xeCJK_punct_if_mixedwidth:NTF {#2} - { \dim_add:Nn \l_xeCJK_tmpc_dim { .5 \l_xeCJK_tmpa_dim } } - { \dim_add:Nn \l_xeCJK_tmpc_dim { .3 \l_xeCJK_tmpa_dim } } - \dim_set_min:Nn \l_xeCJK_tmpc_dim \l_xeCJK_tmpa_dim + \@@_punct_if_mixedwidth:NTF {#2} + { \dim_add:Nn \l_@@_tmpc_dim { .5 \l_@@_tmpa_dim } } + { \dim_add:Nn \l_@@_tmpc_dim { .3 \l_@@_tmpa_dim } } + \@@_dim_set_min:Nn \l_@@_tmpc_dim \l_@@_tmpa_dim } } - { \dim_set_eq:NN \l_xeCJK_tmpc_dim \l_xeCJK_tmpa_dim } + { \dim_set_eq:NN \l_@@_tmpc_dim \l_@@_tmpa_dim } } } - \dim_set_max:Nn \l_xeCJK_tmpc_dim \c_zero_dim + \@@_dim_set_max:Nn \l_@@_tmpc_dim \c_zero_dim } - \tl_gset:cx { \l_xeCJK_punct_coor_tl/rule/#1/#2 } - { - \dim_use:N \l_xeCJK_tmpa_dim } - \tl_gset:cx { \l_xeCJK_punct_coor_tl/rule/m/#2 } - { - \dim_use:N \l_xeCJK_tmpb_dim } - \tl_gset:cV { \l_xeCJK_punct_coor_tl/glue/#1/#2 } \l_xeCJK_tmpc_dim + \tl_gset:cx { \l_@@_punct_coor_tl/rule/#1/#2 } + { - \dim_use:N \l_@@_tmpa_dim } + \tl_gset:cx { \l_@@_punct_coor_tl/rule/m/#2 } + { - \dim_use:N \l_@@_tmpb_dim } + \tl_gset:cV { \l_@@_punct_coor_tl/glue/#1/#2 } \l_@@_tmpc_dim } } } -\cs_generate_variant:Nn \xeCJK_get_punct_bounds:nN { nV } +\cs_generate_variant:Nn \@@_get_punct_bounds:nN { nV } % \end{macrocode} % \end{macro} % % \begin{macro}{\xeCJKsetwidth} % \begin{macrocode} \NewDocumentCommand \xeCJKsetwidth { m m } - { \tl_map_inline:xn {#1} { \tl_gset:cn { g_xeCJK_punct_width/##1 } {#2} } } + { \tl_map_inline:xn {#1} { \tl_gset:cn { g_@@_punct_width/##1 } {#2} } } % \end{macrocode} % \end{macro} % % \begin{macro}[pTF,internal] -% {\xeCJK_punct_if_right:N,\xeCJK_punct_if_both_left_right:NN, -% \xeCJK_punct_if_long:N,\xeCJK_punct_if_middle:N, -% \xeCJK_punct_if_mixedwidth:N} +% {\@@_punct_if_right:N,\@@_punct_if_both_left_right:NN, +% \@@_punct_if_long:N,\@@_punct_if_middle:N, +% \@@_punct_if_mixedwidth:N} % \begin{macrocode} -\prg_new_conditional:Npnn \xeCJK_punct_if_right:N #1 { p , T , F , TF } +\prg_new_conditional:Npnn \@@_punct_if_right:N #1 { p , T , F , TF } { - \tl_if_exist:cTF { \l_xeCJK_punct_coor_tl/glue/r/#1 } + \tl_if_exist:cTF { \l_@@_punct_coor_tl/glue/r/#1 } \prg_return_true: \prg_return_false: } -\prg_new_conditional:Npnn \xeCJK_punct_if_both_left_right:NN #1#2 { p , T , F , TF } +\prg_new_conditional:Npnn \@@_punct_if_both_left_right:NN #1#2 { p , T , F , TF } { \bool_if:nTF { - ( \tl_if_exist_p:c { \l_xeCJK_punct_coor_tl/glue/r/#1 } && - \tl_if_exist_p:c { \l_xeCJK_punct_coor_tl/glue/r/#2 } ) || - ( \tl_if_exist_p:c { \l_xeCJK_punct_coor_tl/glue/l/#1 } && - \tl_if_exist_p:c { \l_xeCJK_punct_coor_tl/glue/l/#2 } ) + ( \tl_if_exist_p:c { \l_@@_punct_coor_tl/glue/r/#1 } && + \tl_if_exist_p:c { \l_@@_punct_coor_tl/glue/r/#2 } ) || + ( \tl_if_exist_p:c { \l_@@_punct_coor_tl/glue/l/#1 } && + \tl_if_exist_p:c { \l_@@_punct_coor_tl/glue/l/#2 } ) } \prg_return_true: \prg_return_false: } \cs_generate_variant:Nn \prg_new_conditional:Npnn { c } -\clist_map_inline:Nn \g_xeCJK_special_ps_clist +\clist_map_inline:Nn \g_@@_special_ps_clist { - \prg_new_conditional:cpnn { xeCJK_punct_if_#1:N } ##1 { p , T , F , TF } + \prg_new_conditional:cpnn { @@_punct_if_#1:N } ##1 { p , T , F , TF } { - \prop_if_in:cnTF { l_xeCJK_#1_punct_prop } {##1} + \prop_if_in:cnTF { l_@@_#1_punct_prop } {##1} \prg_return_true: \prg_return_false: } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_kern:NN,\xeCJK_calc_kern:NN} +% \begin{macro}[internal]{\@@_get_kern:NN,\@@_calc_kern:NN} % 标点挤压。行末半角方式,相邻标点不挤压;全角方式,相邻两个标点占 1.5 汉字宽度, % 半角、开明和 CCT 方式相邻标点占一个汉字宽度。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_kern:NN #1#2 +\cs_new_protected_nopar:Npn \@@_get_kern:NN #1#2 { - \tl_if_exist:cF { \l_xeCJK_punct_coor_tl/kern/#1-#2 } + \tl_if_exist:cF { \l_@@_punct_coor_tl/kern/#1-#2 } { - \dim_zero:N \l_xeCJK_tmpa_dim - \tl_if_eq:NNF \l_xeCJK_punctstyle_tl \c_xeCJK_ps_plain_tl + \dim_zero:N \l_@@_tmpa_dim + \tl_if_eq:NNF \l_@@_punctstyle_tl \c_@@_ps_plain_tl { - \tl_if_exist:cTF { g_xeCJK_punct/kern/#1-#2 } - { \dim_set:Nc \l_xeCJK_tmpa_dim { g_xeCJK_punct/kern/#1-#2 } } - { \xeCJK_calc_kern:NN {#1} {#2} } + \tl_if_exist:cTF { g_@@_punct/kern/#1-#2 } + { \dim_set:Nc \l_@@_tmpa_dim { g_@@_punct/kern/#1-#2 } } + { \@@_calc_kern:NN {#1} {#2} } } - \tl_gset:cV { \l_xeCJK_punct_coor_tl/kern/#1-#2 } \l_xeCJK_tmpa_dim + \tl_gset:cV { \l_@@_punct_coor_tl/kern/#1-#2 } \l_@@_tmpa_dim } } -\cs_new_protected_nopar:Npn \xeCJK_calc_kern:NN #1#2 +\cs_new_protected_nopar:Npn \@@_calc_kern:NN #1#2 { - \tl_if_eq:NNTF \l_xeCJK_punctstyle_tl \c_xeCJK_ps_marginkerning_tl + \tl_if_eq:NNTF \l_@@_punctstyle_tl \c_@@_ps_marginkerning_tl { - \xeCJK_punct_if_right:NT {#1} - { \dim_add:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/r/#1 } } - \xeCJK_punct_if_right:NF {#2} - { \dim_add:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/l/#2 } } + \@@_punct_if_right:NT {#1} + { \dim_add:Nc \l_@@_tmpa_dim { \l_@@_punct_coor_tl/bound/r/#1 } } + \@@_punct_if_right:NF {#2} + { \dim_add:Nc \l_@@_tmpa_dim { \l_@@_punct_coor_tl/bound/l/#2 } } } { - \tl_if_eq:NNTF \l_xeCJK_punctstyle_tl \c_xeCJK_ps_fullwidth_tl - { \xeCJK_calc_kern:NnNN \l_xeCJK_tmpa_dim { 1.5 em } {#1} {#2} } + \tl_if_eq:NNTF \l_@@_punctstyle_tl \c_@@_ps_fullwidth_tl + { \@@_calc_kern:NnNN \l_@@_tmpa_dim { 1.5 em } {#1} {#2} } { - \xeCJK_punct_if_both_left_right:NNTF {#1} {#2} + \@@_punct_if_both_left_right:NNTF {#1} {#2} { - \xeCJK_punct_if_mixedwidth:NT {#1} + \@@_punct_if_mixedwidth:NT {#1} { - \xeCJK_calc_kern:NnNN \l_xeCJK_tmpa_dim { 1 em } {#1} {#2} - \dim_compare:nNnT \l_xeCJK_tmpa_dim < { .1 em } - { \dim_set:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/l/#1 } } + \@@_calc_kern:NnNN \l_@@_tmpa_dim { 1 em } {#1} {#2} + \dim_compare:nNnT \l_@@_tmpa_dim < { .1 em } + { \dim_set:Nc \l_@@_tmpa_dim { \l_@@_punct_coor_tl/bound/l/#1 } } } } { \bool_if:nTF { - \xeCJK_punct_if_mixedwidth_p:N {#1} && - ! ( \tl_if_eq_p:NN \l_xeCJK_punctstyle_tl \c_xeCJK_ps_halfwidth_tl ) + \@@_punct_if_mixedwidth_p:N {#1} && + ! ( \tl_if_eq_p:NN \l_@@_punctstyle_tl \c_@@_ps_halfwidth_tl ) } { - \dim_set:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/glue/r/#1 } - \dim_set:Nn \l_xeCJK_tmpa_dim { .7 \l_xeCJK_tmpa_dim } + \dim_set:Nc \l_@@_tmpa_dim { \l_@@_punct_coor_tl/glue/r/#1 } + \dim_set:Nn \l_@@_tmpa_dim { .7 \l_@@_tmpa_dim } } { - \xeCJK_calc_kern:NnNN \l_xeCJK_tmpa_dim { 1 em } {#1} {#2} - \dim_compare:nNnT \l_xeCJK_tmpa_dim < { .1 em } + \@@_calc_kern:NnNN \l_@@_tmpa_dim { 1 em } {#1} {#2} + \dim_compare:nNnT \l_@@_tmpa_dim < { .1 em } { - \dim_set:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/l/#1 } - \dim_set_min:Nc \l_xeCJK_tmpa_dim { \l_xeCJK_punct_coor_tl/bound/r/#1 } - \dim_set:Nc \l_xeCJK_tmpb_dim { \l_xeCJK_punct_coor_tl/bound/l/#2 } - \dim_set_min:Nc \l_xeCJK_tmpb_dim { \l_xeCJK_punct_coor_tl/bound/r/#2 } - \dim_set_max:Nn \l_xeCJK_tmpa_dim \l_xeCJK_tmpb_dim + \dim_set:Nn \l_@@_tmpa_dim + { + \dim_max:nn + { + \dim_min:cc + { \l_@@_punct_coor_tl/bound/l/#1 } + { \l_@@_punct_coor_tl/bound/r/#1 } + } + { + \dim_min:cc + { \l_@@_punct_coor_tl/bound/l/#2 } + { \l_@@_punct_coor_tl/bound/r/#2 } + } + } } } } } \bool_if:nT - { \xeCJK_punct_if_long_p:N {#1} || \xeCJK_punct_if_long_p:N {#2} } - { \dim_set_max:Nn \l_xeCJK_tmpa_dim { .1 em } } + { \@@_punct_if_long_p:N {#1} || \@@_punct_if_long_p:N {#2} } + { \@@_dim_set_max:Nn \l_@@_tmpa_dim { .1 em } } } - \dim_set_max:Nn \l_xeCJK_tmpa_dim \c_zero_dim + \@@_dim_set_max:Nn \l_@@_tmpa_dim \c_zero_dim } -\cs_generate_variant:Nn \xeCJK_get_kern:NN { V } +\cs_generate_variant:Nn \@@_get_kern:NN { V } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_calc_kern:NnNN} +% \begin{macro}[internal]{\@@_calc_kern:NnNN} % |#3| 和 |#4| 为相邻的两个标点,|#2| 为要确定的相邻两个标点总共占的宽度,|#1| 是 % 尺寸寄存器,用于记录根据所占宽度计算得出的相邻两个标点间距。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_calc_kern:NnNN #1#2#3#4 +\cs_new_protected_nopar:Npn \@@_calc_kern:NnNN #1#2#3#4 { \dim_set:Nn #1 { #2 - - \tl_use:c { \l_xeCJK_punct_coor_tl/ - \xeCJK_punct_if_right:NTF {#3} { bound } { glue } /l/#3 } - - \tl_use:c { \l_xeCJK_punct_coor_tl/ - \xeCJK_punct_if_right:NTF {#4} { glue } { bound } /r/#4 } - - \tl_use:c { \l_xeCJK_punct_coor_tl/dimen/#3 } - - \tl_use:c { \l_xeCJK_punct_coor_tl/dimen/#4 } - \xeCJK_punct_if_both_left_right:NNT {#3} {#4} - { + \tl_use:c { \l_xeCJK_punct_coor_tl/rule/m/#4 } } + - \tl_use:c { \l_@@_punct_coor_tl/ + \@@_punct_if_right:NTF {#3} { bound } { glue } /l/#3 } + - \tl_use:c { \l_@@_punct_coor_tl/ + \@@_punct_if_right:NTF {#4} { glue } { bound } /r/#4 } + - \tl_use:c { \l_@@_punct_coor_tl/dimen/#3 } + - \tl_use:c { \l_@@_punct_coor_tl/dimen/#4 } + \@@_punct_if_both_left_right:NNT {#3} {#4} + { + \tl_use:c { \l_@@_punct_coor_tl/rule/m/#4 } } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_punct_dimen:N} +% \begin{macro}[internal]{\@@_get_punct_dimen:N} % 返回标点的左右空白和实际尺寸。对于破折号,计算两标点之间的空白,保证它中间不被断开。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_punct_dimen:N #1 +\cs_new_protected_nopar:Npn \@@_get_punct_dimen:N #1 { - \xeCJK_get_glyph_bounds:nNN { left } {#1} \l_xeCJK_tmpa_dim - \tl_gset:cV { \l_xeCJK_punct_coor_tl/bound/l/#1 } \l_xeCJK_tmpa_dim - \dim_set_eq:NN \l_xeCJK_tmpb_dim \l_xeCJK_tmpa_dim - \xeCJK_get_glyph_bounds:nNN { right } {#1} \l_xeCJK_tmpa_dim - \tl_gset:cV { \l_xeCJK_punct_coor_tl/bound/r/#1 } \l_xeCJK_tmpa_dim - \dim_add:Nn \l_xeCJK_tmpb_dim \l_xeCJK_tmpa_dim - \tl_gset:cx { \l_xeCJK_punct_coor_tl/dimen/#1 } - { \dim_eval:n { \etex_fontcharwd:D \tex_font:D `#1 - \l_xeCJK_tmpb_dim } } + \@@_get_glyph_bounds:nNN { left } {#1} \l_@@_tmpa_dim + \tl_gset:cV { \l_@@_punct_coor_tl/bound/l/#1 } \l_@@_tmpa_dim + \dim_set_eq:NN \l_@@_tmpb_dim \l_@@_tmpa_dim + \@@_get_glyph_bounds:nNN { right } {#1} \l_@@_tmpa_dim + \tl_gset:cV { \l_@@_punct_coor_tl/bound/r/#1 } \l_@@_tmpa_dim + \dim_add:Nn \l_@@_tmpb_dim \l_@@_tmpa_dim + \tl_gset:cx { \l_@@_punct_coor_tl/dimen/#1 } + { \dim_eval:n { \etex_fontcharwd:D \tex_font:D `#1 - \l_@@_tmpb_dim } } \bool_if:nT { - \xeCJK_punct_if_long_p:N {#1} && + \@@_punct_if_long_p:N {#1} && ! ( \str_if_eq_x_p:nn {#1} { … } || \str_if_eq_x_p:nn {#1} { ‥ } ) } { - \clist_map_inline:Nn \g_xeCJK_punctstyle_clist + \clist_map_inline:Nn \g_@@_punctstyle_clist { - \str_if_eq_x:nnF \c_xeCJK_ps_plain_tl {##1} + \str_if_eq_x:nnF \c_@@_ps_plain_tl {##1} { - \tl_gset:cx { \l_xeCJK_font_coor_tl/##1/kern/#1-#1 } - { - \dim_use:N \l_xeCJK_tmpb_dim } + \tl_gset:cx { \l_@@_font_coor_tl/##1/kern/#1-#1 } + { - \dim_use:N \l_@@_tmpb_dim } } } } @@ -2875,10 +2916,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_glyph_bounds:nNN} +% \begin{macro}[internal]{\@@_get_glyph_bounds:nNN} % 用 |\XeTeXglyphbounds| 计算标点的上下左右空白。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_get_glyph_bounds:nNN #1#2#3 +\cs_new_protected_nopar:Npn \@@_get_glyph_bounds:nNN #1#2#3 { \dim_set:Nn #3 { @@ -2899,7 +2940,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 手动设置相邻标点的距离,仅在当前字体状态下有效。 % \begin{macrocode} \NewDocumentCommand \xeCJKsetkern { m m m } - { \tl_gset:cn { g_xeCJK_punct/kern/#1-#2 } {#3} } + { \tl_gset:cn { g_@@_punct/kern/#1-#2 } {#3} } % \end{macrocode} % \end{macro} % @@ -2922,79 +2963,79 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macro}[internal]{\xeCJKenablefallback, \xeCJKdisablefallback} % 后备字体的启用开关,默认关闭。 % \begin{macrocode} -\bool_new:N \l_xeCJK_fallback_bool +\bool_new:N \l_@@_fallback_bool \NewDocumentCommand \xeCJKenablefallback { } { - \bool_if:NF \l_xeCJK_fallback_bool + \bool_if:NF \l_@@_fallback_bool { - \bool_set_true:N \l_xeCJK_fallback_bool - \cs_set_eq:NN \xeCJK_fallback_save_CJKsymbol:N \CJKsymbol - \cs_set_eq:NN \CJKsymbol \xeCJK_fallback_testsymbol:N + \bool_set_true:N \l_@@_fallback_bool + \cs_set_eq:NN \@@_fallback_save_CJKsymbol:N \CJKsymbol + \cs_set_eq:NN \CJKsymbol \@@_fallback_testsymbol:N } } \NewDocumentCommand \xeCJKdisablefallback { } { - \bool_if:NT \l_xeCJK_fallback_bool + \bool_if:NT \l_@@_fallback_bool { - \bool_set_false:N \l_xeCJK_fallback_bool - \cs_set_eq:NN \CJKsymbol \xeCJK_fallback_save_CJKsymbol:N + \bool_set_false:N \l_@@_fallback_bool + \cs_set_eq:NN \CJKsymbol \@@_fallback_save_CJKsymbol:N } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_fallback_testsymbol:N} +% \begin{macro}[internal]{\@@_fallback_testsymbol:N} % 测试当前字体中是否存在当前字符,如存在则直接输出,否则启用后备字体。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fallback_testsymbol:N #1 +\cs_new_protected_nopar:Npn \@@_fallback_testsymbol:N #1 { \font_glyph_if_exist:NnTF \tex_font:D {`#1} - { \xeCJK_fallback_save_CJKsymbol:N {#1} } + { \@@_fallback_save_CJKsymbol:N {#1} } { - \xeCJK_family_if_exist:xTF { \xeCJK@family/FallBack } + \@@_family_if_exist:xTF { \l_xeCJK_family_tl/FallBack } { { - \tl_put_right:Nn \xeCJK@family { /FallBack } + \tl_put_right:Nn \l_xeCJK_family_tl { /FallBack } \xeCJK_select_font: - \xeCJK_fallback_testsymbol:N {#1} + \@@_fallback_testsymbol:N {#1} } } { - \xeCJK_warning:nx { fallback } {#1} - \xeCJK_fallback_save_CJKsymbol:N {#1} + \@@_warning:nx { fallback } {#1} + \@@_fallback_save_CJKsymbol:N {#1} } } } -\xeCJK_msg_new:nn { fallback } +\@@_msg_new:nn { fallback } { - CJKfamily~'\xeCJK@family'~ - ( \prop_get:NV \g_xeCJK_family_prop \xeCJK@family )~ + CJKfamily~'\l_xeCJK_family_tl'~ + ( \prop_get:NV \g_@@_family_prop \l_xeCJK_family_tl )~ does~not~contain~glyph~'#1'~(U+\int_to_hexadecimal:n {`#1}).\\ } % \end{macrocode} % \end{macro} % % \begin{macro}{\setCJKfallbackfamilyfont} -% \begin{macro}[aux]{\xeCJK_set_family_fallback:nnn} +% \begin{macro}[aux]{\@@_set_family_fallback:nnn} % \begin{macrocode} \NewDocumentCommand \setCJKfallbackfamilyfont { m O{} m } { \exp_args:Nx \tl_if_in:nnTF {#3} { , } - { \xeCJK_set_family_fallback:nnn {#1} {#2} {#3} } - { \xeCJK_set_family:nnn { #1/FallBack } {#2} {#3} } + { \@@_set_family_fallback:nnn {#1} {#2} {#3} } + { \xeCJK_set_family:xnn { #1/FallBack } {#2} {#3} } } -\cs_new_protected_nopar:Npn \xeCJK_set_family_fallback:nnn #1#2#3 +\cs_new_protected_nopar:Npn \@@_set_family_fallback:nnn #1#2#3 { \group_begin: - \tl_set:Nx \l_xeCJK_family_fb_tl {#1} - \prop_get:NVNF \g_xeCJK_family_prop \l_xeCJK_family_fb_tl \l_xeCJK_fontname_tl - { \tl_clear:N \l_xeCJK_fontname_tl } + \tl_set:Nx \l_@@_family_fb_tl {#1} + \prop_get:NVNF \g_@@_family_prop \l_@@_family_fb_tl \l_@@_fontname_tl + { \tl_clear:N \l_@@_fontname_tl } \clist_map_inline:xn {#3} { - \tl_put_right:Nn \l_xeCJK_family_fb_tl { /FallBack } - \xeCJK_get_sub_features:nn \l_xeCJK_family_fb_tl {##1} - \clist_put_left:cx { l_xeCJK_ \l_xeCJK_family_fb_tl _fontfeat_clist } {#2} - \xeCJK_set_family:ncc \l_xeCJK_family_fb_tl - { l_xeCJK_ \l_xeCJK_family_fb_tl _fontfeat_clist } - { l_xeCJK_ \l_xeCJK_family_fb_tl _fontname_tl } + \tl_put_right:Nn \l_@@_family_fb_tl { /FallBack } + \@@_get_sub_features:nn \l_@@_family_fb_tl {##1} + \clist_put_left:cx { l_@@_ \l_@@_family_fb_tl _fontfeat_clist } {#2} + \xeCJK_set_family:xcc \l_@@_family_fb_tl + { l_@@_ \l_@@_family_fb_tl _fontfeat_clist } + { l_@@_ \l_@@_family_fb_tl _fontname_tl } } \group_end: } @@ -3006,10 +3047,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \subsection{CJK 字体族声明方式} % % \begin{macrocode} -\bool_new:N \g_xeCJK_AutoFakeBold_bool -\bool_new:N \g_xeCJK_AutoFakeSlant_bool -\fp_new:N \g_xeCJK_EmboldenFactor_fp -\fp_new:N \g_xeCJK_SlantFactor_fp +\bool_new:N \g_@@_AutoFakeBold_bool +\bool_new:N \g_@@_AutoFakeSlant_bool +\fp_new:N \g_@@_EmboldenFactor_fp +\fp_new:N \g_@@_SlantFactor_fp % \end{macrocode} % % \begin{macro}{AutoFakeBold, AutoFakeSlant,EmboldenFactor,SlantFactor} @@ -3019,28 +3060,28 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { AutoFakeBold .choice:, AutoFakeBold / true .code:n = - { \bool_set_true:N \g_xeCJK_AutoFakeBold_bool }, + { \bool_set_true:N \g_@@_AutoFakeBold_bool }, AutoFakeBold / false .code:n = - { \bool_set_false:N \g_xeCJK_AutoFakeBold_bool }, + { \bool_set_false:N \g_@@_AutoFakeBold_bool }, AutoFakeBold / unknown .code:n = { - \bool_set_true:N \g_xeCJK_AutoFakeBold_bool - \fp_set:Nn \g_xeCJK_EmboldenFactor_fp { \l_keys_value_tl } + \bool_set_true:N \g_@@_AutoFakeBold_bool + \fp_set:Nn \g_@@_EmboldenFactor_fp { \l_keys_value_tl } }, AutoFakeBold .default:n = { true }, AutoFakeSlant .choice:, AutoFakeSlant / true .code:n = - { \bool_set_true:N \g_xeCJK_AutoFakeSlant_bool }, + { \bool_set_true:N \g_@@_AutoFakeSlant_bool }, AutoFakeSlant / false .code:n = - { \bool_set_false:N \g_xeCJK_AutoFakeSlant_bool }, + { \bool_set_false:N \g_@@_AutoFakeSlant_bool }, AutoFakeSlant / unknown .code:n = { - \bool_set_true:N \g_xeCJK_AutoFakeSlant_bool - \fp_set:Nn \g_xeCJK_SlantFactor_fp { \l_keys_value_tl } + \bool_set_true:N \g_@@_AutoFakeSlant_bool + \fp_set:Nn \g_@@_SlantFactor_fp { \l_keys_value_tl } }, AutoFakeSlant .default:n = { true }, - EmboldenFactor .fp_set:N = \g_xeCJK_EmboldenFactor_fp, - SlantFactor .fp_set:N = \g_xeCJK_SlantFactor_fp, + EmboldenFactor .fp_set:N = \g_@@_EmboldenFactor_fp, + SlantFactor .fp_set:N = \g_@@_SlantFactor_fp, BoldFont .meta:n = { AutoFakeBold = true }, boldfont .meta:n = { AutoFakeBold = true }, SlantFont .meta:n = { AutoFakeSlant = true }, @@ -3055,109 +3096,109 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_new_sub_key:n,\g_xeCJK_sub_key_clist} +% \begin{macro}[internal]{\@@_new_sub_key:n,\g_@@_sub_key_clist} % 用于定义 CJK 子区字体和备用字体的选项。 % \begin{macrocode} -\clist_new:N \g_xeCJK_sub_key_clist -\cs_new_protected_nopar:Npn \xeCJK_new_sub_key:n #1 +\clist_new:N \g_@@_sub_key_clist +\cs_new_protected_nopar:Npn \@@_new_sub_key:n #1 { - \clist_gput_right:Nx \g_xeCJK_sub_key_clist {#1} + \clist_gput_right:Nx \g_@@_sub_key_clist {#1} \keys_define:nn { xeCJK / features } { #1 .code:n = { - \xeCJK_if_blank_x:nTF {##1} + \@@_if_blank_x:nTF {##1} { - \bool_set_false:c { l_xeCJK_copy_#1_bool } - \bool_set_false:c { l_xeCJK_add_#1_bool } - \tl_put_right:Nx \l_xeCJK_family_tl { /#1 } + \bool_set_false:c { l_@@_copy_#1_bool } + \bool_set_false:c { l_@@_add_#1_bool } + \tl_put_right:Nx \l_@@_family_tl { /#1 } } { - \clist_put_right:Nx \l_xeCJK_sub_key_clist {#1} + \clist_put_right:Nx \l_@@_sub_key_clist {#1} \str_if_eq_x:nnTF {##1} * { - \bool_set_true:c { l_xeCJK_copy_#1_bool } - \bool_set_false:c { l_xeCJK_add_#1_bool } + \bool_set_true:c { l_@@_copy_#1_bool } + \bool_set_false:c { l_@@_add_#1_bool } } { - \bool_set_false:c { l_xeCJK_copy_#1_bool } - \bool_set_true:c { l_xeCJK_add_#1_bool } - \xeCJK_get_sub_features:nn {#1} {##1} + \bool_set_false:c { l_@@_copy_#1_bool } + \bool_set_true:c { l_@@_add_#1_bool } + \@@_get_sub_features:nn {#1} {##1} } } }, #1 .default:n = \c_empty_tl, } } -\cs_generate_variant:Nn \xeCJK_new_sub_key:n { x } -\cs_new_protected_nopar:Npn \xeCJK_get_sub_features:nn #1#2 +\cs_generate_variant:Nn \@@_new_sub_key:n { x } +\cs_new_protected_nopar:Npn \@@_get_sub_features:nn #1#2 { - \tl_set:Nx \l_xeCJK_tmpa_tl {#2} - \clist_clear:N \l_xeCJK_sub_fontfeat_clist - \xeCJK_gobble_brace:N \l_xeCJK_tmpa_tl - \exp_args:No \tl_if_head_eq_charcode:nNTF \l_xeCJK_tmpa_tl [ % ] + \tl_set:Nx \l_@@_tmpa_tl {#2} + \clist_clear:N \l_@@_sub_fontfeat_clist + \@@_gobble_brace:N \l_@@_tmpa_tl + \exp_args:No \tl_if_head_eq_charcode:nNTF \l_@@_tmpa_tl [ % ] { - \exp_after:wN \xeCJK_get_sub_features_aux:n \l_xeCJK_tmpa_tl \c_empty_tl - \xeCJK_if_blank_x:nT \l_xeCJK_sub_fontname_tl + \exp_after:wN \@@_get_sub_features_aux:n \l_@@_tmpa_tl \c_empty_tl + \@@_if_blank_x:nT \l_@@_sub_fontname_tl { - \tl_set:Nx \l_xeCJK_sub_fontname_tl \l_xeCJK_tmpa_tl - \clist_clear:N \l_xeCJK_sub_fontfeat_clist + \tl_set:Nx \l_@@_sub_fontname_tl \l_@@_tmpa_tl + \clist_clear:N \l_@@_sub_fontfeat_clist } } - { \tl_set:Nx \l_xeCJK_sub_fontname_tl \l_xeCJK_tmpa_tl } - \xeCJK_if_blank_x:nTF \l_xeCJK_sub_fontname_tl - { \tl_set:Nx \l_xeCJK_sub_fontname_tl \l_xeCJK_fontname_tl } - { \tl_replace_all:Nnx \l_xeCJK_sub_fontname_tl * \l_xeCJK_fontname_tl } - \clist_set:cx { l_xeCJK_#1_fontfeat_clist } \l_xeCJK_sub_fontfeat_clist - \tl_set:cx { l_xeCJK_#1_fontname_tl } \l_xeCJK_sub_fontname_tl + { \tl_set:Nx \l_@@_sub_fontname_tl \l_@@_tmpa_tl } + \@@_if_blank_x:nTF \l_@@_sub_fontname_tl + { \tl_set:Nx \l_@@_sub_fontname_tl \l_@@_fontname_tl } + { \tl_replace_all:Nnx \l_@@_sub_fontname_tl * \l_@@_fontname_tl } + \clist_set:cx { l_@@_#1_fontfeat_clist } \l_@@_sub_fontfeat_clist + \tl_set:cx { l_@@_#1_fontname_tl } \l_@@_sub_fontname_tl } % \end{macrocode} % \end{macro} % % \begin{macro}[aux] -% {\xeCJK_gobble_brace:N,\xeCJK_get_sub_features:nn,\xeCJK_get_sub_features_aux:n} +% {\@@_gobble_brace:N,\@@_get_sub_features:nn,\@@_get_sub_features_aux:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_gobble_brace:N #1 +\cs_new_protected_nopar:Npn \@@_gobble_brace:N #1 { \exp_args:No \tl_if_head_is_group:nT #1 { \exp_last_unbraced:NNo \tl_set:Nn #1 #1 - \xeCJK_gobble_brace:N #1 + \@@_gobble_brace:N #1 } } -\cs_new_protected_nopar:Npn \xeCJK_get_sub_features_aux:n [#1] #2 +\cs_new_protected_nopar:Npn \@@_get_sub_features_aux:n [#1] #2 { - \clist_set:Nx \l_xeCJK_sub_fontfeat_clist {#1} - \tl_set:Nx \l_xeCJK_sub_fontname_tl {#2} + \clist_set:Nx \l_@@_sub_fontfeat_clist {#1} + \tl_set:Nx \l_@@_sub_fontname_tl {#2} } % \end{macrocode} % \end{macro} % % \begin{macro}{FallBack} % \begin{macrocode} -\xeCJK_new_sub_key:n { FallBack } +\@@_new_sub_key:n { FallBack } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\g_xeCJK_features_id_prop, BoldFont, ItalicFont, BoldItalicFont, +% \begin{macro}[internal]{\g_@@_features_id_prop, BoldFont, ItalicFont, BoldItalicFont, % SlantedFont, BoldSlantedFont,BoldFeatures, ItalicFeatures, BoldItalicFeatures, % SlantedFeatures, BoldSlantedFeatures} % 调用字体的属性声明,同 \pkg{fontspec} 宏包。 % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_map_features_id:n #1 - { \prop_get:Nn \g_xeCJK_features_id_prop {#1} } -\prop_new:N \g_xeCJK_features_id_prop -\prop_put:Nnn \g_xeCJK_features_id_prop { bf } { Bold } -\prop_put:Nnn \g_xeCJK_features_id_prop { it } { Italic } -\prop_put:Nnn \g_xeCJK_features_id_prop { bfit } { BoldItalic } -\prop_put:Nnn \g_xeCJK_features_id_prop { sl } { Slanted } -\prop_put:Nnn \g_xeCJK_features_id_prop { bfsl } { BoldSlanted } -\prop_map_inline:Nn \g_xeCJK_features_id_prop +\cs_new_nopar:Npn \@@_map_features_id:n #1 + { \prop_get:Nn \g_@@_features_id_prop {#1} } +\prop_new:N \g_@@_features_id_prop +\prop_put:Nnn \g_@@_features_id_prop { bf } { Bold } +\prop_put:Nnn \g_@@_features_id_prop { it } { Italic } +\prop_put:Nnn \g_@@_features_id_prop { bfit } { BoldItalic } +\prop_put:Nnn \g_@@_features_id_prop { sl } { Slanted } +\prop_put:Nnn \g_@@_features_id_prop { bfsl } { BoldSlanted } +\prop_map_inline:Nn \g_@@_features_id_prop { \keys_define:nn { xeCJK / features } { - #2Font .tl_set_x:c = { l_xeCJK_fontname_#1_tl }, - #2Features .tl_set_x:c = { l_xeCJK_fontfeat_#1_clist } , + #2Font .tl_set_x:c = { l_@@_fontname_#1_tl }, + #2Features .tl_set_x:c = { l_@@_fontfeat_#1_clist } , } } % \end{macrocode} @@ -3169,130 +3210,130 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { AutoFakeBold .choice:, AutoFakeBold / false .code:n = - { \bool_set_false:N \l_xeCJK_AutoFakeBold_bool }, + { \bool_set_false:N \l_@@_AutoFakeBold_bool }, AutoFakeBold / unknown .code:n = { - \bool_set_true:N \l_xeCJK_AutoFakeBold_bool - \fp_set:Nn \l_xeCJK_EmboldenFactor_fp { \l_keys_value_tl } + \bool_set_true:N \l_@@_AutoFakeBold_bool + \fp_set:Nn \l_@@_EmboldenFactor_fp { \l_keys_value_tl } }, - AutoFakeBold .default:n = { \g_xeCJK_EmboldenFactor_fp }, + AutoFakeBold .default:n = { \g_@@_EmboldenFactor_fp }, AutoFakeSlant .choice:, AutoFakeSlant / false .code:n = - { \bool_set_false:N \l_xeCJK_AutoFakeSlant_bool }, + { \bool_set_false:N \l_@@_AutoFakeSlant_bool }, AutoFakeSlant / unknown .code:n = { - \bool_set_true:N \l_xeCJK_AutoFakeSlant_bool - \fp_set:Nn \l_xeCJK_SlantFactor_fp { \l_keys_value_tl } + \bool_set_true:N \l_@@_AutoFakeSlant_bool + \fp_set:Nn \l_@@_SlantFactor_fp { \l_keys_value_tl } }, - AutoFakeSlant .default:n = { \g_xeCJK_SlantFactor_fp }, + AutoFakeSlant .default:n = { \g_@@_SlantFactor_fp }, Mono .choice:, Mono / Exspace .code:n = { - \xeCJK_set_monoexspace: - \tl_clear:N \l_xeCJK_monoscale_tl + \@@_set_monoexspace: + \tl_clear:N \l_@@_monoscale_tl }, Mono / Scale .code:n = { - \xeCJK_set_monoscale: - \tl_set:Nx \l_xeCJK_monoscale_tl { Scale = { \fp_use:N \g_xeCJK_monoscale_fp } } + \@@_set_monoscale: + \tl_set:Nx \l_@@_monoscale_tl { Scale = { \fp_use:N \g_@@_monoscale_fp } } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_init:} +% \begin{macro}[internal]{\@@_set_init:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_init: +\cs_new_protected_nopar:Npn \@@_set_init: { - \tl_clear:N \l_xeCJK_monoscale_tl - \int_gincr:N \g_xeCJK_fontspec_int - \prop_clear:N \l_xeCJK_add_font_prop - \prop_map_inline:Nn \g_xeCJK_features_id_prop + \tl_clear:N \l_@@_monoscale_tl + \int_gincr:N \g_@@_fontspec_int + \prop_clear:N \l_@@_add_font_prop + \prop_map_inline:Nn \g_@@_features_id_prop { - \tl_clear:c { l_xeCJK_fontname_##1_tl } - \clist_clear:c { l_xeCJK_fontfeat_##1_clist } + \tl_clear:c { l_@@_fontname_##1_tl } + \clist_clear:c { l_@@_fontfeat_##1_clist } } - \clist_clear:N \l_xeCJK_pass_features_clist - \clist_clear:N \l_xeCJK_sub_key_clist - \clist_map_inline:Nn \g_xeCJK_sub_key_clist + \clist_clear:N \l_@@_pass_features_clist + \clist_clear:N \l_@@_sub_key_clist + \clist_map_inline:Nn \g_@@_sub_key_clist { - \bool_set_false:c { l_xeCJK_copy_##1_bool } - \bool_set_false:c { l_xeCJK_add_##1_bool } + \bool_set_false:c { l_@@_copy_##1_bool } + \bool_set_false:c { l_@@_add_##1_bool } } - \bool_set_eq:NN \l_xeCJK_AutoFakeBold_bool \g_xeCJK_AutoFakeBold_bool - \bool_set_eq:NN \l_xeCJK_AutoFakeSlant_bool \g_xeCJK_AutoFakeSlant_bool - \fp_set_eq:NN \l_xeCJK_EmboldenFactor_fp \g_xeCJK_EmboldenFactor_fp - \fp_set_eq:NN \l_xeCJK_SlantFactor_fp \g_xeCJK_SlantFactor_fp + \bool_set_eq:NN \l_@@_AutoFakeBold_bool \g_@@_AutoFakeBold_bool + \bool_set_eq:NN \l_@@_AutoFakeSlant_bool \g_@@_AutoFakeSlant_bool + \fp_set_eq:NN \l_@@_EmboldenFactor_fp \g_@@_EmboldenFactor_fp + \fp_set_eq:NN \l_@@_SlantFactor_fp \g_@@_SlantFactor_fp } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_family:nnn} +% \begin{macro}[internal]{\xeCJK_set_family:xnn} % 设置一个 CJK 新字体族,与 |\newfontfamily| 类似,增加 |FallBack| 选项。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_family:nnn #1#2#3 +\cs_new_protected_nopar:Npn \xeCJK_set_family:xnn #1#2#3 { \group_begin: - \xeCJK_set_init: - \tl_set:Nx \l_xeCJK_family_tl {#1} - \clist_set:Nx \l_xeCJK_fontoptions_clist {#2} - \tl_set:Nx \l_xeCJK_fontname_tl {#3} + \@@_set_init: + \tl_set:Nx \l_@@_family_tl {#1} + \clist_set:Nx \l_@@_fontoptions_clist {#2} + \tl_set:Nx \l_@@_fontname_tl {#3} \keys_set_known:nxN { xeCJK / features } - { \g_xeCJK_default_features_clist, #2 } \l_xeCJK_pass_features_clist - \xeCJK_parse_features: - \xeCJK_pass_features: - \xeCJK_check_family:V \l_xeCJK_family_tl - \cs_gset_protected_nopar:cpx { xeCJK/family/\l_xeCJK_family_tl } + { \g_@@_default_features_clist, #2 } \l_@@_pass_features_clist + \@@_parse_features: + \@@_pass_features: + \@@_check_family:V \l_@@_family_tl + \cs_gset_protected_nopar:cpx { @@/family/\l_@@_family_tl } { - \exp_not:n { \fontspec_set_family:Nnn \l_xeCJK_fontspec_family_tl } - { \l_xeCJK_pass_features_clist } { \l_xeCJK_fontname_tl } - \prop_gput:NnV \exp_not:N \g_xeCJK_family_name_prop - { \l_xeCJK_family_tl } \exp_not:N \l_xeCJK_fontspec_family_tl - \cs_gset_protected_nopar:cpx { xeCJK/family/\l_xeCJK_family_tl } + \exp_not:n { \fontspec_set_family:Nnn \l_@@_fontspec_family_tl } + { \l_@@_pass_features_clist } { \l_@@_fontname_tl } + \prop_gput:NnV \exp_not:N \g_@@_family_name_prop + { \l_@@_family_tl } \exp_not:N \l_@@_fontspec_family_tl + \cs_gset_protected_nopar:cpx { @@/family/\l_@@_family_tl } \exp_not:n { { \exp_not:N \fontencoding { \g_fontspec_encoding_tl } - \exp_not:N \fontfamily { \l_xeCJK_fontspec_family_tl } + \exp_not:N \fontfamily { \l_@@_fontspec_family_tl } \exp_not:N \selectfont } } } - \xeCJK_save_family_info: - \xeCJK_add_sub_block: + \@@_save_family_info: + \@@_add_sub_block: \group_end: } -\cs_generate_variant:Nn \xeCJK_set_family:nnn { ncc } +\cs_generate_variant:Nn \xeCJK_set_family:xnn { xcc } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_check_family:n} +% \begin{macro}[internal]{\@@_check_family:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_check_family:n #1 +\cs_new_protected_nopar:Npn \@@_check_family:n #1 { - \prop_get:NnNT \g_xeCJK_family_prop {#1} \l_xeCJK_tmpa_tl + \prop_get:NnNT \g_@@_family_prop {#1} \l_@@_tmpa_tl { - \prop_gpop:NnNT \g_xeCJK_family_name_prop {#1} \l_xeCJK_tmpa_tl { } - \xeCJK_warning:nxx { CJKfamily-redef } {#1} \l_xeCJK_tmpa_tl + \prop_gpop:NnNT \g_@@_family_name_prop {#1} \l_@@_tmpa_tl { } + \@@_warning:nxx { CJKfamily-redef } {#1} \l_@@_tmpa_tl } } -\cs_generate_variant:Nn \xeCJK_check_family:n { V } -\xeCJK_msg_new:nn { CJKfamily-redef } { Redefining~CJKfamily~`#1'~(#2). } +\cs_generate_variant:Nn \@@_check_family:n { V } +\@@_msg_new:nn { CJKfamily-redef } { Redefining~CJKfamily~`#1'~(#2). } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_add_font:nn,\xeCJK_add_font_if_new:nn} +% \begin{macro}[internal]{\@@_add_font:nn,\@@_add_font_if_new:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_add_font:nn #1#2 +\cs_new_protected_nopar:Npn \@@_add_font:nn #1#2 { - \prop_put:Nxx \l_xeCJK_add_font_prop - { \xeCJK_map_features_id:n {#1} Font } {#2} + \prop_put:Nxx \l_@@_add_font_prop + { \@@_map_features_id:n {#1} Font } {#2} } -\cs_new_protected_nopar:Npn \xeCJK_add_font_if_new:nn #1#2 +\cs_new_protected_nopar:Npn \@@_add_font_if_new:nn #1#2 { - \prop_put_if_new:Nxx \l_xeCJK_add_font_prop - { \xeCJK_map_features_id:n {#1} Font } {#2} + \prop_put_if_new:Nxx \l_@@_add_font_prop + { \@@_map_features_id:n {#1} Font } {#2} } -\cs_generate_variant:Nn \xeCJK_add_font:nn { nx, nc, nV, nv } -\cs_generate_variant:Nn \xeCJK_add_font_if_new:nn { nx, nc, nV, nv } +\cs_generate_variant:Nn \@@_add_font:nn { nx, nc, nV, nv } +\cs_generate_variant:Nn \@@_add_font_if_new:nn { nx, nc, nV, nv } % \end{macrocode} % \end{macro} % @@ -3304,59 +3345,59 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \cs_generate_variant:Nn \prop_put_if_new:Nnn { Nxx } % \end{macrocode} % -% \begin{macro}[internal]{\xeCJK_add_fake_bold:n,\xeCJK_add_fake_slant:n} +% \begin{macro}[internal]{\@@_add_fake_bold:n,\@@_add_fake_slant:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_add_fake_bold:n #1 +\cs_new_protected_nopar:Npn \@@_add_fake_bold:n #1 { - \clist_put_left:cx { l_xeCJK_fontfeat_#1_clist } - { FakeBold = { \fp_use:N \l_xeCJK_EmboldenFactor_fp } } + \clist_put_left:cx { l_@@_fontfeat_#1_clist } + { FakeBold = { \fp_use:N \l_@@_EmboldenFactor_fp } } } -\cs_new_protected_nopar:Npn \xeCJK_add_fake_slant:n #1 +\cs_new_protected_nopar:Npn \@@_add_fake_slant:n #1 { - \clist_put_left:cx { l_xeCJK_fontfeat_#1_clist } - { FakeSlant = { \fp_use:N \l_xeCJK_SlantFactor_fp } } + \clist_put_left:cx { l_@@_fontfeat_#1_clist } + { FakeSlant = { \fp_use:N \l_@@_SlantFactor_fp } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_parse_features:,\xeCJK_parse_features:n} +% \begin{macro}[internal]{\@@_parse_features:,\@@_parse_features:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_parse_features: - { \prop_map_inline:Nn \g_xeCJK_features_id_prop { \xeCJK_parse_features:n {##1} } } -\cs_new_protected_nopar:Npn \xeCJK_parse_features:n #1 +\cs_new_protected_nopar:Npn \@@_parse_features: + { \prop_map_inline:Nn \g_@@_features_id_prop { \@@_parse_features:n {##1} } } +\cs_new_protected_nopar:Npn \@@_parse_features:n #1 { - \xeCJK_if_font_select:nTF {#1} + \@@_if_font_select:nTF {#1} { - \xeCJK_add_font:nv {#1} { l_xeCJK_fontname_#1_tl } - \xeCJK_if_it_or_sl:nTF {#1} + \@@_add_font:nv {#1} { l_@@_fontname_#1_tl } + \@@_if_it_or_sl:nTF {#1} { - \xeCJK_if_font_select:nF {bf#1} - { \xeCJK_add_font_if_new:nv {bf#1} { l_xeCJK_fontname_#1_tl } } + \@@_if_font_select:nF {bf#1} + { \@@_add_font_if_new:nv {bf#1} { l_@@_fontname_#1_tl } } } { \str_if_eq_x:nnT {#1} {bf} { \clist_map_inline:nn { it , sl } { - \xeCJK_if_font_select:nF {bf##1} - { \xeCJK_add_font:nV {bf##1} \l_xeCJK_fontname_bf_tl } + \@@_if_font_select:nF {bf##1} + { \@@_add_font:nV {bf##1} \l_@@_fontname_bf_tl } } } } } - { \xeCJK_set_fake:n {#1} } + { \@@_set_fake:n {#1} } } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_font_select:n,\xeCJK_if_it_or_sl:n} +% \begin{macro}[pTF,internal]{\@@_if_font_select:n,\@@_if_it_or_sl:n} % \begin{macrocode} -\prg_new_conditional:Npnn \xeCJK_if_font_select:n #1 { p, T, F, TF } +\prg_new_conditional:Npnn \@@_if_font_select:n #1 { p, T, F, TF } { - \exp_args:Nc \xeCJK_if_blank_x:nTF { l_xeCJK_fontname_#1_tl } + \exp_args:Nc \@@_if_blank_x:nTF { l_@@_fontname_#1_tl } \prg_return_false: \prg_return_true: } -\prg_new_conditional:Npnn \xeCJK_if_it_or_sl:n #1 { p, T, F, TF } +\prg_new_conditional:Npnn \@@_if_it_or_sl:n #1 { p, T, F, TF } { \bool_if:nTF { \str_if_eq_x_p:nn { it } {#1} || \str_if_eq_x_p:nn { sl } {#1} } \prg_return_true: \prg_return_false: @@ -3364,227 +3405,227 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_fake:n} +% \begin{macro}[internal]{\@@_set_fake:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_fake:n #1 +\cs_new_protected_nopar:Npn \@@_set_fake:n #1 { \str_if_eq_x:nnTF {#1} { bf } - { \bool_if:NT \l_xeCJK_AutoFakeBold_bool { \xeCJK_add_fake_bold:n {#1} } } + { \bool_if:NT \l_@@_AutoFakeBold_bool { \@@_add_fake_bold:n {#1} } } { - \bool_if:NTF \l_xeCJK_AutoFakeSlant_bool + \bool_if:NTF \l_@@_AutoFakeSlant_bool { \bool_if:nT - { \xeCJK_if_it_or_sl_p:n {#1} || - ( \str_if_eq_x_p:nn {#1} {bfit} && ! ( \xeCJK_if_font_select_p:n {it} ) ) || - ( \str_if_eq_x_p:nn {#1} {bfsl} && ! ( \xeCJK_if_font_select_p:n {sl} ) ) + { \@@_if_it_or_sl_p:n {#1} || + ( \str_if_eq_x_p:nn {#1} {bfit} && ! ( \@@_if_font_select_p:n {it} ) ) || + ( \str_if_eq_x_p:nn {#1} {bfsl} && ! ( \@@_if_font_select_p:n {sl} ) ) } - { \xeCJK_add_fake_slant:n {#1} } + { \@@_add_fake_slant:n {#1} } } - { \xeCJK_if_it_or_sl:nT {#1} { \xeCJK_map_it_sl:n {#1} } } + { \@@_if_it_or_sl:nT {#1} { \@@_map_it_sl:n {#1} } } \bool_if:nT - { \l_xeCJK_AutoFakeBold_bool - && ! ( \xeCJK_if_it_or_sl_p:n {#1} ) - && ! ( \xeCJK_if_font_select_p:n {bf} ) + { \l_@@_AutoFakeBold_bool + && ! ( \@@_if_it_or_sl_p:n {#1} ) + && ! ( \@@_if_font_select_p:n {bf} ) } - { \xeCJK_add_fake_bold:n {#1} } + { \@@_add_fake_bold:n {#1} } } - \xeCJK_add_font_if_new:nn {#1} * + \@@_add_font_if_new:nn {#1} * } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_map_it_sl:n} +% \begin{macro}[internal]{\@@_map_it_sl:n} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_map_it_sl:n #1 +\cs_new_protected_nopar:Npn \@@_map_it_sl:n #1 { - \xeCJK_if_map_font_select:nT {#1} + \@@_if_map_font_select:nT {#1} { - \xeCJK_add_font:nx {#1} { \xeCJK_get_map_font:n {#1} } - \xeCJK_if_font_select:nF {bf#1} - { \xeCJK_add_font_if_new:nx {bf#1} { \xeCJK_get_map_font:n {#1} } } + \@@_add_font:nx {#1} { \@@_get_map_font:n {#1} } + \@@_if_font_select:nF {bf#1} + { \@@_add_font_if_new:nx {bf#1} { \@@_get_map_font:n {#1} } } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_get_map_font:n} +% \begin{macro}[internal]{\@@_get_map_font:n} % \begin{macrocode} -\cs_new_nopar:Npn \xeCJK_get_map_font:n #1 - { \tl_use:c { l_xeCJK_fontname_\str_if_eq_x:nnTF {#1} {it} {sl} {it} _tl } } +\cs_new_nopar:Npn \@@_get_map_font:n #1 + { \tl_use:c { l_@@_fontname_\str_if_eq_x:nnTF {#1} {it} {sl} {it} _tl } } % \end{macrocode} % \end{macro} % -% \begin{macro}[pTF,internal]{\xeCJK_if_map_font_select:n} +% \begin{macro}[pTF,internal]{\@@_if_map_font_select:n} % \begin{macrocode} -\prg_new_conditional:Npnn \xeCJK_if_map_font_select:n #1 { p, T, F, TF } +\prg_new_conditional:Npnn \@@_if_map_font_select:n #1 { p, T, F, TF } { - \xeCJK_if_blank_x:nTF { \xeCJK_get_map_font:n {#1} } + \@@_if_blank_x:nTF { \@@_get_map_font:n {#1} } \prg_return_false: \prg_return_true: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_pass_features:} +% \begin{macro}[internal]{\@@_pass_features:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_pass_features: +\cs_new_protected_nopar:Npn \@@_pass_features: { - \prop_map_inline:Nn \g_xeCJK_features_id_prop + \prop_map_inline:Nn \g_@@_features_id_prop { - \clist_if_empty:cF { l_xeCJK_fontfeat_##1_clist } + \clist_if_empty:cF { l_@@_fontfeat_##1_clist } { - \clist_put_right:Nx \l_xeCJK_pass_features_clist - { ##2Features = { \tl_use:c { l_xeCJK_fontfeat_##1_clist } } } + \clist_put_right:Nx \l_@@_pass_features_clist + { ##2Features = { \tl_use:c { l_@@_fontfeat_##1_clist } } } } } - \prop_map_inline:Nn \l_xeCJK_add_font_prop - { \clist_put_right:Nx \l_xeCJK_pass_features_clist { ##1 = { ##2 } } } - \xeCJK_if_blank_x:nF \l_xeCJK_monoscale_tl - { \clist_put_right:Nx \l_xeCJK_pass_features_clist \l_xeCJK_monoscale_tl } + \prop_map_inline:Nn \l_@@_add_font_prop + { \clist_put_right:Nx \l_@@_pass_features_clist { ##1 = { ##2 } } } + \@@_if_blank_x:nF \l_@@_monoscale_tl + { \clist_put_right:Nx \l_@@_pass_features_clist \l_@@_monoscale_tl } } % \end{macrocode} % \end{macro} % % \begin{macro}[internal,var] -% {\g_xeCJK_family_prop,\g_xeCJK_family_name_prop,\g_xeCJK_family_options_prop} +% {\g_@@_family_prop,\g_@@_family_name_prop,\g_@@_family_options_prop} % \begin{macrocode} -\prop_new:N \g_xeCJK_family_prop -\prop_new:N \g_xeCJK_family_name_prop -\prop_new:N \g_xeCJK_family_options_prop +\prop_new:N \g_@@_family_prop +\prop_new:N \g_@@_family_name_prop +\prop_new:N \g_@@_family_options_prop % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_save_family_info:} +% \begin{macro}[internal]{\@@_save_family_info:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_save_family_info: +\cs_new_protected_nopar:Npn \@@_save_family_info: { \group_begin: - \clist_map_inline:Nn \g_xeCJK_CJK_subclass_clist + \clist_map_inline:Nn \g_@@_CJK_subclass_clist { - \clist_remove_all:Nn \l_xeCJK_fontoptions_clist {##1} - \clist_remove_all:Nn \l_xeCJK_fontoptions_clist { ##1 = } + \clist_remove_all:Nn \l_@@_fontoptions_clist {##1} + \clist_remove_all:Nn \l_@@_fontoptions_clist { ##1 = } } - \prop_gput:NVV \g_xeCJK_family_prop \l_xeCJK_family_tl \l_xeCJK_fontname_tl - \prop_gput:NVV \g_xeCJK_family_options_prop \l_xeCJK_family_tl \l_xeCJK_fontoptions_clist + \prop_gput:NVV \g_@@_family_prop \l_@@_family_tl \l_@@_fontname_tl + \prop_gput:NVV \g_@@_family_options_prop \l_@@_family_tl \l_@@_fontoptions_clist \group_end: } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_add_sub_block:} +% \begin{macro}[internal]{\@@_add_sub_block:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_add_sub_block: +\cs_new_protected_nopar:Npn \@@_add_sub_block: { - \clist_remove_duplicates:N \l_xeCJK_sub_key_clist - \clist_map_inline:Nn \l_xeCJK_sub_key_clist + \clist_remove_duplicates:N \l_@@_sub_key_clist + \clist_map_inline:Nn \l_@@_sub_key_clist { - \tl_set:Nx \l_xeCJK_sub_family_tl { \l_xeCJK_family_tl/##1 } - \bool_if:cT { l_xeCJK_copy_##1_bool } + \tl_set:Nx \l_@@_sub_family_tl { \l_@@_family_tl/##1 } + \bool_if:cT { l_@@_copy_##1_bool } { - \xeCJK_check_family:V \l_xeCJK_sub_family_tl - \prop_get:NVNT \g_xeCJK_family_prop \l_xeCJK_family_tl \l_xeCJK_tmpa_tl - { \prop_gput:NVV \g_xeCJK_family_prop \l_xeCJK_sub_family_tl \l_xeCJK_tmpa_tl } - \prop_get:NVNT \g_xeCJK_family_options_prop \l_xeCJK_family_tl \l_xeCJK_tmpa_clist + \@@_check_family:V \l_@@_sub_family_tl + \prop_get:NVNT \g_@@_family_prop \l_@@_family_tl \l_@@_tmpa_tl + { \prop_gput:NVV \g_@@_family_prop \l_@@_sub_family_tl \l_@@_tmpa_tl } + \prop_get:NVNT \g_@@_family_options_prop \l_@@_family_tl \l_@@_tmpa_clist { - \clist_remove_all:Nn \l_xeCJK_tmpa_clist { ##1 = * } - \prop_gput:NVV \g_xeCJK_family_options_prop \l_xeCJK_sub_family_tl \l_xeCJK_tmpa_clist + \clist_remove_all:Nn \l_@@_tmpa_clist { ##1 = * } + \prop_gput:NVV \g_@@_family_options_prop \l_@@_sub_family_tl \l_@@_tmpa_clist } - \cs_gset_protected_nopar:cpx { xeCJK/family/\l_xeCJK_sub_family_tl } + \cs_gset_protected_nopar:cpx { @@/family/\l_@@_sub_family_tl } { - \xeCJK_family_if_exist:xT { \l_xeCJK_family_tl } + \@@_family_if_exist:xT { \l_@@_family_tl } { - \prop_get:NnNT \exp_not:N \g_xeCJK_family_name_prop - { \l_xeCJK_family_tl } \exp_not:N \l_xeCJK_tmpa_tl + \prop_get:NnNT \exp_not:N \g_@@_family_name_prop + { \l_@@_family_tl } \exp_not:N \l_@@_tmpa_tl { - \prop_gput:NnV \exp_not:N \g_xeCJK_family_name_prop - { \l_xeCJK_sub_family_tl } \exp_not:N \l_xeCJK_tmpa_tl - \cs_gset_protected_nopar:cpx { xeCJK/family/\l_xeCJK_sub_family_tl } + \prop_gput:NnV \exp_not:N \g_@@_family_name_prop + { \l_@@_sub_family_tl } \exp_not:N \l_@@_tmpa_tl + \cs_gset_protected_nopar:cpx { @@/family/\l_@@_sub_family_tl } \exp_not:n { { \exp_not:N \fontencoding { \g_fontspec_encoding_tl } - \exp_not:N \fontfamily { \l_xeCJK_tmpa_tl } + \exp_not:N \fontfamily { \l_@@_tmpa_tl } \exp_not:N \selectfont } } } } } } - \bool_if:cT { l_xeCJK_add_##1_bool } + \bool_if:cT { l_@@_add_##1_bool } { - \xeCJK_set_family:ncc \l_xeCJK_sub_family_tl - { l_xeCJK_##1_fontfeat_clist } { l_xeCJK_##1_fontname_tl } + \xeCJK_set_family:xcc \l_@@_sub_family_tl + { l_@@_##1_fontfeat_clist } { l_@@_##1_fontname_tl } } } } % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_copy_family:nn} +% \begin{macro}[internal]{\@@_copy_family:nn} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_copy_family:nn #1#2 +\cs_new_protected_nopar:Npn \@@_copy_family:nn #1#2 { - \xeCJK_family_if_exist:xT {#2} + \@@_family_if_exist:xT {#2} { \tl_map_inline:nn - { \g_xeCJK_family_prop \g_xeCJK_family_options_prop \g_xeCJK_family_name_prop } - { \prop_get:NnNT ##1 {#2} \l_xeCJK_tmpa_tl { \prop_gput:NnV ##1 {#1} \l_xeCJK_tmpa_tl } } - \cs_gset_eq:cc { xeCJK/family/#1 } { xeCJK/family/#2 } + { \g_@@_family_prop \g_@@_family_options_prop \g_@@_family_name_prop } + { \prop_get:NnNT ##1 {#2} \l_@@_tmpa_tl { \prop_gput:NnV ##1 {#1} \l_@@_tmpa_tl } } + \cs_gset_eq:cc { @@/family/#1 } { @@/family/#2 } } } -\cs_generate_variant:Nn \xeCJK_copy_family:nn { xx } +\cs_generate_variant:Nn \@@_copy_family:nn { xx } % \end{macrocode} % \end{macro} % % \subsection{字体切换} % -% \begin{macro}[internal]{\l_xeCJK_font_coor_tl,\xeCJK_select_font:,\xeCJK_switch_font:nn} +% \begin{macro}[internal]{\l_@@_font_coor_tl,\xeCJK_select_font:,\@@_switch_font:nn} % 缓存当前字体的原始格式,以加速编译。 % \begin{macrocode} -\tl_set:Nn \l_xeCJK_font_coor_tl { xeCJK/\xeCJK@family/\f@series/\f@shape/\f@size } +\tl_set:Nn \l_@@_font_coor_tl { @@/\l_xeCJK_family_tl/\f@series/\f@shape/\f@size } \cs_new_protected_nopar:Npn \xeCJK_select_font: { - \cs_if_exist_use:cF { \l_xeCJK_font_coor_tl } + \cs_if_exist_use:cF { \l_@@_font_coor_tl } { - \tl_set:Nx \l_xeCJK_current_coor_tl \l_xeCJK_font_coor_tl - \xeCJK_family_if_exist:xTF { \xeCJK@family } - { \use:c { xeCJK/family/\xeCJK@family } } + \tl_set:Nx \l_@@_current_coor_tl \l_@@_font_coor_tl + \@@_family_if_exist:xTF { \l_xeCJK_family_tl } + { \use:c { @@/family/\l_xeCJK_family_tl } } { \use_none:nnnn } - \exp_last_unbraced:NNV \cs_gset_eq:cN \l_xeCJK_current_coor_tl \tex_font:D + \exp_last_unbraced:NNV \cs_gset_eq:cN \l_@@_current_coor_tl \tex_font:D } } \cs_new_eq:NN \xeCJK@setfont \xeCJK_select_font: -\cs_new_protected_nopar:Npn \xeCJK_switch_font:nn #1#2 +\cs_new_protected_nopar:Npn \@@_switch_font:nn #1#2 { \str_if_eq_x:nnF {#1} {#2} { - \xeCJK_info:nxx { CJK-block } {#1} {#2} - \tl_remove_all:Nn \xeCJK@family { /#1 } + \@@_info:nxx { CJK-block } {#1} {#2} + \tl_remove_all:Nn \l_xeCJK_family_tl { /#1 } \str_if_eq_x:nnF {#2} { CJK } { - \tl_set:Nx \l_xeCJK_tmpa_tl \xeCJK@family - \tl_put_right:Nx \xeCJK@family { /#2 } - \xeCJK_family_if_exist:xF \xeCJK@family + \tl_set:Nx \l_@@_tmpa_tl \l_xeCJK_family_tl + \tl_put_right:Nx \l_xeCJK_family_tl { /#2 } + \@@_family_if_exist:xF \l_xeCJK_family_tl { - \xeCJK_family_if_exist:xTF { \CJKfamilydefault/#2 } - { \xeCJK_copy_family:xx \xeCJK@family { \CJKfamilydefault/#2 } } - { \xeCJK_copy_family:xx \xeCJK@family \l_xeCJK_tmpa_tl } + \@@_family_if_exist:xTF { \CJKfamilydefault/#2 } + { \@@_copy_family:xx \l_xeCJK_family_tl { \CJKfamilydefault/#2 } } + { \@@_copy_family:xx \l_xeCJK_family_tl \l_@@_tmpa_tl } } } } \xeCJK_select_font: } -\xeCJK_msg_new:nn { CJK-block } { Switch~from~block~'#1'~to~'#2'. } +\@@_msg_new:nn { CJK-block } { Switch~from~block~'#1'~to~'#2'. } % \end{macrocode} % \end{macro} % -% \begin{macro}[TF,internal]{\xeCJK_family_if_exist:x} +% \begin{macro}[TF,internal]{\@@_family_if_exist:x} % \begin{macrocode} -\prg_new_protected_conditional:Npnn \xeCJK_family_if_exist:x #1 { T, F, TF } +\prg_new_protected_conditional:Npnn \@@_family_if_exist:x #1 { T, F, TF } { - \cs_if_free:cTF { xeCJK/family/#1 } + \cs_if_free:cTF { @@/family/#1 } { \prg_return_false: } { - \prop_get:NxNF \g_xeCJK_family_name_prop {#1} \l_xeCJK_family_name_tl - { \use:c { xeCJK/family/#1 } } + \prop_get:NxNF \g_@@_family_name_prop {#1} \l_@@_family_name_tl + { \use:c { @@/family/#1 } } \prg_return_true: } } @@ -3597,19 +3638,19 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \CJKfamily { m } { - \cs_if_exist:cTF { xeCJK/family/#1 } - { \tl_set:Nx \xeCJK@family {#1} } + \cs_if_exist:cTF { @@/family/#1 } + { \tl_set:Nx \l_xeCJK_family_tl {#1} } { - \seq_if_in:NxF \g_xeCJK_unknown_family_seq {#1} + \seq_if_in:NxF \g_@@_unknown_family_seq {#1} { - \seq_gput_right:Nx \g_xeCJK_unknown_family_seq {#1} - \xeCJK_warning:nx { CJKfamily-Unknown } {#1} + \seq_gput_right:Nx \g_@@_unknown_family_seq {#1} + \@@_warning:nx { CJKfamily-Unknown } {#1} } } \tex_ignorespaces:D } -\seq_new:N \g_xeCJK_unknown_family_seq -\xeCJK_msg_new:nn { CJKfamily-Unknown } +\seq_new:N \g_@@_unknown_family_seq +\@@_msg_new:nn { CJKfamily-Unknown } { Unknown~CJK~family~'#1'~is~ignored.\\\\ Try~to~use~ @@ -3629,29 +3670,27 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 分别用于预声明 CJK 字体和随机调用 CJK 字体。 % \begin{macrocode} \NewDocumentCommand \setCJKfamilyfont { m O{} m } - { \xeCJK_set_family:nnn {#1} {#2} {#3} } + { \xeCJK_set_family:xnn {#1} {#2} {#3} } \NewDocumentCommand \newCJKfontfamily { o m O{} m } { - \IfNoValueTF {#1} - { \tl_set:Nx \l_xeCJK_family_tl { \cs_to_str:N #2 } } - { \tl_set:Nx \l_xeCJK_family_tl {#1} } - \xeCJK_set_family:nnn \l_xeCJK_family_tl {#3} {#4} - \cs_new_protected_nopar:Npx #2 { \exp_not:N \CJKfamily { \l_xeCJK_family_tl } } + \tl_set:Nx \l_@@_family_tl { \IfNoValueTF {#1} { \cs_to_str:N #2 } {#1} } + \xeCJK_set_family:xnn \l_@@_family_tl {#3} {#4} + \cs_new_protected_nopar:Npx #2 { \exp_not:N \CJKfamily { \l_@@_family_tl } } } -\int_new:N \g_xeCJK_fontspec_int -\int_gdecr:N \g_xeCJK_fontspec_int +\int_new:N \g_@@_fontspec_int +\int_gdecr:N \g_@@_fontspec_int \NewDocumentCommand \CJKfontspec { O{} m } { - \tl_set:Nx \l_xeCJK_CJKfontspec_id_tl { CJKfontspec/#1/#2/id } - \cs_if_free:cT \l_xeCJK_CJKfontspec_id_tl + \tl_set:Nx \l_@@_CJKfontspec_id_tl { CJKfontspec/#1/#2/id } + \cs_if_free:cT \l_@@_CJKfontspec_id_tl { - \int_gincr:N \g_xeCJK_fontspec_int - \tl_gset:Nx \g_xeCJK_family_spec_tl - { CJKfontspec ( \int_use:N \g_xeCJK_fontspec_int ) } - \xeCJK_set_family:nnn \g_xeCJK_family_spec_tl {#1} {#2} - \tl_gset:cx \l_xeCJK_CJKfontspec_id_tl \g_xeCJK_family_spec_tl + \int_gincr:N \g_@@_fontspec_int + \tl_gset:Nx \g_@@_family_spec_tl + { CJKfontspec ( \int_use:N \g_@@_fontspec_int ) } + \xeCJK_set_family:xnn \g_@@_family_spec_tl {#1} {#2} + \tl_gset:cx \l_@@_CJKfontspec_id_tl \g_@@_family_spec_tl } - \exp_args:Nv \CJKfamily \l_xeCJK_CJKfontspec_id_tl + \exp_args:Nv \CJKfamily \l_@@_CJKfontspec_id_tl \tex_ignorespaces:D } % \end{macrocode} @@ -3660,53 +3699,53 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macro}{\defaultCJKfontfeatures, \addCJKfontfeatures} % 分别用于设置 CJK 字体的默认属性和增加当前 CJK 字体的属性。 % \begin{macrocode} -\clist_new:N \g_xeCJK_default_features_clist +\clist_new:N \g_@@_default_features_clist \NewDocumentCommand \defaultCJKfontfeatures { m } - { \clist_gset:Nn \g_xeCJK_default_features_clist {#1} } + { \clist_gset:Nn \g_@@_default_features_clist {#1} } \defaultCJKfontfeatures { Script = CJK } \@onlypreamble \defaultCJKfontfeatures \NewDocumentCommand \addCJKfontfeatures { m } { - \prop_if_in:NVTF \g_xeCJK_family_prop \xeCJK@family + \prop_if_in:NVTF \g_@@_family_prop \l_xeCJK_family_tl { \group_begin: - \clist_set:Nx \l_xeCJK_tmpa_clist {#1} - \prop_get:NVN \g_xeCJK_family_prop \xeCJK@family \l_xeCJK_tmpa_tl - \clist_map_inline:Nn \g_xeCJK_CJK_subclass_clist + \clist_set:Nx \l_@@_tmpa_clist {#1} + \prop_get:NVN \g_@@_family_prop \l_xeCJK_family_tl \l_@@_tmpa_tl + \clist_map_inline:Nn \g_@@_CJK_subclass_clist { - \clist_if_in:NnT \l_xeCJK_tmpa_clist {##1} + \clist_if_in:NnT \l_@@_tmpa_clist {##1} { - \clist_remove_all:Nn \l_xeCJK_tmpa_clist {##1} - \prop_get:NxNF \g_xeCJK_family_prop { \xeCJK@family/##1 } \l_xeCJK_tmpb_tl + \clist_remove_all:Nn \l_@@_tmpa_clist {##1} + \prop_get:NxNF \g_@@_family_prop { \l_xeCJK_family_tl/##1 } \l_@@_tmpb_tl { - \prop_get:NxNF \g_xeCJK_family_prop - { \CJKfamilydefault/##1 } \l_xeCJK_tmpb_tl - { \tl_set:Nx \l_xeCJK_tmpb_tl \l_xeCJK_tmpa_tl } + \prop_get:NxNF \g_@@_family_prop + { \CJKfamilydefault/##1 } \l_@@_tmpb_tl + { \tl_set:Nx \l_@@_tmpb_tl \l_@@_tmpa_tl } } - \clist_set:Nx \l_xeCJK_tmpa_clist - { ##1 = { [ \l_xeCJK_tmpa_clist ] { \l_xeCJK_tmpb_tl } } } + \clist_set:Nx \l_@@_tmpa_clist + { ##1 = { [ \l_@@_tmpa_clist ] { \l_@@_tmpb_tl } } } \clist_map_break: } } - \prop_get:NVNF \g_xeCJK_family_options_prop \xeCJK@family \l_xeCJK_tmpb_clist - { \clist_clear:N \l_xeCJK_tmpb_clist } - \clist_clear:N \l_xeCJK_tmpc_clist - \clist_map_inline:Nn \l_xeCJK_tmpb_clist + \prop_get:NVNF \g_@@_family_options_prop \l_xeCJK_family_tl \l_@@_tmpb_clist + { \clist_clear:N \l_@@_tmpb_clist } + \clist_clear:N \l_@@_tmpc_clist + \clist_map_inline:Nn \l_@@_tmpb_clist { - \clist_if_in:NnF \l_xeCJK_tmpa_clist {##1} - { \clist_put_right:Nn \l_xeCJK_tmpc_clist {##1} } + \clist_if_in:NnF \l_@@_tmpa_clist {##1} + { \clist_put_right:Nn \l_@@_tmpc_clist {##1} } } - \clist_put_left:NV \l_xeCJK_tmpa_clist \l_xeCJK_tmpc_clist + \clist_put_left:NV \l_@@_tmpa_clist \l_@@_tmpc_clist \use:x - { \group_end: \exp_not:N \CJKfontspec [ \l_xeCJK_tmpa_clist ] { \l_xeCJK_tmpa_tl } } + { \group_end: \exp_not:N \CJKfontspec [ \l_@@_tmpa_clist ] { \l_@@_tmpa_tl } } } - { \xeCJK_warning:n { addCJKfontfeature-ignored } } + { \@@_warning:n { addCJKfontfeature-ignored } } \tex_ignorespaces:D } \cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures -\xeCJK_msg_new:nn { addCJKfontfeature-ignored } +\@@_msg_new:nn { addCJKfontfeature-ignored } { - \tl_to_str:N \addCJKfontfeature (s)~ignored.\\\\ + \token_to_str:N \addCJKfontfeature (s)~ignored.\\\\ It~cannot~be~used~with~a~font~that~wasn't~selected~by~xeCJK. } % \end{macrocode} @@ -3716,20 +3755,20 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 设置文档的 CJK 普通字体、无衬线字体。 % \begin{macrocode} \NewDocumentCommand \setCJKmainfont { O{} m } - { \xeCJK_set_family:nnn \CJKrmdefault {#1} {#2} } + { \xeCJK_set_family:xnn \CJKrmdefault {#1} {#2} } \cs_new_eq:NN \setCJKromanfont \setCJKmainfont \NewDocumentCommand \setCJKsansfont { O{} m } - { \xeCJK_set_family:nnn \CJKsfdefault {#1} {#2} } + { \xeCJK_set_family:xnn \CJKsfdefault {#1} {#2} } % \end{macrocode} % \end{macro} % % \begin{macro}{\CJKrmdefault,\CJKsfdefault,\CJKttdefault,\CJKfamilydefault} % \begin{macrocode} -\cs_if_free:NT \CJKrmdefault { \tl_set:Nn \CJKrmdefault { rm } } -\cs_if_free:NT \CJKsfdefault { \tl_set:Nn \CJKsfdefault { sf } } -\cs_if_free:NT \CJKttdefault { \tl_set:Nn \CJKttdefault { tt } } -\cs_if_free:NT \CJKfamilydefault { \tl_set:Nn \CJKfamilydefault { \CJKrmdefault } } -\tl_new:c { xeCJK/family/\CJKfamilydefault } +\tl_if_exist:NF \CJKrmdefault { \tl_set:Nn \CJKrmdefault { rm } } +\tl_if_exist:NF \CJKsfdefault { \tl_set:Nn \CJKsfdefault { sf } } +\tl_if_exist:NF \CJKttdefault { \tl_set:Nn \CJKttdefault { tt } } +\tl_if_exist:NF \CJKfamilydefault { \tl_set:Nn \CJKfamilydefault { \CJKrmdefault } } +\tl_new:c { @@/family/\CJKfamilydefault } % \end{macrocode} % \end{macro} % @@ -3761,15 +3800,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 设置 CJK 数学字体。 % \begin{macrocode} \NewDocumentCommand \setCJKmathfont { O{} m } - { \xeCJK_set_family:nnn \c_xeCJK_math_tl {#1} {#2} } + { \xeCJK_set_family:xnn \c_@@_math_tl {#1} {#2} } % \end{macrocode} % \end{macro} % % \begin{macro}{CJKmath} % 数学公式内的 CJK 字体。 % \begin{macrocode} -\tl_const:Nn \c_xeCJK_math_tl { CJKmath } -\keys_define:nn { xeCJK / options } { CJKmath .bool_gset:N = \g_xeCJK_math_bool } +\tl_const:Nn \c_@@_math_tl { CJKmath } +\keys_define:nn { xeCJK / options } { CJKmath .bool_gset:N = \g_@@_math_bool } % \end{macrocode} % \end{macro} % @@ -3777,42 +3816,42 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \xeCJKsetmathcode { m m m m } { - \xeCJK_check_num_range:nnNN {#1} {#2} \l_xeCJK_tmpa_int \l_xeCJK_tmpb_int - \int_set:Nn \l_xeCJK_tmpc_int { \xeCJK_math_type:n {#3} } - \loop - \XeTeXmathcode - \l_xeCJK_tmpa_int = \l_xeCJK_tmpc_int \use:c { sym #4 } \l_xeCJK_tmpa_int - \if_int_compare:w \l_xeCJK_tmpa_int < \l_xeCJK_tmpb_int - \int_incr:N \l_xeCJK_tmpa_int - \repeat + \@@_check_num_range:nnNN {#1} {#2} \l_@@_tmpa_int \l_@@_tmpb_int + \int_set:Nn \l_@@_tmpc_int { \@@_math_type:n {#3} } + \int_set:Nn \l_tmpa_int { \use:c { sym #4 } } + \@@_int_until_do:nn { \l_@@_tmpa_int > \l_@@_tmpb_int } + { + \XeTeXmathcode \l_@@_tmpa_int = \l_@@_tmpc_int \l_tmpa_int \l_@@_tmpa_int + \int_incr:N \l_@@_tmpa_int + } } -\cs_new_eq:NN \xeCJK_math_type:n \mathchar@type +\cs_new_eq:NN \@@_math_type:n \mathchar@type % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_mathfont:} +% \begin{macro}[internal]{\@@_set_mathfont:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_set_mathfont: +\cs_new_protected_nopar:Npn \@@_set_mathfont: { - \xeCJK_family_if_exist:xTF \c_xeCJK_math_tl - { \tl_set:Nx \l_xeCJK_tmpa_tl \c_xeCJK_math_tl } + \@@_family_if_exist:xTF \c_@@_math_tl + { \tl_set:Nx \l_@@_tmpa_tl \c_@@_math_tl } { - \xeCJK_family_if_exist:xTF \CJKfamilydefault - { \tl_set:Nx \l_xeCJK_tmpa_tl \CJKfamilydefault } - { \tl_set_eq:NN \l_xeCJK_tmpa_tl \q_no_value } + \@@_family_if_exist:xTF \CJKfamilydefault + { \tl_set:Nx \l_@@_tmpa_tl \CJKfamilydefault } + { \tl_set_eq:NN \l_@@_tmpa_tl \q_no_value } } - \prop_get:NVNT \g_xeCJK_family_name_prop \l_xeCJK_tmpa_tl \l_xeCJK_math_family_tl + \prop_get:NVNT \g_@@_family_name_prop \l_@@_tmpa_tl \l_@@_math_family_tl { - \DeclareSymbolFont \c_xeCJK_math_tl \g_fontspec_encoding_tl - \l_xeCJK_math_family_tl \mddefault \shapedefault - \SetSymbolFont \c_xeCJK_math_tl { bold } \g_fontspec_encoding_tl - \l_xeCJK_math_family_tl \bfdefault \shapedefault + \DeclareSymbolFont \c_@@_math_tl \g_fontspec_encoding_tl + \l_@@_math_family_tl \mddefault \shapedefault + \SetSymbolFont \c_@@_math_tl { bold } \g_fontspec_encoding_tl + \l_@@_math_family_tl \bfdefault \shapedefault \clist_map_inline:nn { CJK, FullLeft, FullRight } { - \clist_map_inline:cn { g_xeCJK_##1_range_clist } + \clist_map_inline:cn { g_@@_##1_range_clist } { - \xeCJK_set_char_class_aux:Nn \xeCJKsetmathcode {####1} - \mathalpha \c_xeCJK_math_tl + \@@_set_char_class_aux:Nn \xeCJKsetmathcode {####1} + \mathalpha \c_@@_math_tl } } } @@ -3822,14 +3861,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % 当没有设置 CJK 数学字体时,使用 |\CJKfamilydefault| 作为数学字体。 % \begin{macrocode} -\xeCJK_AtEndPreamble:n +\@@_AtEndPreamble:n { \normalfont - \prop_if_empty:NTF \g_xeCJK_family_prop - { \xeCJK_warning:n { no-CJKfamily } } - { \bool_if:NT \g_xeCJK_math_bool { \xeCJK_set_mathfont: } } + \prop_if_empty:NTF \g_@@_family_prop + { \@@_warning:n { no-CJKfamily } } + { \bool_if:NT \g_@@_math_bool { \@@_set_mathfont: } } } -\xeCJK_msg_new:nn { no-CJKfamily } +\@@_msg_new:nn { no-CJKfamily } { It~seems~that~you~have~not~declare~a~CJKfamily.\\ If~you~want~to~use~xeCJK~in~the~right~way,~you~should~use\\\\ @@ -3840,10 +3879,10 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \subsection{处理等宽字体和抄录环境} % -% \begin{macro}[internal,var]{\g_xeCJK_monoscale_fp,\g_xeCJK_exspace_dim} +% \begin{macro}[internal,var]{\g_@@_monoscale_fp,\g_@@_exspace_dim} % \begin{macrocode} -\fp_new:N \g_xeCJK_monoscale_fp -\dim_new:N \g_xeCJK_exspace_dim +\fp_new:N \g_@@_monoscale_fp +\dim_new:N \g_@@_exspace_dim % \end{macrocode} % \end{macro} % @@ -3852,14 +3891,14 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \NewDocumentCommand \setCJKmonoscale { } { \CJKflexiblespacing - \xeCJK_set_monoscale: - \addCJKfontfeatures { Scale = \fp_use:N \g_xeCJK_monoscale_fp } + \@@_set_monoscale: + \addCJKfontfeatures { Scale = \fp_use:N \g_@@_monoscale_fp } } -\cs_new_protected_nopar:Npn \xeCJK_set_monoscale: +\cs_new_protected_nopar:Npn \@@_set_monoscale: { \group_begin: \fontfamily \ttdefault \selectfont - \fp_gset:Nn \g_xeCJK_monoscale_fp + \fp_gset:Nn \g_@@_monoscale_fp { \dim_to_fp:n { \c_two \tex_fontdimen:D \c_two \tex_font:D } / ( \f@size ) } \group_end: } @@ -3868,12 +3907,12 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \begin{macro}{\setCJKmonoexspace} % \begin{macrocode} -\NewDocumentCommand \setCJKmonoexspace { } { \xeCJK_set_monoexspace: } -\cs_new_protected_nopar:Npn \xeCJK_set_monoexspace: +\NewDocumentCommand \setCJKmonoexspace { } { \@@_set_monoexspace: } +\cs_new_protected_nopar:Npn \@@_set_monoexspace: { \group_begin: \fontfamily \ttdefault \selectfont - \dim_gset:Nn \g_xeCJK_exspace_dim + \dim_gset:Nn \g_@@_exspace_dim { \c_two \tex_fontdimen:D \c_two \tex_font:D - \f@size \p@ } \group_end: } @@ -3884,39 +3923,39 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \begin{macrocode} \NewDocumentCommand \CJKfixedspacing { } { - \bool_if:NF \l_xeCJK_fixed_spacing_bool + \bool_if:NF \l_@@_fixed_spacing_bool { - \bool_set_true:N \l_xeCJK_fixed_spacing_bool - \tl_set_eq:NN \l_xeCJK_flexible_punctstyle_tl \l_xeCJK_punctstyle_tl - \bool_set_eq:NN \l_xeCJK_fixed_xecglue_bool \l_xeCJK_xecglue_bool - \cs_set_eq:NN \xeCJK_flexible_ecglue: \CJKecglue - \cs_set_eq:NN \xeCJK_flexible_cjkglue: \CJKglue - \xeCJK_set_monoexspace: + \bool_set_true:N \l_@@_fixed_spacing_bool + \tl_set_eq:NN \l_@@_flexible_punctstyle_tl \l_@@_punctstyle_tl + \bool_set_eq:NN \l_@@_fixed_xecglue_bool \l_@@_xecglue_bool + \cs_set_eq:NN \@@_flexible_ecglue: \CJKecglue + \cs_set_eq:NN \@@_flexible_cjkglue: \CJKglue + \@@_set_monoexspace: \xeCJKsetup { PunctStyle = plain , - CJKglue = { \skip_horizontal:N \g_xeCJK_exspace_dim } , - CJKecglue = { \skip_horizontal:n { .5\g_xeCJK_exspace_dim } } , + CJKglue = { \skip_horizontal:N \g_@@_exspace_dim } , + CJKecglue = { \skip_horizontal:n { .5\g_@@_exspace_dim } } , xCJKecglue = false , } } } \NewDocumentCommand \CJKflexiblespacing { } { - \bool_if:NT \l_xeCJK_fixed_spacing_bool + \bool_if:NT \l_@@_fixed_spacing_bool { - \bool_set_false:N \l_xeCJK_fixed_spacing_bool + \bool_set_false:N \l_@@_fixed_spacing_bool \exp_args:Nx \xeCJKsetup { - PunctStyle = { \l_xeCJK_flexible_punctstyle_tl } , - CJKglue = { \xeCJK_flexible_cjkglue: } , - CJKecglue = { \xeCJK_flexible_ecglue: } , - xCJKecglue = { \bool_if:NTF \l_xeCJK_fixed_xecglue_bool { true } { false } } , + PunctStyle = { \l_@@_flexible_punctstyle_tl } , + CJKglue = { \@@_flexible_cjkglue: } , + CJKecglue = { \@@_flexible_ecglue: } , + xCJKecglue = { \bool_if:NTF \l_@@_fixed_xecglue_bool { true } { false } } , } } } -\bool_new:N \l_xeCJK_fixed_spacing_bool -\xeCJK_AfterPreamble:n { \tl_put_right:Nn \verbatim@font \CJKfixedspacing } +\bool_new:N \l_@@_fixed_spacing_bool +\@@_AfterPreamble:n { \tl_put_right:Nn \verbatim@font \CJKfixedspacing } % \end{macrocode} % \end{macro} % @@ -3926,11 +3965,11 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \NewDocumentCommand \setCJKmonofont { s t+ O{} m } { \IfBooleanTF {#1} - { \xeCJK_set_family:nnn \CJKttdefault { Mono = Scale, #3 } {#4} } + { \xeCJK_set_family:xnn \CJKttdefault { Mono = Scale, #3 } {#4} } { \IfBooleanTF {#2} - { \xeCJK_set_family:nnn \CJKttdefault { Mono = Exspace, #3 } {#4} } - { \xeCJK_set_family:nnn \CJKttdefault {#3} {#4} } + { \xeCJK_set_family:xnn \CJKttdefault { Mono = Exspace, #3 } {#4} } + { \xeCJK_set_family:xnn \CJKttdefault {#3} {#4} } } } % \end{macrocode} @@ -3943,36 +3982,36 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 在 \pkg{xeCJK} 宏包调用的时候有效。并将 \pkg{xeCJK} 中未知的选项传递给 % \pkg{fontspec} 宏包。 % \begin{macrocode} -\bool_new:N \g_xeCJK_indent_bool +\bool_new:N \g_@@_indent_bool \keys_define:nn { xeCJK / options } { - CJKnumber .bool_set:N = \g_xeCJK_number_bool , - indentfirst .bool_set:N = \g_xeCJK_indent_bool , + CJKnumber .bool_set:N = \g_@@_number_bool , + indentfirst .bool_set:N = \g_@@_indent_bool , normalindentfirst .meta:n = { indentfirst = false } , quiet .code:n = { \msg_redirect_module:nnn { xeCJK } { warning } { info } \msg_redirect_module:nnn { xeCJK } { info } { none } - \xeCJK_if_package_loaded:nF { fontspec } + \@@_if_package_loaded:nF { fontspec } { \PassOptionsToPackage { quiet } { fontspec } } }, silent .code:n = { \msg_redirect_module:nnn { xeCJK } { warning } { none } \msg_redirect_module:nnn { xeCJK } { info } { none } - \xeCJK_if_package_loaded:nF { fontspec } + \@@_if_package_loaded:nF { fontspec } { \PassOptionsToPackage { silent } { fontspec } } }, unknown .code:n = { - \xeCJK_if_package_loaded:nTF { fontspec } - { \xeCJK_error:nx { key-unknown } { \l_keys_key_tl } } + \@@_if_package_loaded:nTF { fontspec } + { \@@_error:nx { key-unknown } { \l_keys_key_tl } } { \PassOptionsToPackage { \l_keys_key_tl } { fontspec } } }, } -\xeCJK_msg_new:nn { key-unknown } +\@@_msg_new:nn { key-unknown } { - Sorry,~but~\l__keys_module_tl\c_space_tl does~not~have~a~key~called~'#1'.\\\\ + Sorry,~but~\l__keys_module_tl \ does~not~have~a~key~called~'#1'.\\\\ The~key~'#1'~is~being~ignored. } % \end{macrocode} @@ -4016,7 +4055,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % \end{macrocode} % % \begin{macrocode} -\bool_if:NT \g_xeCJK_indent_bool +\bool_if:NT \g_@@_indent_bool { \cs_set_eq:NN \@afterindentfalse \@afterindenttrue \@afterindenttrue @@ -4059,76 +4098,89 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % \subsection{兼容性修补} % -% \begin{macro}[internal]{\xeCJK_fix_itcorr:} +% \begin{macro}[internal]{\@@_fix_itcorr:} % 修复倾斜校正。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_fix_itcorr: +\cs_new_protected_nopar:Npn \@@_fix_itcorr: { \scan_stop: - \xeCJK_if_last_node:nTF { default } + \@@_if_last_node:nTF { default } { \tex_unkern:D \tex_unkern:D - \xeCJK_itcorr_aux - { \xeCJK_make_node:n { default_itcorr } } + \@@_itcorr_aux + { \@@_make_node:n { default_itcorr } } } - { \xeCJK_itcorr_aux } + { \@@_itcorr_aux } } -\cs_new_eq:NN \xeCJK_itcorr_aux \/ +\cs_new_eq:NN \@@_itcorr_aux \/ \cs_set_protected_nopar:Npn \/ { \int_compare:nNnTF \XeTeXinterchartokenstate > \c_zero - { \xeCJK_fix_itcorr: } { \xeCJK_itcorr_aux } + { \@@_fix_itcorr: } { \@@_itcorr_aux } } +% \end{macrocode} +% +% \begin{macrocode} +%<@@=> +% \end{macrocode} +% +% \begin{macrocode} \cs_set_eq:NN \@@italiccorr \/ % \end{macrocode} +% +% \begin{macrocode} +%<@@=xeCJK> +% \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_set_others_toks:n,\xeCJK_Others_class} +% \begin{macro}[internal]{\@@_set_others_toks:n,\c_@@_Others_class_int} % 简单处理与同样使用 |\XeTeXinterchartoks| 机制的宏包的兼容问题。 % \begin{macrocode} -\xeCJK_AfterEndPreamble:n +\@@_AfterEndPreamble:n { \int_compare:nNnF - { \c_three + ( \seq_count:N \g_xeCJK_class_seq ) } = \xe@alloc@intercharclass + { \c_three + ( \seq_count:N \g_@@_class_seq ) } = \xe@alloc@intercharclass { \int_step_inline:nnnn \c_four \c_one \xe@alloc@intercharclass { - \seq_if_in:NnF \g_xeCJK_class_seq {#1} - { \xeCJK_set_others_toks:n {#1} } + \seq_if_in:NnF \g_@@_class_seq {#1} + { \@@_set_others_toks:n {#1} } } } } -\cs_new_protected_nopar:Npn \xeCJK_set_others_toks:n #1 +\cs_new_protected_nopar:Npn \@@_set_others_toks:n #1 { - \int_set:Nn \xeCJK_Others_class {#1} - \clist_map_inline:Nn \g_xeCJK_CJK_class_clist + \int_set:Nn \c_@@_Others_class_int {#1} + \clist_map_inline:Nn \g_@@_CJK_class_clist { - \xeCJK_copy_inter_class_toks:nnnn {##1} { Others } {##1} { NormalSpace } - \xeCJK_copy_inter_class_toks:nnnn { Others } {##1} { NormalSpace } {##1} - \exp_args:Nnnx \xeCJK_app_inter_class_toks:nnn {##1} { Others } - { \xeCJK_get_inter_class_toks:nn { Default } { Others } } - \exp_args:Nnnx \xeCJK_pre_inter_class_toks:nnn { Others } {##1} - { \xeCJK_get_inter_class_toks:nn { Others } { Default } } - \xeCJK_if_blank_x:nT { \xeCJK_get_inter_class_toks:nn { Others } { Boundary } } + \@@_copy_inter_class_toks:nnnn {##1} { Others } {##1} { NormalSpace } + \@@_copy_inter_class_toks:nnnn { Others } {##1} { NormalSpace } {##1} + \exp_args:Nnnx \@@_app_inter_class_toks:nnn {##1} { Others } + { \@@_get_inter_class_toks:nn { Default } { Others } } + \exp_args:Nnnx \@@_pre_inter_class_toks:nnn { Others } {##1} + { \@@_get_inter_class_toks:nn { Others } { Default } } + \@@_if_blank_x:nT + { \@@_get_inter_class_toks:nn { Others } { Boundary } } { - \xeCJK_copy_inter_class_toks:nnnn + \@@_copy_inter_class_toks:nnnn { Others } { Boundary } { Default } { Boundary } } - \xeCJK_if_blank_x:nT { \xeCJK_get_inter_class_toks:nn { Boundary } { Others } } + \@@_if_blank_x:nT + { \@@_get_inter_class_toks:nn { Boundary } { Others } } { - \xeCJK_copy_inter_class_toks:nnnn + \@@_copy_inter_class_toks:nnnn { Boundary } { Others } { Boundary } { Default } } } } -\int_new:N \xeCJK_Others_class +\int_new:N \c_@@_Others_class_int % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\xeCJK_patch:Nnn} +% \begin{macro}[internal]{\@@_patch:Nnn} % 给已有宏内容前后附加补丁。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_patch:Nnn #1#2#3 +\cs_new_protected_nopar:Npn \@@_patch:Nnn #1#2#3 { \tl_put_left:Nn #1 {#2} \tl_put_right:Nn #1 {#3} } % \end{macrocode} % \end{macro} @@ -4136,7 +4188,7 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % 单独处理宽度有分歧的几个标点:包括省略号、破折号、间隔号、引号等中西文混用的 % 符号, 保证其命令形式输出的是西文字体。并对一些编码的符号宏包做特殊处理。 % \begin{macrocode} -\xeCJK_AfterPreamble:n +\@@_AfterPreamble:n { \tl_map_inline:nn { @@ -4144,41 +4196,38 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ \textquoteleft \textquoteright \textquotedblleft \textquotedblright } { - \xeCJK_patch:Nnn #1 - { \xeCJK_group_begin: \makexeCJKinactive } - { \xeCJK_group_end: } + \@@_patch:Nnn #1 + { \@@_group_begin: \makexeCJKinactive } + { \@@_group_end: } } - \xeCJK_patch:Nnn \tipaencoding { \makexeCJKinactive } { } - \cs_set_eq:NN \xeCJK_aux_r \r - \cs_set_protected_nopar:Npn \r #1 { { \makexeCJKinactive \xeCJK_aux_r {#1} } } - \xeCJK_if_package_loaded:nT { pifont } + \@@_patch:Nnn \tipaencoding { \makexeCJKinactive } { } + \cs_set_eq:NN \@@_aux_r \r + \cs_set_protected_nopar:Npn \r #1 { { \makexeCJKinactive \@@_aux_r {#1} } } + \@@_if_package_loaded:nT { pifont } { \RenewDocumentCommand \Pifont { m } - { - \fontencoding {U} \fontfamily {#1} \fontseries {m} \fontshape {n} - \selectfont \makexeCJKinactive - } + { \makexeCJKinactive \usefont {U} {#1} {m} {n} } } } -\cs_new_eq:NN \xeCJK_group_begin: \group_begin: -\cs_new_eq:NN \xeCJK_group_end: \group_end: +\cs_new_eq:NN \@@_group_begin: \group_begin: +\cs_new_eq:NN \@@_group_end: \group_end: % \end{macrocode} % % 简单处理与 \pkg{hyperref} 宏包的兼容问题。 % \begin{macrocode} -\xeCJK_AfterEndPreamble:n +\@@_AfterEndPreamble:n { \bool_if:nT { - \xeCJK_if_package_loaded_p:n { hyperref } && + \@@_if_package_loaded_p:n { hyperref } && \tl_if_exist_p:N \pdfstringdefPreHook } { - \tl_put_right:Nn \pdfstringdefPreHook + \tl_gput_right:Nn \pdfstringdefPreHook { \cs_set_eq:NN \makexeCJKinactive \prg_do_nothing: - \cs_set_eq:NN \xeCJK_group_begin: \prg_do_nothing: - \cs_set_eq:NN \xeCJK_group_end: \prg_do_nothing: + \cs_set_eq:NN \@@_group_begin: \prg_do_nothing: + \cs_set_eq:NN \@@_group_end: \prg_do_nothing: \cs_set_eq:NN \CJKfamily \use_none:n } } @@ -4197,67 +4246,67 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ { \cs_set_eq:NN \CJK@ifundefined \cs_if_free:NTF } \NewDocumentCommand \xeCJKcaption { o m } { - \IfValueT {#1} { \XeTeXdefaultencoding "#1" } - \cs_set_nopar:Npx \xeCJK_reset_at_catcode: + \IfNoValueF {#1} { \XeTeXdefaultencoding "#1" } + \cs_set_nopar:Npx \@@_reset_at_catcode: { \exp_not:n { \char_set_catcode:nn { `\@ } } { \char_value_catcode:n { `\@ } } } \char_set_catcode_letter:N \@ \file_input:n { #2.cpx } - \xeCJK_reset_at_catcode: + \@@_reset_at_catcode: \XeTeXdefaultencoding "UTF-8" } % \end{macrocode} % \end{macro} % % \begin{macro}[internal] -% {\xeCJK_ULprepunctchar:n, \xeCJK_ULpostpunctchar:n, \xeCJK_ULroutines:} +% {\@@_ULprepunctchar:n, \@@_ULpostpunctchar:n, \@@_ULroutines:} % \begin{macrocode} -\cs_new_protected_nopar:Npn \xeCJK_ULprepunctchar:n #1 +\cs_new_protected_nopar:Npn \@@_ULprepunctchar:n #1 { - { \makexeCJKinactive \CJKpunctsymbol {#1} \xeCJK_no_break: } + { \makexeCJKinactive \CJKpunctsymbol {#1} \@@_no_break: } \tex_ignorespaces:D } -\cs_new_protected_nopar:Npn \xeCJK_ULpostpunctchar:n #1 +\cs_new_protected_nopar:Npn \@@_ULpostpunctchar:n #1 { { \makexeCJKinactive \CJKpunctsymbol {#1} } - \xeCJK_ignorespaces: + \@@_ignorespaces: } -\cs_new_protected_nopar:Npn \xeCJK_ULroutines: +\cs_new_protected_nopar:Npn \@@_ULroutines: { - \xeCJK_inter_class_toks:nnn { Default } { CJK } { \CJKecglue \CJKsymbol } - \xeCJK_inter_class_toks:nnn { HalfLeft } { CJK } { \CJKsymbol } - \xeCJK_inter_class_toks:nnn { HalfRight } { CJK } { \CJKecglue \CJKsymbol } - \xeCJK_inter_class_toks:nnn { Boundary } { CJK } { \xeCJK_Boundary_and_CJK: } + \@@_inter_class_toks:nnn { Default } { CJK } { \CJKecglue \CJKsymbol } + \@@_inter_class_toks:nnn { HalfLeft } { CJK } { \CJKsymbol } + \@@_inter_class_toks:nnn { HalfRight } { CJK } { \CJKecglue \CJKsymbol } + \@@_inter_class_toks:nnn { Boundary } { CJK } { \@@_Boundary_and_CJK: } \clist_map_inline:nn { Default, HalfLeft, HalfRight, Boundary } { - \xeCJK_inter_class_toks:nnn {##1} { FullLeft } { \xeCJK_ULprepunctchar:n } - \xeCJK_inter_class_toks:nnn {##1} { FullRight } { \xeCJK_ULpostpunctchar:n } + \@@_inter_class_toks:nnn {##1} { FullLeft } { \@@_ULprepunctchar:n } + \@@_inter_class_toks:nnn {##1} { FullRight } { \@@_ULpostpunctchar:n } } - \xeCJK_UL_subclass_patch_tl + \@@_UL_subclass_patch_tl } % \end{macrocode} % \end{macro} % % 对 \pkg{ulem} 宏包打补丁,以支持 \pkg{CJKfntef} 宏包。 % \begin{macrocode} -\xeCJK_AfterPreamble:n +\@@_AfterPreamble:n { \cs_if_exist:NT \UL@hook { \addto@hook \UL@hook { - \cs_set_eq:NN \xeCJK_UL_CJKsymbol \CJKsymbol - \cs_set_eq:NN \xeCJK_UL_CJKpunctsymbol \CJKpunctsymbol + \cs_set_eq:NN \@@_UL_CJKsymbol \CJKsymbol + \cs_set_eq:NN \@@_UL_CJKpunctsymbol \CJKpunctsymbol \cs_set_protected_nopar:Npn \CJKsymbol #1 { - { \xeCJK_select_font: \xeCJK_UL_CJKsymbol {#1} } - { \xeCJK_make_node:n { CJK } } \xeCJK_ignorespaces: + { \xeCJK_select_font: \@@_UL_CJKsymbol {#1} } + { \@@_make_node:n { CJK } } \@@_ignorespaces: } \cs_set_protected_nopar:Npn \CJKpunctsymbol #1 - { { \xeCJK_select_font: \xeCJK_UL_CJKpunctsymbol {#1} } } - \xeCJK_ULroutines: + { { \xeCJK_select_font: \@@_UL_CJKpunctsymbol {#1} } } + \@@_ULroutines: } } \cs_if_exist:NT \XeTeX@CJKfntef@hook @@ -4270,15 +4319,15 @@ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ % % 使用 \pkg{CJKnumb} 宏包。 % \begin{macrocode} -\bool_if:NT \g_xeCJK_number_bool +\bool_if:NT \g_@@_number_bool { \tl_set:Nn \CJK@UnicodeEnc { UTF8 } \cs_set_protected_nopar:Npn \CJKaddEncHook #1#2 - { \cs_set_nopar:cpn { xeCJK_enc_#1 } {#2} } + { \cs_set_nopar:cpn { @@_enc_#1 } {#2} } \cs_set_protected_nopar:Npn \Unicode #1#2 { \tex_char:D \int_eval:n { (#1) * \c_two_hundred_fifty_six + (#2) } } \RequirePackage { CJKnumb } - \use:c { xeCJK_enc_\CJK@UnicodeEnc } + \use:c { @@_enc_\CJK@UnicodeEnc } \tl_set:Nn \CJK@tenthousand { 万 } \tl_set:Nn \CJK@hundredmillion { 亿 } } diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins index 2fa0b0c245c..eabbbca62fd 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `batchfile') %% -%% $Id: xeCJK.dtx 356 2012-09-03 02:18:08Z sobenlee $ +%% $Id: xeCJK.dtx 357 2012-10-16 18:42:20Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -30,12 +30,12 @@ %% ----------------------------------------------------------------- %% -\input docstrip.tex +\input l3docstrip.tex \keepsilent \askforoverwritefalse \preamble -$Id: xeCJK.dtx 356 2012-09-03 02:18:08Z sobenlee $ +$Id: xeCJK.dtx 357 2012-10-16 18:42:20Z sobenlee $ $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ ----------------------------------------------------------------- Author: |