summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx')
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx167
1 files changed, 47 insertions, 120 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
index a8638028f31..396d478dfb9 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
@@ -194,7 +194,7 @@ Copyright and Licence
%<*package|config|fntef|listings|xunicode|xunextra>
%<!(config|xunextra)>\NeedsTeXFormat{LaTeX2e}
%<!(config|xunextra)>\RequirePackage{expl3}
-%<+!driver>\GetIdInfo$Id: xeCJK.dtx 0e3f9e8 2019-04-15 02:07:22 +0800 Qing Lee <sobenlee@gmail.com> $
+%<+!driver>\GetIdInfo$Id: xeCJK.dtx 4449ab5 2019-06-02 23:02:31 +0800 Qing Lee <sobenlee@gmail.com> $
%<package> {Typesetting CJK scripts with XeLaTeX}
%<config> {Configuration file for xeCJK package}
%<fntef> {xeCJK font effect}
@@ -207,7 +207,7 @@ Copyright and Licence
%<listings>\ProvidesExplPackage{xeCJK-listings}
%<xunicode>\ProvidesExplPackage{xunicode-addon}
%<xunextra>\ProvidesExplFile{xunicode-extra.def}
-%<!driver> {\ExplFileDate}{3.7.3}{\ExplFileDescription}
+%<!driver> {\ExplFileDate}{3.7.4}{\ExplFileDescription}
%</package|config|fntef|listings|xunicode|xunextra>
%<*driver>
\documentclass{ctxdoc}
@@ -281,7 +281,7 @@ Copyright and Licence
% \changes{v3.6.1}{2018/02/27}{减少 \texttt{bool} 运算。}
% \changes{v3.7.2}{2019/03/23}{同步 \LaTeXiii{} 2019/03/05。}
%
-% \CheckSum{10857}
+% \CheckSum{10786}
% \GetFileId{xeCJK.sty}
%
% \title{\bfseries\pkg{xeCJK} 宏包}
@@ -3365,10 +3365,7 @@ Copyright and Licence
\cs_new_protected_nopar:Npn \@@_check_for_glue_auxiii:
{
\bool_if:NT \l_@@_last_penalty_bool
- {
- \@@_add_offset_skip:N \l_@@_last_skip
- \tex_penalty:D \l_@@_last_penalty_int
- }
+ { \tex_penalty:D \l_@@_last_penalty_int }
\skip_horizontal:N \l_@@_last_skip
\tl_if_eq:NNF \l_@@_aligni_tl \c_@@_left_tl { \CJKglue }
}
@@ -3719,7 +3716,6 @@ Copyright and Licence
{
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
\xeCJK_class_group_end:
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\exp_after:wN \xeCJK_punct_node:N \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
\tex_ignorespaces:D
@@ -3775,7 +3771,6 @@ Copyright and Licence
{ \@@_use_dim_or_skip:nNN { bound_kern } #1 #2 }
\dim_compare:nNnF \l_@@_tmp_dim = \l_@@_last_bound_dim
{ \@@_punct_bound_kern_ratio:NN #1 #2 }
- \@@_add_offset_skip:N \l_@@_punct_kern_skip
\bool_if:NTF \l_@@_last_penalty_bool
{
\tex_penalty:D \l_@@_last_penalty_int
@@ -3784,17 +3779,6 @@ Copyright and Licence
{ \@@_punct_bound_kern_aux:NNN #1 #2 }
\l_@@_punct_kern_skip
}
-\cs_new_protected_nopar:Npn \@@_add_offset_skip:N #1
- {
- \tl_if_eq:NNF \l_@@_aligni_tl \c_@@_left_tl
- {
- \int_compare:nNnT \tex_lastnodetype:D = { 11 }
- {
- \skip_add:Nn #1 { \tex_lastskip:D }
- \tex_unskip:D
- }
- }
- }
\skip_new:N \l_@@_punct_kern_skip
% \end{macrocode}
% \end{macro}
@@ -3910,19 +3894,6 @@ Copyright and Licence
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_punct_offset:NN}
-% 经过以上 \tn{vrule} 处理后,标点输出边界与实际边界的距离。
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_punct_offset:NN #1#2
- {
- \dim_set:Nn \l_@@_tmp_dim
- { - \@@_use_punct_dim:nNN { offset } #1 #2 }
- \dim_compare:nNnF \l_@@_tmp_dim = \c_zero_dim
- { \@@_punct_hskip:n { \l_@@_tmp_dim } }
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\@@_punct_glue:NN}
% \changes{v3.2.7}{2013/08/23}
% {标点符号左/右空白的伸展值不超过原始边界,收缩值不小于另一侧边界。}
@@ -3976,7 +3947,7 @@ Copyright and Licence
\exp_after:wN \@@_punct_if_right:NT #1
{ \@@_punct_rule:NN \c_@@_right_tl #1 }
\@@_punct_breakable_kern:n
- { \@@_use_dim_or_skip:nNN { break_kern } #1 #2 }
+ { \@@_use_dim_or_skip:nNN { bound_kern } #1 #2 }
\@@_punct_if_right:NF #2
{ \@@_punct_rule:NN \c_@@_left_tl #2 }
}
@@ -4040,7 +4011,6 @@ Copyright and Licence
\cs_new_protected_nopar:Npn \xeCJK_FullRight_and_CJK:
{
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_select_font:
\CJKglue
@@ -4054,7 +4024,6 @@ Copyright and Licence
{
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
\xeCJK_class_group_end:
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
}
% \end{macrocode}
@@ -4075,10 +4044,7 @@ Copyright and Licence
\CJKpunctsymbol #2
}
\cs_new_protected_nopar:Npn \@@_Default_and_FullLeft_glue:N #1
- {
- \@@_punct_glue:NN \c_@@_left_tl #1
- \@@_punct_offset:NN \c_@@_left_tl #1
- }
+ { \@@_punct_glue:NN \c_@@_left_tl #1 }
% \end{macrocode}
% \end{macro}
%
@@ -4097,7 +4063,6 @@ Copyright and Licence
{
\CJKglue
\@@_punct_glue:NN \c_@@_left_tl #1
- \@@_punct_offset:NN \c_@@_left_tl #1
}
% \end{macrocode}
% \end{macro}
@@ -4108,7 +4073,6 @@ Copyright and Licence
{
\xeCJK_get_punct_bounds:NN \c_@@_left_tl #1
\@@_Boundary_and_FullLeft_glue:N #1
- \@@_punct_offset:NN \c_@@_left_tl #1
\xeCJK_class_group_begin:
\xeCJK_select_punct_font:
\xeCJK_clear_Boundary_and_CJK_toks:
@@ -4584,7 +4548,6 @@ Copyright and Licence
\group_insert_after:N \xeCJK_no_break:
}
{ \group_align_safe_end: }
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\exp_after:wN \xeCJK_punct_node:N \g_@@_last_punct_tl
\xeCJK_class_group_end:
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
@@ -5125,6 +5088,7 @@ Copyright and Licence
% \subsection{标点处理}
%
% \changes{v3.2.7}{2013/08/22}{实现自定义行首/尾标点符号宽度功能。}
+% \changes{v3.7.4}{2019/05/31}{简化行首/尾标点符号宽度的实现。}
%
% \tn{XeTeXglyphbounds} 可以得到一个字符的左右边距,用于标点压缩。如果它不可用,则
% 在文档中只能使用 |plain| 这一标点格式原样输出标点。
@@ -5469,6 +5433,7 @@ Copyright and Licence
\@@_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim }
\@@_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim }
\@@_save_punct_dim:nNNn { offset } #1 #2 { \c_zero_dim }
+ \@@_save_punct_dim:nNNn { margin } #1 #2 { \c_zero_dim }
\@@_save_punct_dim:nNNn { bound } \c_@@_left_tl {#2} { \c_zero_dim }
\@@_save_punct_dim:nNNn { bound } \c_@@_right_tl {#2} { \c_zero_dim }
\@@_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip }
@@ -5550,11 +5515,9 @@ Copyright and Licence
\cs_new_protected_nopar:Npn \@@_save_punct_kerning_plain:NN #1#2
{
\@@_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim }
- \@@_save_punct_dim:nNNn { break_kern } #1 #2 { \c_zero_dim }
\@@_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim }
\@@_save_punct_dim:nNNn { bound_width } #1 #2 { \c_zero_dim }
\@@_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip }
- \@@_save_punct_skip:nNNn { break_kern } #1 #2 { \c_zero_skip }
\@@_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip }
}
\cs_new_protected_nopar:Npn \@@_save_punct_kerning:NN
@@ -5582,7 +5545,7 @@ Copyright and Licence
}
{ \@@_calc_punct_width:N #2 }
}
- \dim_set:Nn \l_@@_tmp_dim
+ \dim_set:Nn \l_@@_margin_dim
{
\dim_max:nn
{ \l_@@_margin_minimum_dim }
@@ -5621,24 +5584,9 @@ Copyright and Licence
}
}
}
- \@@_save_punct_dim:nNNn { glue } #1 #2 { \l_@@_tmp_dim }
- \@@_save_punct_skip:nNNnnn { glue } #1 #2
- { \l_@@_tmp_dim }
- {
- \@@_punct_if_middle:NTF #2
- {
- ( \@@_use_punct_dim:nN { width } #2 -
- \@@_use_punct_dim:nN { dimen } #2 ) / 2
- - \l_@@_tmp_dim
- }
- { \l_@@_bound_dim - \l_@@_tmp_dim }
- }
- {
- \@@_punct_if_middle:NTF #2
- { .5 \l_@@_tmp_dim }
- { \l_@@_tmp_dim - \l_@@_reverse_bound_dim }
- }
+ \@@_save_punct_dim:nNNn { margin } #1 #2 { \l_@@_margin_dim }
}
+\dim_new:N \l_@@_margin_dim
% \end{macrocode}
% \end{macro}
%
@@ -5710,7 +5658,7 @@ Copyright and Licence
\@@_punct_if_middle:NTF #2
{
\l_@@_tmp_dim
- - ( \@@_use_punct_dim:nNN { glue } #1 #2 )
+ - \l_@@_margin_dim
- ( \@@_use_punct_dim:nN { dimen } #2 )
}
{
@@ -5729,8 +5677,26 @@ Copyright and Licence
}
\@@_save_punct_dim:nNNn { offset } #1 #2
{ \l_@@_tmp_dim }
- \@@_save_punct_dim:nNNn { rule } #1 #2
- { - \l_@@_bound_dim + \l_@@_tmp_dim }
+ \@@_save_punct_dim:nNNn { rule } #1 #2
+ { \l_@@_tmp_dim - \l_@@_bound_dim }
+ \@@_save_punct_dim:nNNn { glue } #1 #2
+ { \l_@@_margin_dim - \l_@@_tmp_dim }
+ \@@_save_punct_skip:nNNnnn { glue } #1 #2
+ { \l_@@_margin_dim - \l_@@_tmp_dim }
+ {
+ \@@_punct_if_middle:NTF #2
+ {
+ ( \@@_use_punct_dim:nN { width } #2 -
+ \@@_use_punct_dim:nN { dimen } #2 ) / 2
+ - \l_@@_margin_dim
+ }
+ { \l_@@_bound_dim - \l_@@_margin_dim }
+ }
+ {
+ \@@_punct_if_middle:NTF #2
+ { .5 \l_@@_margin_dim }
+ { \l_@@_margin_dim - \l_@@_reverse_bound_dim }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -5778,7 +5744,7 @@ Copyright and Licence
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_punct_kerning_process:NN #1#2
{
- \dim_set:Nn \l_@@_original_margin_dim
+ \dim_set:Nn \l_@@_margin_dim
{ \@@_original_kerning_margin:NN #1 #2 }
\dim_set:Nn \l_@@_minimum_bound_dim
{ \@@_punct_min_bound:NN #1 #2 }
@@ -5803,33 +5769,13 @@ Copyright and Licence
\@@_punct_if_right:NTF #1
{
\@@_punct_if_right:NTF #2
- {
- \@@_save_kerning:nNNNN
- { bound_kern } \c_@@_left_tl #2 #1 #2
- \@@_save_kerning:nnnNN
- { break_kern } { offset } { bound }
- }
- {
- \@@_save_kerning:nnNN
- { break_kern } { offset } #1 #2
- \@@_save_kerning_aux:nnNN
- { bound_kern } { \l_@@_kerning_margin_dim }
- }
+ { \@@_save_kerning:nnnNN { bound_kern } { offset } { bound } }
+ { \@@_save_kerning:nnNN { bound_kern } { offset } }
}
{
\@@_punct_if_right:NTF #2
- {
- \@@_save_kerning:nnNN
- { bound_kern } { bound } #1 #2
- \@@_save_kerning_aux:nnNN
- { break_kern } { \l_@@_tmp_dim }
- }
- {
- \@@_save_kerning:nNNNN
- { bound_kern } \c_@@_right_tl #1 #1 #2
- \@@_save_kerning:nnnNN
- { break_kern } { bound } { offset }
- }
+ { \@@_save_kerning:nnNN { bound_kern } { bound } }
+ { \@@_save_kerning:nnnNN { bound_kern } { bound } { offset } }
}
#1 #2
}
@@ -5837,11 +5783,10 @@ Copyright and Licence
{
\bool_if:NTF \l_@@_enabled_kerning_bool
{ \@@_calc_kerning_margin:NN #1 #2 }
- { \l_@@_original_margin_dim }
+ { \l_@@_margin_dim }
}
\dim_new:N \l_@@_minimum_bound_dim
\dim_new:N \l_@@_kerning_margin_dim
-\dim_new:N \l_@@_original_margin_dim
% \end{macrocode}
% \end{macro}
%
@@ -5860,23 +5805,10 @@ Copyright and Licence
- ( \@@_use_punct_dim:nNN {#2} \c_@@_right_tl #4 )
- ( \@@_use_punct_dim:nNN {#3} \c_@@_left_tl #5 )
}
- \@@_save_kerning_aux:nnNN {#1} { \l_@@_tmp_dim } #4 #5
- }
-\cs_new_protected_nopar:Npn \@@_save_kerning:nNNNN #1#2#3#4#5
- {
- \dim_set:Nn \l_@@_tmp_dim
- {
- \l_@@_kerning_margin_dim
- - ( \@@_use_punct_dim:nNN { bound } #2 #3 )
- }
- \@@_save_kerning_aux:nnNN {#1} { \l_@@_tmp_dim } #4 #5
- }
-\cs_new_protected_nopar:Npn \@@_save_kerning_aux:nnNN #1#2#3#4
- {
- \@@_save_punct_dim:nNNn {#1} #3 #4 {#2}
- \@@_save_punct_skip:nNNnnn {#1} #3 #4
- {#2}
- { \l_@@_original_margin_dim - \l_@@_kerning_margin_dim }
+ \@@_save_punct_dim:nNNn {#1} #4 #5 { \l_@@_tmp_dim }
+ \@@_save_punct_skip:nNNnnn {#1} #4 #5
+ { \l_@@_tmp_dim }
+ { \l_@@_margin_dim - \l_@@_kerning_margin_dim }
{ \l_@@_kerning_margin_dim - \l_@@_minimum_bound_dim }
}
% \end{macrocode}
@@ -5890,10 +5822,10 @@ Copyright and Licence
\dim_eval:n
{
\@@_use_punct_dim:nNN
- { \@@_punct_if_right:NTF #1 { glue } { bound } } \c_@@_right_tl #1
+ { \@@_punct_if_right:NTF #1 { margin } { bound } } \c_@@_right_tl #1
+
\@@_use_punct_dim:nNN
- { \@@_punct_if_right:NTF #2 { bound } { glue } } \c_@@_left_tl #2
+ { \@@_punct_if_right:NTF #2 { bound } { margin } } \c_@@_left_tl #2
}
}
% \end{macrocode}
@@ -5957,7 +5889,7 @@ Copyright and Licence
{ \fp_use:N \l_@@_kerning_margin_ratio_fp \use:n }
}
{ \fp_use:c { l_@@_#1_align_ratio_fp } \use:n }
- { \l_@@_original_margin_dim }
+ { \l_@@_margin_dim }
}
}
% \end{macrocode}
@@ -5991,10 +5923,10 @@ Copyright and Licence
{
(#1)
- ( \@@_use_punct_dim:nNN
- { \@@_punct_if_right:NTF #2 { bound } { glue } }
+ { \@@_punct_if_right:NTF #2 { bound } { margin } }
\c_@@_left_tl #2 )
- ( \@@_use_punct_dim:nNN
- { \@@_punct_if_right:NTF #3 { glue } { bound } }
+ { \@@_punct_if_right:NTF #3 { margin } { bound } }
\c_@@_right_tl #3 )
- ( \@@_use_punct_dim:nN { dimen } #2 )
- ( \@@_use_punct_dim:nN { dimen } #3 )
@@ -9479,7 +9411,6 @@ Copyright and Licence
\UL@stop
\@@_ulem_skip_punct_begin:
\@@_punct_glue:NN \c_@@_left_tl #1
- \@@_punct_offset:NN \c_@@_left_tl #1
\UL@start
}
{ \@@_ulem_Default_and_FullLeft_glue:N #1 }
@@ -9514,7 +9445,6 @@ Copyright and Licence
\@@_ulem_skip_punct_begin:
\@@_ulem_punct_ccglue:
\@@_punct_glue:NN \c_@@_left_tl #1
- \@@_punct_offset:NN \c_@@_left_tl #1
\UL@start
\@@_ulem_class_group_begin:
\xeCJK_select_punct_font:
@@ -9648,7 +9578,6 @@ Copyright and Licence
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
\xeCJK_class_group_end:
\UL@stop
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_ulem_skip_punct_end:
\UL@start
@@ -9667,7 +9596,6 @@ Copyright and Licence
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
\xeCJK_class_group_end:
\UL@stop
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_ulem_skip_punct_end:
\UL@start
@@ -9687,7 +9615,6 @@ Copyright and Licence
\@@_punct_rule:NN \c_@@_right_tl \g_@@_last_punct_tl
\xeCJK_class_group_end:
\UL@stop
- \@@_punct_offset:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_punct_glue:NN \c_@@_right_tl \g_@@_last_punct_tl
\@@_ulem_punct_ccglue:
\@@_ulem_skip_punct_end: