diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-06 22:15:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-06 22:15:10 +0000 |
commit | 3f2352dc162c0f22e60cc8a6f3deb29fb61da4da (patch) | |
tree | 2b3550af491f1d81efd2d67a3579cd8bdfd13cd8 /Master/texmf-dist/tex/xelatex/xecjk | |
parent | 8c3bc9ab96e351e1189f16dacc40c2dcc678b70a (diff) |
xecjk (6dec13)
git-svn-id: svn://tug.org/texlive/trunk@32345 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk')
5 files changed, 344 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg index 0b64ecbefdd..42c3b8d213f 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg +++ b/Master/texmf-dist/tex/xelatex/xecjk/config/xeCJK.cfg @@ -6,11 +6,11 @@ %% %% xeCJK.dtx (with options: `config') %% -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {Configuration file for xeCJK package} \ProvidesExplFile {\ExplFileName.cfg} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\ExplFileDescription} %% %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty index 0926ab3ea99..9e69b25b7b0 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `listings') %% -%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +%% $Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {xeCJK patch file for listings} \ProvidesExplPackage {xeCJK-listings} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\ExplFileDescription} \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } } \ProcessOptions \scan_stop: \RequirePackage { xeCJK } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index b5e43f0b26b..b253fe395e9 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `package') %% -%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +%% $Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage {\ExplFileName} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -242,8 +242,19 @@ \int_gset_eq:NN \g__xeCJK_spacefactor_int \c_one_thousand \cs_new_protected_nopar:Npn \xeCJK_glue_to_skip:nN #1#2 { - \hbox_set:Nn \l__xeCJK_tmp_box { #1 \scan_stop: \exp_after:wN } \exp_after:wN - \skip_set:Nn \exp_after:wN #2 \exp_after:wN { \skip_use:N \tex_lastskip:D } + \group_begin: + \hbox_set:Nw \l__xeCJK_tmp_box #1 \scan_stop: + \int_compare:nNnTF \etex_lastnodetype:D = \c_eleven + { + \exp_after:wN \hbox_set_end: \exp_after:wN \group_end: \exp_after:wN + \skip_set:Nn \exp_after:wN #2 \exp_after:wN + { \skip_use:N \tex_lastskip:D } + } + { + \hbox_set_end: \exp_after:wN \group_end: \exp_after:wN + \skip_set:Nn \exp_after:wN #2 \exp_after:wN + { \dim_use:N \box_wd:N \l__xeCJK_tmp_box } + } } \prg_new_conditional:Npnn \xeCJK_if_blank_x:n #1 { p , T , F , TF } { @@ -3021,7 +3032,7 @@ \keys_define:nn { xeCJK / options } { Verb .choices:nn = - { true , env , env+ , false } + { true , env+ , env , false } { \int_set_eq:NN \l__xeCJK_verb_case_int \l_keys_choice_int } , Verb .default:n = { env } } @@ -3029,18 +3040,15 @@ { \if_case:w \l__xeCJK_verb_case_int \or: - \cs_set_eq:NN \CJKglue \__xeCJK_zero_glue: - \cs_set_eq:NN \CJKecglue \__xeCJK_zero_glue: + \__xeCJK_nobreak_skip_zero: \or: \int_compare:nNnTF \etex_currentgrouptype:D = \c_fourteen { \xeCJKVerbAddon } - { - \cs_set_eq:NN \CJKglue \__xeCJK_zero_glue: - \cs_set_eq:NN \CJKecglue \__xeCJK_zero_glue: - } + { \__xeCJK_nobreak_skip: } \or: - \int_compare:nNnT \etex_currentgrouptype:D = \c_fourteen + \int_compare:nNnTF \etex_currentgrouptype:D = \c_fourteen { \xeCJKVerbAddon } + { \__xeCJK_nobreak_skip_zero: } \fi: } \__xeCJK_after_preamble:n @@ -3048,19 +3056,95 @@ \cs_set_protected_nopar:Npx \verbatim@font { \exp_not:o { \verbatim@font } \__xeCJK_verb_font_hook: } } +\cs_new_protected_nopar:Npn \__xeCJK_nobreak_skip_zero: + { + \__xeCJK_reset_shipout_skip: + \cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue: + \cs_set_eq:NN \__xeCJK_shipout_boundary:w \xeCJK_CJK_and_Boundary:w + \tl_put_right:Nn \l__xeCJK_reset_shipout_skip_hook_tl + { + \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_shipout_check_for_glue: + \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_shipout_boundary:w + } + \xeCJK_cs_clear:N \CJKglue + \xeCJK_cs_clear:N \CJKecglue + \xeCJK_cs_clear:N \xeCJK_check_for_glue: + \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \xeCJK_class_group_end: + \cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_nobreak_hskip:n + \cs_set_eq:NN \__xeCJK_punct_breakable_kern:n \__xeCJK_nobreak_hskip:n + } +\cs_new_protected_nopar:Npn \__xeCJK_nobreak_skip: + { + \__xeCJK_reset_shipout_skip: + \xeCJK_glue_to_skip:nN { \CJKglue } \l__xeCJK_ccglue_skip + \skip_if_eq:nnTF { \l__xeCJK_ccglue_skip } { \c_zero_skip } + { \xeCJK_cs_clear:N \CJKglue } + { \cs_set_eq:NN \CJKglue \__xeCJK_nobreak_ccglue: } + \xeCJK_glue_to_skip:nN { \CJKecglue } \l__xeCJK_ecglue_skip + \skip_if_eq:nnTF { \l__xeCJK_ecglue_skip } { \c_zero_skip } + { \xeCJK_cs_clear:N \CJKecglue } + { \cs_set_eq:NN \CJKecglue \__xeCJK_nobreak_ecglue: } + \cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_nobreak_hskip:n + \cs_set_eq:NN \__xeCJK_punct_breakable_kern:n \__xeCJK_nobreak_hskip:n + } +\cs_new_protected_nopar:Npn \__xeCJK_nobreak_ccglue: + { \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ccglue_skip } +\cs_new_protected_nopar:Npn \__xeCJK_nobreak_ecglue: + { \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_ecglue_skip } +\cs_new_protected_nopar:Npn \__xeCJK_nobreak_hskip:n + { \xeCJK_no_break: \skip_horizontal:n } +\cs_new_protected_nopar:Npn \__xeCJK_reset_shipout_skip: + { + \cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue + \cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue + \cs_set_eq:NN \__xeCJK_shipout_punct_hskip:n \__xeCJK_punct_hskip:n + \cs_set_eq:NN + \__xeCJK_shipout_punct_breakable_kern:n \__xeCJK_punct_breakable_kern:n + \tl_set:Nx \l__xeCJK_off_verb_addon_tl + { + \exp_not:c + { bool_set_ \bool_if:NTF \l__xeCJK_xecglue_bool { true } { false } :N } + \l__xeCJK_xecglue_bool + \exp_not:n + { + \cs_set_eq:NN \CJKglue \__xeCJK_shipout_CJKglue: + \cs_set_eq:NN \CJKecglue \__xeCJK_shipout_CJKecglue: + \cs_set_eq:NN \__xeCJK_punct_hskip:n \__xeCJK_shipout_punct_hskip:n + \cs_set_eq:NN + \__xeCJK_punct_breakable_kern:n \__xeCJK_shipout_punct_breakable_kern:n + \l__xeCJK_reset_shipout_skip_hook_tl + } + } + \__xeCJK_add_to_shipout:n { \l__xeCJK_off_verb_addon_tl } + \xeCJKsetup { xCJKecglue = false } + } +\tl_new:N \l__xeCJK_reset_shipout_skip_hook_tl \NewDocumentCommand \xeCJKVerbAddon { } { \int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { \bool_if:NF \l__xeCJK_listings_env_bool { - \__xeCJK_set_verb_exspace: - \__xeCJK_verb_addon: + \dim_compare:nNnTF + { \tex_fontdimen:D \c_two \tex_font:D } = + { \etex_fontcharwd:D \tex_font:D \c__xeCJK_mono_letter_int } + { + \__xeCJK_set_verb_exspace: + \__xeCJK_verb_addon: + } + { + \int_if_odd:nTF { \l__xeCJK_verb_case_int } + { \__xeCJK_nobreak_skip_zero: } + { \__xeCJK_nobreak_skip: } + } } } } +\int_const:Nn \c__xeCJK_mono_letter_int { 77 } \bool_new:N \l__xeCJK_listings_env_bool -\NewDocumentCommand \xeCJKOffVerbAddon { } { } +\NewDocumentCommand \xeCJKOffVerbAddon { } + { \tl_use:N \l__xeCJK_off_verb_addon_tl } +\tl_new:N \l__xeCJK_off_verb_addon_tl \cs_new_protected_nopar:Npn \__xeCJK_verb_addon: { \bool_if:NF \l__xeCJK_verb_addon_bool @@ -3071,10 +3155,10 @@ \__xeCJK_set_char_class_eq:nn { HalfLeft } { Default } \__xeCJK_set_char_class_eq:nn { HalfRight } { Default } \__xeCJK_set_char_class_eq:nn { NormalSpace } { Default } - \cs_set_eq:NN \__xeCJK_verb_CJKglue: \CJKglue - \cs_set_eq:NN \__xeCJK_verb_CJKecglue: \CJKecglue - \cs_set_eq:NN \__xeCJK_verb_check_for_glue: \xeCJK_check_for_glue: - \cs_set_eq:NN \__xeCJK_verb_boundary:w \xeCJK_CJK_and_Boundary:w + \cs_set_eq:NN \__xeCJK_shipout_CJKglue: \CJKglue + \cs_set_eq:NN \__xeCJK_shipout_CJKecglue: \CJKecglue + \cs_set_eq:NN \__xeCJK_shipout_check_for_glue: \xeCJK_check_for_glue: + \cs_set_eq:NN \__xeCJK_shipout_boundary:w \xeCJK_CJK_and_Boundary:w \cs_set_protected_nopar:Npx \xeCJKOffVerbAddon { \__xeCJK_reset_char_class:n { FullLeft } @@ -3087,10 +3171,10 @@ \l__xeCJK_xecglue_bool \exp_not:n { - \cs_set_eq:NN \CJKglue \__xeCJK_verb_CJKglue: - \cs_set_eq:NN \CJKecglue \__xeCJK_verb_CJKecglue: - \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_verb_check_for_glue: - \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_verb_boundary:w + \cs_set_eq:NN \CJKglue \__xeCJK_shipout_CJKglue: + \cs_set_eq:NN \CJKecglue \__xeCJK_shipout_CJKecglue: + \cs_set_eq:NN \xeCJK_check_for_glue: \__xeCJK_shipout_check_for_glue: + \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_shipout_boundary:w } } \__xeCJK_add_to_shipout:n { \xeCJKOffVerbAddon } @@ -3102,18 +3186,16 @@ \xeCJK_cs_clear:N \CJKecglue } { - \cs_set_eq:NN \CJKglue \__xeCJK_verb_ccglue: - \cs_set_eq:NN \CJKecglue \__xeCJK_verb_ecglue: + \skip_set_eq:NN \l__xeCJK_ccglue_skip \l__xeCJK_verb_exspace_skip + \skip_set:Nn \l__xeCJK_ecglue_skip { .5 \l__xeCJK_verb_exspace_skip } + \cs_set_eq:NN \CJKglue \__xeCJK_nobreak_ccglue: + \cs_set_eq:NN \CJKecglue \__xeCJK_nobreak_ecglue: } \cs_set_eq:NN \xeCJK_check_for_glue: \CJKecglue \cs_set_eq:NN \xeCJK_CJK_and_Boundary:w \__xeCJK_verb_CJK_and_Boundary:w } \cs_new_protected_nopar:Npn \__xeCJK_verb_CJK_and_Boundary:w { \xeCJK_class_group_end: \CJKecglue } -\cs_new_protected_nopar:Npn \__xeCJK_verb_ccglue: - { \xeCJK_no_break: \skip_horizontal:N \l__xeCJK_verb_exspace_skip } -\cs_new_protected_nopar:Npn \__xeCJK_verb_ecglue: - { \xeCJK_no_break: \skip_horizontal:n { 0.5 \l__xeCJK_verb_exspace_skip } } \cs_new_protected_nopar:Npn \__xeCJK_reset_char_class:n #1 { \int_set:Nn \l__xeCJK_tmp_int { \xeCJK_class_num:n {#1} } diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty index 91da63156f2..7a332818ed8 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `fntef') %% -%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +%% $Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {xeCJK patch file for ulem/CJKfntef} \ProvidesExplPackage {xeCJKfntef} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\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 8338f15acf2..7a8df75c301 100644 --- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty +++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `xunicode') %% -%% $Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +%% $Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 525 2013-11-11 06:32:00Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 533 2013-12-05 10:52:12Z sobenlee $ {addon file for xunicode} \ProvidesExplPackage {xunicode-addon} - {\ExplFileDate}{3.2.7}{\ExplFileDescription} + {\ExplFileDate}{3.2.8}{\ExplFileDescription} \pdftex_if_engine:T { \msg_new:nnnn { xunicode-addon } { cannot-use-pdftex } @@ -98,6 +98,8 @@ \tl_set:Nx \UTFencname {##1} \clist_gput_right:Nx \g__xunadd_encname_clist {##1} \file_input:n { xunicode.sty } + \__xunadd_declare_textcircled:n { \UTFencname } + \__xunadd_declare_math_symbols:n { \UTFencname } } { \msg_error:nnn { xunicode-addon } { encoding-unknown } {##1} } } @@ -106,12 +108,62 @@ } \clist_new:N \l__xunadd_encname_clist \msg_new:nnnn { xunicode-addon } { encoding-unknown } - {Encoding~scheme~"#1"~unknown.} + { Encoding~scheme~"#1"~unknown. } { You~may~use \\\\ \token_to_str:N \usepackage [ #1 , \encodingdefault ] {fontenc} \\\\ before~xunicode-addon~or~xunicode. } +\cs_new_protected_nopar:Npn \__xunadd_declare_math_symbols:n #1 + { + \__xunadd_declare_character:Nnn \textFinv {#1} { x2132 } + \__xunadd_declare_character:Nnn \textaleph {#1} { x2135 } + \__xunadd_declare_character:Nnn \textbeth {#1} { x2136 } + \__xunadd_declare_character:Nnn \textgimel {#1} { x2137 } + \__xunadd_declare_character:Nnn \textdaleth {#1} { x2138 } + \__xunadd_declare_character:Nnn \textGame {#1} { x2141 } + } +\RenewDocumentCommand \DeclareUTFmathsymbols { m } + { + \bool_if:NT \l__xunadd_math_as_UTF_text_bool + { + \seq_map_inline:Nn \l__xunadd_math_as_UTF_text_seq + { \__xunadd_declare_math_as_UTF_text:n {##1} } + \bool_set_false:N \l__xunadd_math_as_UTF_text_bool + } + } +\seq_new:N \l__xunadd_math_as_UTF_text_seq +\seq_set_from_clist:Nn \l__xunadd_math_as_UTF_text_seq + { hbar , Finv , aleph , beth , gimel , daleth , Game } +\bool_new:N \l__xunadd_math_as_UTF_text_bool +\RenewDocumentCommand \UseMathAsText { } + { + \math@s@text@true + \bool_set_true:N \l__xunadd_math_as_UTF_text_bool + } +\@onlypreamble \UseMathAsText +\cs_new_protected_nopar:Npn \__xunadd_declare_math_as_UTF_text:n #1 + { + \cs_if_exist:cTF {#1} + { + \cs_new_eq:cc { keepmathUTF #1 } {#1} + \cs_gset_protected_nopar:cpx {#1} + { + \exp_not:N \mode_if_math:TF + { \exp_not:c { keepmathUTF #1 } } + { \exp_not:c { text #1 } } + } + \tl_put_right:Nx \l__xunadd_hyperref_hook_tl + { \cs_set_eq:NN \exp_not:c {#1} \exp_not:c { text #1 } } + } + { \cs_new_nopar:cpx {#1} { \exp_not:c { text #1 } } } + } +\tl_new:N \l__xunadd_hyperref_hook_tl +\AtBeginDocument + { + \cs_if_free:NF \pdfstringdefDisableCommands + { \pdfstringdefDisableCommands { \l__xunadd_hyperref_hook_tl } } + } \prg_new_conditional:Npnn \__xunadd_glyph_if_exist:n #1 { p , T , F , TF } { \etex_iffontchar:D \tex_font:D \etex_numexpr:D #1 \scan_stop: @@ -145,11 +197,26 @@ } \RenewDocumentCommand \DeclareUTFcharacter { O { \UTFencname } m m } { - \__xunadd_if_csname:nTF {#3} - { \__xunadd_declare_character:Nnn #3 } - { \__xunadd_declare_character:cnn { \tl_to_str:n {#3} } } - {#1} {#2} + \str_if_eq:nnTF {#3} { \hbar } + { \__xunadd_restore_hbar: } + { + \__xunadd_if_csname:nTF {#3} + { \__xunadd_declare_character:Nnn #3 } + { \__xunadd_declare_character:cnn { \tl_to_str:n {#3} } } + {#1} {#2} + } + } +\cs_new_protected_nopar:Npn \__xunadd_restore_hbar: + { + \cs_if_free:cF { ? - \token_to_str:N \hbar } + { \__xunadd_restore_hbar:c { ? - \token_to_str:N \hbar } } } +\cs_new_protected_nopar:Npn \__xunadd_restore_hbar:N #1 + { + \cs_gset_eq:NN \hbar #1 + \cs_undefine:N #1 + } +\cs_generate_variant:Nn \__xunadd_restore_hbar:N { c } \cs_new_protected:Npn \__xunadd_declare_character:Nnn #1#2#3 { \__xunadd_provide_text_command_default:N #1 @@ -288,24 +355,53 @@ { \__xunadd_glyph_if_exist:nTF { `#4 } {#4} - { - \cs_if_exist_use:cTF { ? #2 } - { {#1} } {#4} - } + { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#4} } } { - \__xunadd_glyph_if_exist:nTF { `#3 } - { #1#3 } + \bool_if:NTF \l__xunadd_add_circle_bool { + \bool_set_false:N \l__xunadd_add_circle_bool \__xunadd_glyph_if_exist:nTF { `#4 } - { \add@accent { `#4 } {#1} } + { \__xunadd_add_circle:nn {#4} {#1} } + } + { + \__xunadd_glyph_if_exist:nTF { `#3 } + { #1#3 } { - \cs_if_exist_use:cTF { ? #2 } - { {#1} } {#1} + \__xunadd_glyph_if_exist:nTF { `#4 } + { \add@accent { `#4 } {#1} } } } + { \cs_if_exist_use:cTF { ? #2 } { {#1} } {#1} } + } + } +\cs_new_protected:Npn \__xunadd_add_circle:nn #1#2 + { + \hcoffin_set:Nn \l__xunadd_circle_coffin {#1} + \hcoffin_set:Nn \l__xunadd_tmp_coffin {#2} + \dim_set:Nn \l__xunadd_circle_width_dim + { \fp_use:N \l__xunadd_circle_ratio_fp \coffin_wd:N \l__xunadd_circle_coffin } + \coffin_resize:Nnn \l__xunadd_tmp_coffin + { \l__xunadd_circle_width_dim } + { + ( \coffin_ht:N \l__xunadd_tmp_coffin + \coffin_dp:N \l__xunadd_tmp_coffin ) + * \tex_number:D \l__xunadd_circle_width_dim + / \tex_number:D \coffin_wd:N \l__xunadd_tmp_coffin } + \coffin_attach:NnnNnnnn + \l__xunadd_circle_coffin { hc } { vc } + \l__xunadd_tmp_coffin { hc } { vc } + { \c_zero_dim } { \c_zero_dim } + \coffin_typeset:Nnnnn \l__xunadd_circle_coffin + { H } { l } { \c_zero_dim } { \c_zero_dim } } +\dim_new:N \l__xunadd_circle_width_dim +\coffin_new:N \l__xunadd_tmp_coffin +\coffin_new:N \l__xunadd_circle_coffin +\NewDocumentCommand \settextcircledratio { m } + { \fp_set:Nn \l__xunadd_circle_ratio_fp {#1} } +\fp_new:N \l__xunadd_circle_ratio_fp +\settextcircledratio { 0.7 } \NewDocumentCommand \AtBeginUTFCommand { s O { } +m } { \tl_if_blank:nTF {#2} @@ -356,6 +452,117 @@ {#2} \tl_use:N \l__xunadd_end_hook_tl } +\AtBeginUTFCommand [ \textcircled ] + { \bool_set_true:N \l__xunadd_add_circle_bool } +\bool_new:N \l__xunadd_add_circle_bool +\cs_new_protected_nopar:Npn \__xunadd_declare_textcircled:n #1 + { + \__xunadd_declare_character:Nnn \textbigcircle {#1} { x25EF } + \__xunadd_declare_accent:Nnnn \textcircled {#1} { 20DD } { 25EF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 0 } { x24EA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 1 } { x2460 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 2 } { x2461 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 3 } { x2462 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 4 } { x2463 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 5 } { x2464 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 6 } { x2465 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 7 } { x2466 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 8 } { x2467 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 9 } { x2468 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 10 } { x2469 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 11 } { x246A } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 12 } { x246B } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 13 } { x246C } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 14 } { x246D } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 15 } { x246E } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 16 } { x246F } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 17 } { x2470 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 18 } { x2471 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 19 } { x2472 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 20 } { x2473 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 21 } { x3251 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 22 } { x3252 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 23 } { x3253 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 24 } { x3254 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 25 } { x3255 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 26 } { x3256 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 27 } { x3257 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 28 } { x3258 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 29 } { x3259 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 30 } { x325A } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 31 } { x325B } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 32 } { x325C } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 33 } { x325D } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 34 } { x325E } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 35 } { x325F } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 36 } { x32B1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 37 } { x32B2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 38 } { x32B3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 39 } { x32B4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 40 } { x32B5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 41 } { x32B6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 42 } { x32B7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 43 } { x32B8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 44 } { x32B9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 45 } { x32BA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 46 } { x32BB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 47 } { x32BC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 48 } { x32BD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 49 } { x32BE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { 50 } { x32BF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { A } { x24B6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { B } { x24B7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { C } { x24B8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { D } { x24B9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { E } { x24BA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { F } { x24BB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { G } { x24BC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { H } { x24BD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { I } { x24BE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { J } { x24BF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { K } { x24C0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { L } { x24C1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { M } { x24C2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { N } { x24C3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { O } { x24C4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { P } { x24C5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Q } { x24C6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { R } { x24C7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { S } { x24C8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { T } { x24C9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { U } { x24CA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { V } { x24CB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { W } { x24CC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { X } { x24CD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Y } { x24CE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { Z } { x24CF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { a } { x24D0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { b } { x24D1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { c } { x24D2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { d } { x24D3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { e } { x24D4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { f } { x24D5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { g } { x24D6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { h } { x24D7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { i } { x24D8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { j } { x24D9 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { k } { x24DA } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { l } { x24DB } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { m } { x24DC } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { n } { x24DD } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { o } { x24DE } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { p } { x24DF } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { q } { x24E0 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { r } { x24E1 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { s } { x24E2 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { t } { x24E3 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { u } { x24E4 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { v } { x24E5 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { w } { x24E6 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { x } { x24E7 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { y } { x24E8 } + \__xunadd_declare_composite:Nnnn \textcircled {#1} { z } { x24E9 } + } %% %% This package consists of the file xeCJK.dtx, %% full-stop.map, |