summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty91
1 files changed, 79 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
index 4f5110b76df..b2bf72845e0 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
@@ -7,8 +7,8 @@
%% xeCJK.dtx (with options: `xunicode')
%%
%% Copyright (C) 2007--2010 by Wenchang Sun <sunwch@nankai.edu.cn>
-%% Copyright (C) 2009--2018 by Leo Liu <leoliu.pku@gmail.com>
-%% Copyright (C) 2012--2018 by Qing Lee <sobenlee@gmail.com>
+%% Copyright (C) 2009--2019 by Leo Liu <leoliu.pku@gmail.com>
+%% Copyright (C) 2012--2019 by Qing Lee <sobenlee@gmail.com>
%% ----------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx b604170 2018-04-30 10:29:28 +0800 Liu Haiyang <leoliu.pku@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 8be031f 2019-04-07 23:30:14 +0800 Qing Lee <sobenlee@gmail.com> $
{addon file for xunicode}
\ProvidesExplPackage{xunicode-addon}
- {\ExplFileDate}{3.7.1}{\ExplFileDescription}
+ {\ExplFileDate}{3.7.2}{\ExplFileDescription}
\bool_lazy_or:nnF
{ \sys_if_engine_xetex_p: }
{ \sys_if_engine_luatex_p: }
@@ -159,7 +159,7 @@
}
\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:
+ \tex_iffontchar:D \tex_font:D \tex_numexpr:D #1 \scan_stop:
\prg_return_true: \else: \prg_return_false: \fi:
}
\RenewDocumentCommand \UndeclareUTFcharacter { O { \UTFencname } m m }
@@ -231,7 +231,7 @@
{
\__xunadd_provide_text_command_default:N #1
\exp_after:wN \__xunadd_declare_character:NNxn
- \utex_char:D \__xunadd_check_slot:n {#3} \exp_stop_f:
+ \tex_Uchar: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 }
@@ -292,7 +292,7 @@
\q_stop
}
\cs_new_protected:Npn \__xunadd_chardef:Nn #1#2
- { \tex_chardef:D #1 = \etex_numexpr:D #2 \scan_stop: }
+ { \tex_chardef:D #1 = \tex_numexpr:D #2 \scan_stop: }
\cs_generate_variant:Nn \__xunadd_chardef:Nn { c }
\cs_generate_variant:Nn \__xunadd_declare_composite:Nnnn { c }
\NewDocumentCommand \DeclareUTFCompositeCommand { m O { \UTFencname } m m }
@@ -346,8 +346,8 @@
\cs_new_protected:Npn \__xunadd_declare_encoded:NNnnn #1#2#3#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:
+ \tex_Uchar:D \__xunadd_check_slot:n {#4} \exp_after:wN \exp_stop_f:
+ \tex_Uchar: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
@@ -596,9 +596,8 @@
}
\cs_new_protected:Npn \__xunadd_text_tipa_command:nnn #1#2#3
{
- \exp_after:wN \__xunadd_check_for_tipa:NNn
- \cs:w \use_none:n #2 \exp_after:wN \cs_end:
- \cs:w UTF/#1#2 \cs_end: {#3}
+ \exp_args:Ncc \__xunadd_check_for_tipa:NNn
+ { \use_none:n #2 } { UTF/#1#2 } {#3}
}
\cs_new_protected:Npn \__xunadd_check_for_tipa:NNn #1#2#3
{
@@ -609,6 +608,74 @@
}
{ #2 {#3} }
}
+\cs_new_protected:Npn \xunadd_get_slot:nn #1#2
+ { \__xunadd_get_slot:wn #2 \q_nil \q_stop {#1} }
+\cs_new_protected:Npn \__xunadd_get_slot:wn #1#2#3 \q_stop #4
+ {
+ \int_set:Nn \l_xunadd_slot_int { -1 }
+ \bool_set_false:N \l_xunadd_rest_bool
+ \group_begin: \exp_args:Nccc \group_end:
+ { __xunadd_get_slot:NNnn }
+ { #4 \token_to_str:N #1 }
+ { \__xunadd_composite_cs:Nnn #1 {#4} {#2} }
+ {#2}
+ {#3}
+ }
+\int_new:N \l_xunadd_slot_int
+\bool_new:N \l_xunadd_rest_bool
+\cs_new_protected:Npn \__xunadd_get_slot:NNnn #1#2#3#4
+ {
+ \cs_if_free:NF #1
+ {
+ \cs_if_exist:NTF #2
+ { \__xunadd_get_composite_slot:Nn #2 {#4} }
+ { \__xunadd_get_character_slot:Nn #1 { #3 #4 } }
+ }
+ }
+\cs_new_protected:Npn \__xunadd_get_composite_slot:Nn #1#2
+ {
+ \token_if_chardef:NT #1
+ {
+ \int_set:Nn \l_xunadd_slot_int {#1}
+ \quark_if_nil:nF {#2}
+ { \bool_set_true:N \l_xunadd_rest_bool }
+ }
+ }
+\cs_new_protected:Npn \__xunadd_get_character_slot:Nn #1
+ {
+ \exp_after:wN \__xunadd_get_character_slot_aux:wn #1
+ \__xunadd_text_character:nN \q_nil \q_nil \q_stop
+ }
+\cs_new_protected:Npn \__xunadd_get_character_slot_aux:wn
+ #1 \__xunadd_text_character:nN #2#3#4 \q_stop #5
+ {
+ \quark_if_nil:nF {#2}
+ {
+ \int_set:Nn \l_xunadd_slot_int { `#3 }
+ \quark_if_nil:nF {#5}
+ { \bool_set_true:N \l_xunadd_rest_bool }
+ }
+ }
+\cs_new_protected:Npn \xunadd@microtype@is@charx #1 \relax
+ {
+ \use:x
+ { \xunadd_get_slot:nn { \MT@encoding } { \tex_the:D \MT@toks } }
+ \int_compare:nNnTF \l_xunadd_slot_int < \c_zero_int
+ { \xunadd@original@is@charx #1 \relax }
+ {
+ \cs_set_nopar:Npx \MT@char@ { \int_use:N \l_xunadd_slot_int }
+ \bool_if:NT \l_xunadd_rest_bool { \MT@norestfalse }
+ }
+ }
+\AtBeginDocument
+ {
+ \cs_if_free:NF \MT@is@charx
+ {
+ \cs_new_eq:NN \xunadd@original@is@charx \MT@is@charx
+ \cs_set_eq:NN \MT@is@charx \xunadd@microtype@is@charx
+ \cs_set_eq:NN \MT@warn@unknown@once \use_none:n
+ }
+ }
%%
%% This package consists of the files xeCJK.dtx,
%% full-stop.map,