From 514373c000dc69882cdcb746f8a6700a2c4cb5ac Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 7 Apr 2018 20:59:35 +0000 Subject: xecjk (7apr18) git-svn-id: svn://tug.org/texlive/trunk@47362 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/xelatex/xecjk/xeCJK-listings.sty | 4 +- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg | 4 +- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 361 ++++++++++++--------- Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty | 4 +- .../tex/xelatex/xecjk/xunicode-addon.sty | 84 +++-- .../tex/xelatex/xecjk/xunicode-extra.def | 6 +- 6 files changed, 274 insertions(+), 189 deletions(-) (limited to 'Master/texmf-dist/tex/xelatex') diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty index 8b2070d3e4c..0c847aee915 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {xeCJK patch file for listings} \ProvidesExplPackage{xeCJK-listings} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } } \ProcessOptions \scan_stop: \RequirePackage { xeCJK } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg index e2cda61d1df..12d2815a4a8 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg @@ -6,10 +6,10 @@ %% %% xeCJK.dtx (with options: `config') %% -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {Configuration file for xeCJK package} \ProvidesExplFile{\ExplFileName.cfg} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} %% %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 69bea63c023..39ddda3be71 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage{\ExplFileName} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -383,6 +383,8 @@ \xeCJK_token_value_class:N #2 \exp_stop_f: \prg_return_true: \else: \prg_return_false: \fi: } +\cs_new_protected_nopar:Npn \xeCJK_make_boundary: + { \bool_if:NT \l__xeCJK_CJK_group_bool { \scan_stop: } } \keys_define:nn { xeCJK / options } { xeCJKactive .choice: , @@ -1317,7 +1319,7 @@ \cs_new_protected_nopar:Npn \__xeCJK_punct_bound_kern_aux:NNN #1#2 { \str_if_eq:nnTF {#1} {#2} - { \__xeCJK_punct_bound_kern:N } + { \__xeCJK_nobreak_hskip:N } { \__xeCJK_punct_if_long:NTF #1 { \skip_horizontal:N } @@ -2436,59 +2438,96 @@ \tl_if_exist:cF { \__xeCJK_punct_csname:n { dim/glue/#1/#2 } } { \__xeCJK_get_punct_bounds_aux:NN #1 #2 } } -\cs_new_protected_nopar:Npn \__xeCJK_get_punct_bounds_aux:NN #1#2 +\cs_new_protected_nopar:Npn \__xeCJK_get_punct_bounds_aux:NN { \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl - { - \__xeCJK_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { offset } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim } - \__xeCJK_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip } - } - { - { \xeCJK_select_punct_font: \xeCJK_calc_punct_dimen:N #2 } - \dim_set:Nn \l__xeCJK_bound_dim - { \__xeCJK_use_punct_dim:nNN { bound } #1 #2 } - \dim_set:Nn \l__xeCJK_reverse_bound_dim - { - \tl_if_eq:NNTF #1 \c__xeCJK_left_tl - { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl } - { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl } - #2 - } - \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl } - \xeCJK_punct_margin_process:NN #1 #2 - \xeCJK_punct_offset_process:NN #1 #2 - } + { \__xeCJK_save_punct_margin_plain:NN } + { \__xeCJK_save_punct_margin:NN } } \cs_new_protected_nopar:Npn \xeCJK_get_punct_bounds:No { \exp_last_unbraced:NNo \xeCJK_get_punct_bounds:NN } +\cs_new_protected_nopar:Npn \__xeCJK_save_punct_margin_plain:NN #1#2 + { + \__xeCJK_save_punct_dim:nNNn { rule } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { glue } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { offset } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_left_tl {#2} { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl {#2} { \c_zero_dim } + \__xeCJK_save_punct_skip:nNNn { glue } #1 #2 { \c_zero_skip } + } +\cs_new_protected_nopar:Npn \__xeCJK_save_punct_margin:NN #1#2 + { + \group_begin: + \xeCJK_select_punct_font: + \xeCJK_calc_punct_dimen:N #2 + \group_end: + \dim_set:Nn \l__xeCJK_bound_dim + { \__xeCJK_use_punct_dim:nNN { bound } #1 #2 } + \dim_set:Nn \l__xeCJK_reverse_bound_dim + { + \tl_if_eq:NNTF #1 \c__xeCJK_left_tl + { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl } + { \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl } + #2 + } + \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl } + \xeCJK_punct_margin_process:NN #1 #2 + \xeCJK_punct_offset_process:NN #1 #2 + \__xeCJK_punct_if_long:NT #2 + { \__xeCJK_long_punct_kerning:N #2 } + } \dim_new:N \l__xeCJK_bound_dim \dim_new:N \l__xeCJK_reverse_bound_dim +\cs_new_protected_nopar:Npn \__xeCJK_long_punct_kerning:N #1 + { + \dim_set:Nn \l__xeCJK_tmp_dim + { + \dim_max:nn + { \l__xeCJK_bound_dim + \l__xeCJK_reverse_bound_dim } + { \c_zero_dim } + } + \__xeCJK_save_punct_dim:nNNn { bound_width } #1 #1 { \l__xeCJK_tmp_dim } + \dim_set:Nn \l__xeCJK_tmp_dim + { + \str_case:nnTF {#1} + { { ^^^^2025 } { } { ^^^^2026 } { } } + { \c_zero_dim } + { -\l__xeCJK_tmp_dim } + } + \__xeCJK_save_punct_dim:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim } + \__xeCJK_save_punct_skip:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim } + \dim_add:Nn \l__xeCJK_tmp_dim + { \dim_max:nn { \l__xeCJK_bound_dim } { \c_zero_dim } } + \__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #1 { \l__xeCJK_tmp_dim } + \__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #1 { \l__xeCJK_tmp_dim } + } \cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:NN #1#2 { \tl_if_exist:cF { \__xeCJK_punct_csname:n { dim/kern/#1/#2 } } { \tl_if_eq:NNTF \l_xeCJK_punct_style_tl \c__xeCJK_punct_style_plain_tl - { - \__xeCJK_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { break_kern } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_dim:nNNn { bound_width } #1 #2 { \c_zero_dim } - \__xeCJK_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip } - \__xeCJK_save_punct_skip:nNNn { break_kern } #1 #2 { \c_zero_skip } - \__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip } - } - { - \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl } - \xeCJK_punct_kerning_process:NN #1 #2 - } + { \__xeCJK_save_punct_kerning_plain:NN } + { \__xeCJK_save_punct_kerning:NN } + #1 #2 } } \cs_new_protected_nopar:Npn \xeCJK_get_punct_kerning:oN { \exp_after:wN \xeCJK_get_punct_kerning:NN } +\cs_new_protected_nopar:Npn \__xeCJK_save_punct_kerning_plain:NN #1#2 + { + \__xeCJK_save_punct_dim:nNNn { kern } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { break_kern } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { bound_kern } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_dim:nNNn { bound_width } #1 #2 { \c_zero_dim } + \__xeCJK_save_punct_skip:nNNn { kern } #1 #2 { \c_zero_skip } + \__xeCJK_save_punct_skip:nNNn { break_kern } #1 #2 { \c_zero_skip } + \__xeCJK_save_punct_skip:nNNn { bound_kern } #1 #2 { \c_zero_skip } + } +\cs_new_protected_nopar:Npn \__xeCJK_save_punct_kerning:NN + { + \UseInstance { xeCJK / punctuation } { \l_xeCJK_punct_style_tl } + \xeCJK_punct_kerning_process:NN + } \cs_new_protected_nopar:Npn \xeCJK_punct_margin_process:NN #1#2 { \dim_set:Nn \l__xeCJK_tmp_dim @@ -2858,26 +2897,13 @@ { \xeCJK_glyph_bounds:NN \c_one #1 } \__xeCJK_save_punct_dim:nNNn { bound } \c__xeCJK_right_tl #1 { \xeCJK_glyph_bounds:NN \c_three #1 } - \dim_set:Nn \l__xeCJK_tmp_dim - { - ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #1 ) + - ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 ) - } \__xeCJK_save_punct_dim:nNn { width } #1 { \etex_fontcharwd:D \tex_font:D `#1 } \__xeCJK_save_punct_dim:nNn { dimen } #1 - { \__xeCJK_use_punct_dim:nN { width } #1 - \l__xeCJK_tmp_dim } - \__xeCJK_punct_if_long:NT #1 { - \dim_set:Nn \l__xeCJK_tmp_dim - { - \str_case:nnTF {#1} - { { ^^^^2025 } { } { ^^^^2026 } { } } - { \c_zero_dim } - { \dim_min:nn { - \l__xeCJK_tmp_dim } { \c_zero_dim } } - } - \__xeCJK_save_punct_dim:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim } - \__xeCJK_save_punct_skip:nNNn { kern } #1 #1 { \l__xeCJK_tmp_dim } + ( \__xeCJK_use_punct_dim:nN { width } #1 ) - + ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_left_tl #1 ) - + ( \__xeCJK_use_punct_dim:nNN { bound } \c__xeCJK_right_tl #1 ) } } \cs_new_nopar:Npn \xeCJK_glyph_bounds:NN #1#2 @@ -4219,7 +4245,7 @@ \prop_new:N \g__xeCJK_scale_family_prop \cs_new_protected_nopar:Npn \xeCJK_visible_space: { - \bool_if:NT \l__xeCJK_CJK_group_bool { \scan_stop: } + \xeCJK_make_boundary: \xeCJK_glyph_if_exist:NTF { ^^^^2423 } { ^^^^2423 } { @@ -4362,7 +4388,6 @@ \xeCJKsetwidth { ^^^^2013 } { 0.5 em } \ProcessKeysOptions { xeCJK / options } \RequirePackage { fontspec } [ 2012/05/01 ] -\RequirePackage { xunicode-addon } \tl_const:Nx \c__xeCJK_encoding_tl { \g_fontspec_encoding_tl } \keys_define:nn { xeCJK / options } { @@ -4562,9 +4587,6 @@ \__xeCJK_math_robust:N \endmath } \__xeCJK_math_robust:N \ensuremath -\UndeclareTextCommand \nobreakspace { \UTFencname } -\RenewDocumentCommand \nobreakspace { } { \leavevmode \nobreak \ } -\AtBeginUTFCommand { \bool_if:NT \l__xeCJK_CJK_group_bool { \scan_stop: } } \__xeCJK_msg_new:nn { conflict-package } { The~`#1'~package~is~too~old. \\ @@ -4708,80 +4730,148 @@ } } } -\cs_new_eq:NN \__xeCJK_group_begin: \group_begin: -\cs_new_eq:NN \__xeCJK_group_end: \group_end: -\tl_map_inline:nn +\cs_new_protected_nopar:Npn \__xeCJK_inactive_group_begin: + { \group_begin: \makexeCJKinactive } +\cs_new_eq:NN \__xeCJK_inactive_group_end: \group_end: +\prop_const_from_keyval:Nn \c__xeCJK_ambigious_char_prop { - \textellipsis \textendash \textemdash \textperiodcentered - \textcentereddot \textquoteleft \textquoteright \textquotedblleft - \textquotedblright \textcdot \textgrq \textgrqq + "00B7 = \textperiodcentered \textcentereddot \textcdot , + "2013 = \textendash , + "2014 = \textemdash , + "2018 = \textquoteleft \textgrq , + "2019 = \textquoteright , + "201C = \textquotedblleft \textgrqq , + "201D = \textquotedblright , + "2025 = \texthdotfor , + "2026 = \textellipsis , + "2027 = \texthyphenationpoint , + "2E3A = \texttwoemdash } +\__xeCJK_at_end_preamble:n { \__xeCJK_patch_text_command: } +\cs_new_protected_nopar:Npn \__xeCJK_patch_text_command: { - \AtBeginUTFCommand [#1] { \__xeCJK_group_begin: \makexeCJKinactive } - \AtEndUTFCommand [#1] { \__xeCJK_group_end: } + \xeCJK_if_package_loaded:nTF { xunicode } + { \__xeCJK_patch_xunicode_ambigious_char: } + { + \exp_args:Nx \__xeCJK_patch_tuenc_ambigious_char:n + { \UnicodeEncodingName } + \__xeCJK_patch_tuenc_accent: + \__xeCJK_patch_tuenc_composite: + } } -\__xeCJK_after_end_preamble:n { \l__xeCJK_patch_Bxii_tl } -\tl_new:N \l__xeCJK_patch_Bxii_tl -\cs_new_protected_nopar:Npn \__xeCJK_patch_Bxii:nN #1#2 +\cs_new_protected_nopar:Npn \__xeCJK_patch_xunicode_ambigious_char: { - \tl_put_right:Nx \l__xeCJK_patch_Bxii_tl - { \__xeCJK_patch_Bxii:n { #1 \token_to_str:N #2 } } + \RequirePackage { xunicode-addon } + \prop_map_inline:Nn \c__xeCJK_ambigious_char_prop + { + \tl_map_inline:nn { ##2 } + { + \xunadd_set_begin_hook:nn { ####1 } + { \__xeCJK_inactive_group_begin: } + \xunadd_set_end_hook:nn { ####1 } + { \__xeCJK_inactive_group_end: } + } + } + \xunadd_append_begin_hook:n { \xeCJK_make_boundary: } } -\group_begin: -\cs_set:Npn \__xeCJK_tmp:w #1 +\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_ambigious_char:n #1 { - \group_end: - \cs_new_protected_nopar:Npn \__xeCJK_patch_Bxii:nNN ##1##2##3 + \prop_map_inline:Nn \c__xeCJK_ambigious_char_prop { - \tl_put_right:Nx \l__xeCJK_patch_Bxii_tl + \tl_map_inline:nn { ##2 } { - \__xeCJK_patch_Bxii:Nnn - #1 { ##1 \token_to_str:N ##2 } { \token_to_str:N ##3 } + \cs_if_exist:NF ####1 + { \DeclareTextSymbol ####1 {#1} { ##1 } } + \__xeCJK_patch_ambigious_char:nN {#1} ####1 } } } -\use:n +\cs_new_protected_nopar:Npn \__xeCJK_patch_ambigious_char:nN #1#2 { - \char_set_catcode_other:N \\ - \__xeCJK_tmp:w + \exp_args:Nx \__xeCJK_patch_ambigious_char:n + { #1 \token_to_str:N #2 } } - { \ } -\cs_new_protected_nopar:Npn \__xeCJK_patch_Bxii:n #1 - { \cs_if_free:cF {#1} { \cs_gset_eq:cN {#1} \__xeCJK_Default_Bxii: } } -\cs_new_protected_nopar:Npn \__xeCJK_patch_Bxii:Nnn #1#2#3 - { \cs_if_free:cF {#2} { \cs_gset_eq:cN { #1#2 - #3 } \__xeCJK_Default_Bxii: } } -\group_begin: -\char_set_catcode_other:n { 183 } -\cs_new_protected_nopar:Npn \__xeCJK_Default_Bxii: +\cs_new_protected_nopar:Npx \__xeCJK_patch_ambigious_char:nNn #1#2#3 + { + \exp_args:Nx \exp_not:N \__xeCJK_patch_ambigious_char:n + { + \c_backslash_str #1 + \exp_not:N \token_to_str:N #2 - + \exp_not:N \token_to_str:N #3 + } + } +\cs_new_protected_nopar:Npn \__xeCJK_patch_ambigious_char:n #1 + { + \cs_if_free:cF {#1} + { \exp_args:Nc \__xeCJK_patch_ambigious_char:N {#1} } + } +\cs_new_protected_nopar:Npn \__xeCJK_patch_ambigious_char:N #1 + { + \cs_set_protected_nopar:Npx #1 + { + \__xeCJK_ambigious_char:n + { \token_if_chardef:NTF #1 { \utex_char:D } { \exp_not:o } #1 } + } + } +\cs_new_protected_nopar:Npn \__xeCJK_ambigious_char:n #1 { \int_compare:nNnTF \xetex_interchartokenstate:D > \c_zero - { \__xeCJK_group_begin: \makexeCJKinactive ^^b7 \__xeCJK_group_end: } - { ^^b7 } + { \__xeCJK_inactive_group_begin: #1 \__xeCJK_inactive_group_end: } + {#1} + } +\cs_new_protected_nopar:Npn \xeCJK@composite@patch + { + \str_if_eq_x:nnT { \f@encoding } { \UnicodeEncodingName } + { \xeCJK_make_boundary: } + } +\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_composite: + { + \cs_set_nopar:Npn \@text@composite@x ##1 + { + \xeCJK@composite@patch + \ifx ##1 \relax + \expandafter \@secondoftwo + \else + \expandafter \@firstoftwo + \fi + ##1 + } + } +\group_begin: +\char_set_catcode_other:n { "A0 } +\cs_new_protected_nopar:Npn \__xeCJK_patch_tuenc_accent: + { + \cs_set_protected_nopar:Npn \add@unicode@accent ##1 ##2 + { + \tl_if_blank:nTF { ##2 } { ^^a0 } { ##2 } + \utex_char:D \etex_numexpr:D ##1 \scan_stop: + } } \group_end: -\clist_map_inline:nn +\prop_const_from_keyval:Nn \c__xeCJK_middle_dot_prop { - { T3 } \textvibyy , - { T2A } \cyrchvcrs , - { T2B } \cyrchldsc , - { T2C } \cyrabhha , - { X2 } \cyrchldsc , - { TS1 } \textperiodcentered , - { LY1 } \textperiodcentered + T2A = \cyrchvcrs , + T2B = \cyrchldsc , + T2C = \cyrabhha , + X2 = \cyrchldsc , + TS1 = \textperiodcentered , + LY1 = \textperiodcentered , + T1 = \r u , + T4 = \B t , + T5 = \` \ecircumflex } - { \__xeCJK_patch_Bxii:nN #1 } -\clist_map_inline:nn +\__xeCJK_after_end_preamble:n { \__xeCJK_patch_middle_dot: } +\cs_new_protected_nopar:Npn \__xeCJK_patch_middle_dot: { - { T1 } \r u , - { T4 } \B t , - { T5 } \` \ecircumflex , - { LGR } \accpsilivaria w + \prop_map_inline:Nn \c__xeCJK_middle_dot_prop + { \__xeCJK_patch_middle_dot:nw { ##1 } ##2 \q_stop } + \__xeCJK_patch_ambigious_char:nNn { T5 } \` { \^ - e } } - { \__xeCJK_patch_Bxii:nNN #1 } -\tl_put_right:Nx \l__xeCJK_patch_Bxii_tl +\cs_new_protected_nopar:Npn \__xeCJK_patch_middle_dot:nw #1#2#3 \q_stop { - \__xeCJK_patch_Bxii:n - { \token_to_str:N \T 5 \token_to_str:N \` - \token_to_str:N \^ - e } + \tl_if_empty:nTF {#3} + { \__xeCJK_patch_ambigious_char:nN {#1} #2 } + { \__xeCJK_patch_ambigious_char:nNn {#1} #2 {#3} } } \__xeCJK_after_end_preamble:n { @@ -4793,15 +4883,15 @@ } \__xeCJK_after_end_preamble:n { - \xeCJK_if_package_loaded:nT { hyperref } + \cs_if_exist_use:NT \pdfstringdefDisableCommands { - \pdfstringdefDisableCommands - { - \__xeCJK_gobble_CJKfamily: - \xeCJK_cs_clear:N \makexeCJKinactive - \xeCJK_cs_clear:N \__xeCJK_group_begin: - \xeCJK_cs_clear:N \__xeCJK_group_end: - } + { + \__xeCJK_gobble_CJKfamily: + \xeCJK_cs_clear:N \__xeCJK_inactive_group_begin: + \xeCJK_cs_clear:N \__xeCJK_inactive_group_end: + \xeCJK_cs_clear:N \makexeCJKinactive + \xeCJK_cs_clear:N \xeCJK@composite@patch + } } } \__xeCJK_after_end_preamble:n @@ -4848,39 +4938,20 @@ \str_if_eq:nnT {#1} { \CJK@UnicodeEnc } { \group_begin: - \cs_set_eq:NN \Unicode \__xeCJK_calc_unicode:nn - \cs_set_eq:NN \def \xeCJK_char_from_charcode:Nn + \cs_set_eq:NN \Unicode \xeCJK_unicode_char:nn + \cs_set_eq:NN \def \xdef #2 \group_end: - \tl_gset:Nn \CJK@tenthousand { ^^^^4e07 } - \tl_gset:Nn \CJK@hundredmillion { ^^^^4ebf } + \str_gset:Nx \CJK@tenthousand { ^^^^4e07 } + \str_gset:Nx \CJK@hundredmillion { ^^^^4ebf } \tl_if_exist:NF \CJK@UnicodeEnc { \tl_const:Nn \CJK@UnicodeEnc { UTF8 } } \cs_if_exist:NF \Unicode { \cs_new_eq:NN \Unicode \xeCJK_unicode_char:nn } } } -\cs_if_exist:NTF \utex_charcat:D - { - \cs_new_protected_nopar:Npn \xeCJK_char_from_charcode:Nn #1#2 - { \tl_const:Nx #1 { \char_generate:nn {#2} { \c_eleven } } } - } - { - \cs_new_protected_nopar:Npn \xeCJK_char_from_charcode:Nn #1#2 - { - \group_begin: - \char_set_lccode:nn { "4E00 } {#2} - \tex_lowercase:D - { - \group_end: - \tl_const:Nn #1 { ^^^^4e00 } - } - } - } -\cs_new_nopar:Npn \__xeCJK_calc_unicode:nn #1#2 - { (#1) * \c_two_hundred_fifty_six + (#2) } -\cs_new_protected_nopar:Npn \xeCJK_unicode_char:nn #1#2 - { \tex_char:D \etex_numexpr:D \__xeCJK_calc_unicode:nn {#1} {#2} \scan_stop: } +\cs_new_nopar:Npn \xeCJK_unicode_char:nn #1#2 + { \utex_char:D \etex_numexpr:D (#1) * 256 + (#2) \scan_stop: } \bool_if:NT \g__xeCJK_config_bool { \ExplSyntaxOff diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index 8949d43ddd3..5495f6ba4ce 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {xeCJK font effect} \ProvidesExplPackage{xeCJKfntef} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} \PassOptionsToPackage { normalem } { ulem } \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } } \ProcessOptions \scan_stop: diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty index e0c95aaa605..44f922d7dbd 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty @@ -29,10 +29,10 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {addon file for xunicode} \ProvidesExplPackage{xunicode-addon} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} \bool_lazy_or:nnF { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: } @@ -56,8 +56,8 @@ { \clist_get:NNF \g__xunadd_encname_clist \UTFencname { - \file_if_exist:nTF { tuenc.def } - { \tl_set:Nn \UTFencname { TU } } + \cs_if_exist:NTF \UnicodeEncodingName + { \tl_set:Nx \UTFencname { \UnicodeEncodingName } } { \sys_if_engine_xetex:TF { \tl_set:Nn \UTFencname { EU1 } } @@ -198,8 +198,8 @@ } \RenewDocumentCommand \DeclareUTFcharacter { O { \UTFencname } m m } { - \str_if_eq:nnTF {#3} { \hbar } - { \__xunadd_restore_hbar: } + \cs_if_exist_use:cF + { __xunadd_restore_ \tl_to_str:n {#3} : } { \__xunadd_if_csname:nTF {#3} { \__xunadd_declare_character:Nnn #3 } @@ -207,27 +207,31 @@ {#1} {#2} } } -\cs_new_protected_nopar:Npn \__xunadd_restore_hbar: +\cs_new_protected_nopar:cpn + { __xunadd_restore_ \tl_to_str:n { \hbar } : } + { \__xunadd_restore_cmd:N \hbar } +\cs_new_protected_nopar:cpn + { __xunadd_restore_ \tl_to_str:n { \nobreakspace } : } + { \__xunadd_restore_cmd:N \nobreakspace } +\cs_new_protected_nopar:Npn \__xunadd_restore_cmd:N #1 + { \__xunadd_restore_cmd:Nx #1 { ? - \token_to_str:N #1 } } +\cs_new_protected_nopar:Npn \__xunadd_restore_cmd:Nn #1#2 { - \cs_if_free:cF { ? - \token_to_str:N \hbar } - { \__xunadd_restore_hbar:c { ? - \token_to_str:N \hbar } } + \cs_if_free:cF {#2} + { \__xunadd_restore_cmd:Nc #1 {#2} } } -\cs_new_protected_nopar:Npn \__xunadd_restore_hbar:N #1 +\cs_new_protected_nopar:Npn \__xunadd_restore_cmd:NN #1#2 { - \cs_gset_eq:NN \hbar #1 - \cs_undefine:N #1 + \cs_gset_eq:NN #1 #2 + \cs_undefine:N #2 } -\cs_generate_variant:Nn \__xunadd_restore_hbar:N { c } +\cs_generate_variant:Nn \__xunadd_restore_cmd:Nn { Nx } +\cs_generate_variant:Nn \__xunadd_restore_cmd:NN { Nc } \cs_new_protected:Npn \__xunadd_declare_character:Nnn #1#2#3 { \__xunadd_provide_text_command_default:N #1 - \group_begin: - \char_set_lccode:nn { `0 } { \__xunadd_check_slot:n {#3} } - \tex_lowercase:D - { - \group_end: - \__xunadd_declare_character:NNxn 0 - } + \exp_after:wN \__xunadd_declare_character:NNxn + \utex_char:D \__xunadd_check_slot:n {#3} \exp_stop_f: #1 { \token_to_str:N #1 } {#2} } \cs_generate_variant:Nn \__xunadd_declare_character:Nnn { c } @@ -341,14 +345,9 @@ \cs_generate_variant:Nn \__xunadd_text_composite:Nnn { c } \cs_new_protected:Npn \__xunadd_declare_encoded:NNnnn #1#2#3#4#5 { - \group_begin: - \char_set_lccode:nn { `4 } { \__xunadd_check_slot:n {#4} } - \char_set_lccode:nn { `5 } { \__xunadd_check_slot:n {#5} } - \tex_lowercase:D - { - \group_end: - \__xunadd_declare_encoded:NNNNxx 4 5 - } + \exp_after:wN \__xunadd_declare_encoded:NNNNxx + \utex_char:D \__xunadd_check_slot:n {#4} \exp_after:wN \exp_stop_f: + \utex_char:D \__xunadd_check_slot:n {#5} \exp_stop_f: #1 #2 { \token_to_str:N #2 } {#3} } \cs_new_protected:Npn \__xunadd_declare_encoded:NNNNnn #1#2#3#4#5#6 @@ -529,23 +528,34 @@ \tl_if_blank:nTF {#2} { \IfBooleanTF {#1} - { \tl_set:Nn \l__xunadd_begin_hook_tl {#3} } - { \tl_put_right:Nn \l__xunadd_begin_hook_tl {#3} } + { \xunadd_set_begin_hook:n } + { \xunadd_append_begin_hook:n } } - { \__xunadd_set_cmd_hook:nnn { begin } {#2} {#3} } + { \xunadd_set_begin_hook:nn {#2} } } \NewDocumentCommand \AtEndUTFCommand { s O { } +m } { \tl_if_blank:nTF {#2} { \IfBooleanTF {#1} - { \tl_set:Nn \l__xunadd_end_hook_tl {#3} } - { \tl_put_right:Nn \l__xunadd_end_hook_tl {#3} } + { \xunadd_set_end_hook:n } + { \xunadd_append_end_hook:n } } - { \__xunadd_set_cmd_hook:nnn { end } {#2} {#3} } + { \xunadd_set_begin_hook:nn {#2} } + {#3} } -\tl_new:N \l__xunadd_begin_hook_tl -\tl_new:N \l__xunadd_end_hook_tl +\cs_new_protected_nopar:Npn \xunadd_set_begin_hook:n + { \tl_set:Nn \l__xunadd_begin_hook_tl } +\cs_new_protected_nopar:Npn \xunadd_append_begin_hook:n + { \tl_put_right:Nn \l__xunadd_begin_hook_tl } +\cs_new_protected_nopar:Npn \xunadd_set_end_hook:n + { \tl_set:Nn \l__xunadd_end_hook_tl } +\cs_new_protected_nopar:Npn \xunadd_append_end_hook:n + { \tl_put_right:Nn \l__xunadd_end_hook_tl } +\cs_new_protected_nopar:Npn \xunadd_set_begin_hook:nn + { \__xunadd_set_cmd_hook:nnn { begin } } +\cs_new_protected_nopar:Npn \xunadd_set_end_hook:nn + { \__xunadd_set_cmd_hook:nnn { end } } \cs_new_protected:Npn \__xunadd_set_cmd_hook:nnn #1#2#3 { \cs_set_protected:cpn @@ -560,6 +570,8 @@ { \use:c { __xunadd_#3_csname:n } { \token_to_str:N #1 - \tl_to_str:n {#2} } } \cs_new_nopar:Npn \__xunadd_begin_csname:n #1 { __xunadd_begin_#1_hook:n } \cs_new_nopar:Npn \__xunadd_end_csname:n #1 { __xunadd_end_#1_hook:n } +\tl_new:N \l__xunadd_begin_hook_tl +\tl_new:N \l__xunadd_end_hook_tl \cs_new_protected:Npn \__xunadd_begin_hook:nn #1#2 { \tl_use:N \l__xunadd_begin_hook_tl diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def index 1195a70754e..c4505af2773 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def @@ -27,10 +27,12 @@ %% %% ---------------------------------------------------------------------- %% -\GetIdInfo$Id: xeCJK.dtx 25e85c2 2018-02-27 02:44:39 +0800 Qing Lee $ +\GetIdInfo$Id: xeCJK.dtx 2041e49 2018-04-07 17:31:56 +0800 Qing Lee $ {extra definition for xunicode} \ProvidesExplFile{xunicode-extra.def} - {\ExplFileDate}{3.6.1}{\ExplFileDescription} + {\ExplFileDate}{3.7.0}{\ExplFileDescription} +\DeclareUTFSymbol\texthyphenationpoint{"2027} +\DeclareUTFSymbol\texttwoemdash{"2E3A} \DeclareUTFComposite\textsuperscript \DeclareUTFComposite\textsubscript \DeclareUTFEncodedAccent\textsbleftarrow{"20EE}{"20FF} -- cgit v1.2.3