Debian Codegraph @

texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty

raw
1 %%
2 %% This is file `xeCJKfntef.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xeCJK.dtx (with options: `fntef')
8 %%
9 %% Copyright (C) 2007--2010 by Wenchang Sun <[email protected]>
10 %% Copyright (C) 2009--2022 by Leo Liu <[email protected]>
11 %% Copyright (C) 2012--2022 by Qing Lee <[email protected]>
12 %% ----------------------------------------------------------------------
13 %%
14 %% This work may be distributed and/or modified under the
15 %% conditions of the LaTeX Project Public License, either
16 %% version 1.3c of this license or (at your option) any later
17 %% version. This version of this license is in
18 %% http://www.latex-project.org/lppl/lppl-1-3c.txt
19 %% and the latest version of this license is in
20 %% http://www.latex-project.org/lppl.txt
21 %% and version 1.3 or later is part of all distributions of
22 %% LaTeX version 2005/12/01 or later.
23 %%
24 %% This work has the LPPL maintenance status "maintained".
25 %%
26 %% The Current Maintainers of this work are Leo Liu and Qing Lee.
27 %%
28 %% ----------------------------------------------------------------------
29 %%
30 \NeedsTeXFormat{LaTeX2e}
31 \RequirePackage{expl3}
32 \GetIdInfo$Id: xeCJK.dtx c4ccfae 2022-08-05 21:02:32 +0800 Qing Lee <[email protected]> $
33 {xeCJK font effect}
34 \ProvidesExplPackage{xeCJKfntef}
35 {\ExplFileDate}{3.9.1}{\ExplFileDescription}
36 \PassOptionsToPackage { normalem } { ulem }
37 \DeclareOption* { \PassOptionsToPackage { \CurrentOption } { ulem } }
38 \ProcessOptions \scan_stop:
39 \RequirePackage { xeCJK }
40 \RequirePackage { ulem }
41 \addto@hook \UL@hook { \xeCJK_hook_for_ulem: }
42 \cs_new_protected:Npn \xeCJK_hook_for_ulem:
43 {
44 \xeCJK_ulem_detect_node:
45 \l__xeCJK_ulem_text_format_tl
46 \bool_if:NF \l__xeCJK_ulem_hook_used_bool
47 {
48 \bool_set_true:N \l__xeCJK_ulem_hook_used_bool
49 \__xeCJK_ulem_hook:
50 }
51 \xeCJK_ulem_begin_node:
52 }
53 \cs_new_protected:Npn \__xeCJK_ulem_hook:
54 {
55 \__xeCJK_ulem_initial:
56 \bool_if:NT \l__xeCJK_ulem_subtract_bool
57 {
58 \xeCJK_swap_cs:NN \UL@leaders \xeCJK_ulem_leaders:
59 \cs_set_eq:NN \__xeCJK_ulem_var_leaders: \xeCJK_ulem_var_leaders:
60 \cs_set_eq:NN \xeCJK_ulem_right_skip: \__xeCJK_ulem_right_skip:
61 }
62 \bool_if:NT \l__xeCJK_ulem_hidden_bool
63 { \cs_set_eq:NN \UL@putbox \__xeCJK_ulem_hidden_box: }
64 \bool_if:NTF \l__xeCJK_ulem_skip_bool
65 {
66 \cs_set_eq:NN \__xeCJK_ulem_putbox: \UL@putbox
67 \cs_set_eq:NN \__xeCJK_ulem_hskip_aux:n \xeCJK_ulem_hskip:n
68 }
69 {
70 \xeCJK_swap_cs:NN \__xeCJK_punct_hskip:n \__xeCJK_ulem_punct_hskip:n
71 \xeCJK_cs_clear:N \__xeCJK_ulem_skip_punct_begin:
72 \xeCJK_cs_clear:N \__xeCJK_ulem_skip_punct_end:
73 }
74 \xeCJK_glue_to_skip:nN
75 {
76 \cs_set_eq:NN \ \tex_space:D
77 \cs_set_eq:NN \penalty \tex_penalty:D
78 \cs_set_eq:NN \hskip \skip_horizontal:N
79 \CJKglue
80 } \l__xeCJK_ccglue_skip
81 \xeCJK_glue_to_skip:nN
82 {
83 \cs_set_eq:NN \ \tex_space:D
84 \cs_set_eq:NN \penalty \tex_penalty:D
85 \cs_set_eq:NN \hskip \skip_horizontal:N
86 \CJKecglue
87 } \l__xeCJK_ecglue_skip
88 \xeCJK_glue_to_skip:nN { \xeCJK_space_glue: } \l__xeCJK_space_skip
89 \cs_set_protected:Npn \CJKglue
90 { \__xeCJK_ulem_glue:n \l__xeCJK_ccglue_skip }
91 \cs_set_protected:Npn \CJKecglue
92 { \__xeCJK_ulem_glue:n \l__xeCJK_ecglue_skip }
93 \cs_set_protected:Npn \xeCJK_space_glue:
94 { \__xeCJK_ulem_glue:n \l__xeCJK_space_skip }
95 \cs_set_eq:NN \xeCJK_punct_node:N \use_none:n
96 \cs_set_eq:NN \xeCJK_if_last_punct:TF \use_ii:nn
97 \keys_set:nn { xeCJK / options }
98 { CheckFullRight = false , xCJKecglue = false }
99 }
100 \skip_new:N \l__xeCJK_space_skip
101 \bool_new:N \l__xeCJK_ulem_hook_used_bool
102 \cs_new_protected:Npn \xeCJK_ulem_word:nw #1 ~
103 {
104 \__xeCJK_ulem_start:w #1 ~
105 \exp_after:wN \if_meaning:w \exp_after:wN \UL@end #1
106 \exp_after:wN \__xeCJK_ulem_end:
107 \else:
108 \exp_after:wN \__xeCJK_ulem_loop:nw
109 \fi:
110 }
111 \cs_new_protected:Npn \__xeCJK_ulem_end:
112 {
113 \c_group_end_token
114 \c_group_end_token
115 \tex_unskip:D \tex_unskip:D \tex_unskip:D
116 \xeCJK_ulem_right_skip:
117 \xeCJK_ulem_group_end:
118 \xeCJK_ulem_right_node:
119 \int_set:Nn \tex_spacefactor:D { \UL@spfactor }
120 }
121 \cs_new_protected:Npn \__xeCJK_ulem_loop:nw
122 {
123 \reverse_if:N \if_mode_math:
124 \reverse_if:N \if_dim:w \tex_lastskip:D = \c_zero_dim
125 \skip_gset_eq:NN \UL@skip \tex_lastskip:D
126 \tex_unskip:D
127 \UL@stop \UL@leaders
128 \fi:
129 \fi:
130 \xeCJK_ulem_word:nw \prg_do_nothing:
131 }
132 \cs_new_protected:Npn \__xeCJK_ulem_start:w
133 { \exp_after:wN \UL@start }
134 \cs_set_eq:NN \UL@word \xeCJK_ulem_word:nw
135 \cs_new_protected:Npn \xeCJK_ulem_left:
136 {
137 \xeCJK_ulem_left_node:
138 \xeCJK_make_group_tag:
139 }
140 \cs_new_eq:NN \xeCJK_ulem_left_node: \prg_do_nothing:
141 \cs_new_protected:Npn \xeCJK_ulem_detect_node:
142 {
143 \scan_stop:
144 \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim
145 {
146 \xeCJK_cs_clear:N \xeCJK_ulem_left_node:
147 \xeCJK_cs_clear:N \xeCJK_ulem_begin_node:
148 \cs_set_eq:NN \__xeCJK_ulem_hskip:n \xeCJK_ulem_hskip:n
149 }
150 {
151 \dim_set_eq:NN \l__xeCJK_tmp_dim \tex_lastkern:D
152 \tex_unkern:D
153 \dim_compare:nNnTF \tex_lastkern:D = { - \l__xeCJK_tmp_dim }
154 {
155 \tex_unkern:D
156 \cs_set_protected:Npx \xeCJK_ulem_left_node:
157 {
158 \tex_kern:D - \dim_use:N \l__xeCJK_tmp_dim \exp_stop_f:
159 \tex_kern:D \dim_use:N \l__xeCJK_tmp_dim \exp_stop_f:
160 }
161 \cs_set_protected:Npn \xeCJK_ulem_begin_node:
162 { { \xeCJK_make_node:n { ulem-begin } } }
163 \cs_set_eq:NN \__xeCJK_ulem_hskip:n \__xeCJK_ulem_hskip_first:n
164 }
165 {
166 \tex_kern:D \l__xeCJK_tmp_dim
167 \xeCJK_cs_clear:N \xeCJK_ulem_left_node:
168 \xeCJK_cs_clear:N \xeCJK_ulem_begin_node:
169 \cs_set_eq:NN \__xeCJK_ulem_hskip:n \xeCJK_ulem_hskip:n
170 }
171 }
172 }
173 \xeCJK_declare_node:n { ulem-begin }
174 \cs_new_eq:NN \xeCJK_ulem_begin_node: \prg_do_nothing:
175 \cs_new_protected:Npn \__xeCJK_ulem_hskip_first:n #1
176 {
177 \xeCJK_if_last_node:nTF { ulem-begin }
178 {
179 \xeCJK_remove_node:
180 \skip_horizontal:n {#1}
181 }
182 { \xeCJK_ulem_hskip:n {#1} }
183 \cs_set_eq:NN \__xeCJK_ulem_hskip:n \xeCJK_ulem_hskip:n
184 }
185 \cs_new_eq:NN \__xeCJK_ulem_hskip:n \__xeCJK_ulem_hskip_first:n
186 \cs_new_protected:Npn \xeCJK_ulem_hskip:n #1
187 { { \skip_set:Nn \UL@skip {#1} \UL@leaders } }
188 \cs_new_protected:Npn \xeCJK_ulem_right:
189 {
190 \scan_stop:
191 \dim_compare:nNnTF \tex_lastkern:D = \c_zero_dim
192 { \xeCJK_cs_gclear:N \xeCJK_ulem_right_node: }
193 {
194 \dim_compare:nNnTF \tex_lastkern:D = { 3sp }
195 { \xeCJK_cs_gclear:N \xeCJK_ulem_right_node: }
196 {
197 \exp_args:NNo \tex_unkern:D
198 \__xeCJK_ulem_right_aux:n { \dim_use:N \tex_lastkern:D }
199 }
200 }
201 }
202 \cs_new_protected:Npn \__xeCJK_ulem_right_aux:n #1
203 {
204 \dim_compare:nNnTF \tex_lastkern:D = { - #1 }
205 {
206 \tex_unkern:D
207 \cs_gset_protected:Npn \xeCJK_ulem_right_node:
208 {
209 \tex_kern:D - #1 \exp_stop_f:
210 \tex_kern:D #1 \exp_stop_f:
211 }
212 \tl_gset:Nx \UL@spfactor { \int_use:N \tex_spacefactor:D }
213 }
214 {
215 \tex_kern:D #1 \exp_stop_f:
216 \xeCJK_cs_gclear:N \xeCJK_ulem_right_node:
217 }
218 }
219 \cs_new_eq:NN \xeCJK_ulem_right_node: \prg_do_nothing:
220 \cs_new_protected:Npn \xeCJK_ulem_leaders:
221 { \__xeCJK_ulem_var_leaders: }
222 \cs_new_protected:Npn \xeCJK_ulem_var_leaders:
223 {
224 \scan_stop:
225 \skip_if_eq:nnF { \UL@skip } { \c_zero_skip }
226 {
227 \UL@leadtype \skip_horizontal:n { \UL@skip + \UL@pixel }
228 \skip_horizontal:n { - \UL@pixel }
229 \cs_gset_eq:NN \__xeCJK_ulem_var_leaders: \xeCJK_ulem_leaders:
230 }
231 }
232 \cs_new_eq:NN \__xeCJK_ulem_var_leaders: \xeCJK_ulem_var_leaders:
233 \cs_new_eq:NN \xeCJK_ulem_right_skip: \prg_do_nothing:
234 \cs_new_protected:Npn \__xeCJK_ulem_right_skip:
235 {
236 \int_case:nn { \tex_lastnodetype:D }
237 {
238 { \c__xeCJK_hlist_node } { \__xeCJK_ulem_right_skip_hbox: }
239 { \c__xeCJK_glue_node } { \__xeCJK_ulem_right_skip_glue: }
240 { \c__xeCJK_penalty_node } { \__xeCJK_ulem_right_skip_penalty: }
241 }
242 }
243 \cs_new_protected:Npn \__xeCJK_ulem_right_skip_hbox:
244 {
245 \box_set_to_last:N \l__xeCJK_tmp_box
246 \__xeCJK_if_last_kern:TF
247 { \__xeCJK_ulem_right_skip_kern: }
248 { \__xeCJK_ulem_right_skip_glue: }
249 \box_use_drop:N \l__xeCJK_tmp_box
250 }
251 \cs_new_protected:Npn \__xeCJK_ulem_right_skip_kern:
252 {
253 \dim_set:Nn \l__xeCJK_tmp_dim { - \box_wd:N \l__xeCJK_tmp_box }
254 \dim_compare:nNnT \tex_lastkern:D = \l__xeCJK_tmp_dim
255 {
256 \tex_unkern:D
257 \__xeCJK_ulem_right_skip_glue:
258 \tex_kern:D \l__xeCJK_tmp_dim
259 }
260 }
261 \cs_new_protected:Npn \__xeCJK_ulem_right_skip_glue:
262 {
263 \skip_if_eq:nnT { \tex_lastskip:D } { - \UL@pixel }
264 {
265 \tex_unskip:D
266 \skip_set:Nn \l__xeCJK_tmp_skip { \tex_lastskip:D - \UL@pixel }
267 \tex_unskip:D
268 \UL@leadtype \skip_horizontal:N \l__xeCJK_tmp_skip
269 }
270 }
271 \cs_new_protected:Npn \__xeCJK_ulem_right_skip_penalty:
272 {
273 \int_set_eq:NN \l__xeCJK_tmp_int \tex_lastpenalty:D
274 \tex_unpenalty:D
275 \__xeCJK_if_last_hlist:T
276 { \__xeCJK_ulem_right_skip_hbox: }
277 \tex_penalty:D \l__xeCJK_tmp_int
278 }
279 \cs_new_protected:Npn \__xeCJK_ulem_hidden_box:
280 {
281 \tl_if_empty:NF \UL@start
282 {
283 \box_set_ht:Nn \l__xeCJK_hidden_box { \box_ht:N \UL@box }
284 \box_set_dp:Nn \l__xeCJK_hidden_box { \box_dp:N \UL@box }
285 \box_use:N \l__xeCJK_hidden_box
286 \xeCJK_no_break:
287 \xeCJK_ulem_hskip:n { \box_wd:N \UL@box }
288 \box_use:N \l__xeCJK_hidden_box
289 }
290 }
291 \box_new:N \l__xeCJK_hidden_box
292 \hbox_set:Nn \l__xeCJK_hidden_box { }
293 \cs_new_protected:Npn \__xeCJK_ulem_skip_punct_begin:
294 {
295 \cs_set_eq:NN \UL@putbox \__xeCJK_ulem_skip_putbox:
296 \cs_set_eq:NN \xeCJK_ulem_hskip:n \skip_horizontal:n
297 }
298 \cs_new_protected:Npn \__xeCJK_ulem_skip_punct_end:
299 {
300 \cs_set_eq:NN \UL@putbox \__xeCJK_ulem_putbox:
301 \cs_set_eq:NN \xeCJK_ulem_hskip:n \__xeCJK_ulem_hskip_aux:n
302 }
303 \cs_new_eq:NN \__xeCJK_ulem_putbox: \UL@putbox
304 \cs_new_protected:Npn \__xeCJK_ulem_skip_putbox:
305 {
306 \tl_if_empty:NF \UL@start
307 { \box_use_drop:N \UL@box }
308 }
309 \cs_new_protected:Npn \__xeCJK_ulem_initial:
310 {
311 \__xeCJK_ulem_swap_cs:NN
312 \xeCJK_FullLeft_and_Default: \__xeCJK_ulem_FullLeft_and_Default:
313 \xeCJK_FullLeft_and_CJK: \__xeCJK_ulem_FullLeft_and_CJK:
314 \xeCJK_FullLeft_and_Boundary: \__xeCJK_ulem_FullLeft_and_Boundary:
315 \xeCJK_FullRight_and_Default: \__xeCJK_ulem_FullRight_and_Default:
316 \xeCJK_FullRight_and_CJK: \__xeCJK_ulem_FullRight_and_CJK:
317 \xeCJK_FullRight_and_Boundary: \__xeCJK_ulem_FullRight_and_Boundary:
318 \xeCJK_CJK_and_CJK:N \__xeCJK_ulem_CJK_and_CJK:N
319 \xeCJK_CJK_and_Boundary:w \__xeCJK_ulem_CJK_and_Boundary:w
320 \xeCJK@fix@penalty \__xeCJK_ulem_fix_penalty:
321 \__xeCJK_punct_breakable_kern:n \__xeCJK_ulem_punct_breakable_kern:n
322 \__xeCJK_Default_and_FullLeft_glue:N \__xeCJK_ulem_Default_and_FullLeft_glue:N
323 \__xeCJK_Default_and_FullRight_glue:N \__xeCJK_ulem_Default_and_FullRight_glue:N
324 \__xeCJK_CJK_and_FullLeft_glue:N \__xeCJK_ulem_CJK_and_FullLeft_glue:N
325 \__xeCJK_CJK_and_FullRight_glue:N \__xeCJK_ulem_CJK_and_FullRight_glue:N
326 \__xeCJK_Boundary_and_FullLeft_glue:N \__xeCJK_ulem_Boundary_and_FullLeft_glue:N
327 \q_recursion_tail \q_nil \q_recursion_stop
328 \seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq
329 {
330 \seq_map_inline:Nn \g__xeCJK_CJK_sub_class_seq
331 {
332 \str_if_eq:nnTF {##1} {####1}
333 {
334 \xeCJK_inter_class_toks:nnn { CJK } { CJK/##1 }
335 { \__xeCJK_ulem_between_CJK_blocks:nnN { CJK } {##1} }
336 \xeCJK_inter_class_toks:nnn { CJK/##1 } { CJK/##1 }
337 { \__xeCJK_ulem_between_CJK_blocks:nnN { CJK } {##1} }
338 }
339 {
340 \xeCJK_inter_class_toks:nnn { CJK/##1 } { CJK/####1 }
341 { \__xeCJK_ulem_between_CJK_blocks:nnN {##1} {####1} }
342 }
343 }
344 }
345 }
346 \cs_new_protected:Npn \__xeCJK_ulem_swap_cs:NN #1#2
347 {
348 \quark_if_recursion_tail_stop:N #1
349 \xeCJK_swap_cs:NN #1#2
350 \__xeCJK_ulem_swap_cs:NN
351 }
352 \cs_new:Npn \xeCJK_if_ulem_patch:TF
353 {
354 \if_meaning:w \ \LA@space
355 \exp_after:wN \use_ii:nn
356 \else:
357 \exp_after:wN \use_i:nn
358 \fi:
359 }
360 \cs_new_protected:Npn \__xeCJK_ulem_CJK_and_Boundary:w
361 {
362 \xeCJK_if_ulem_patch:TF
363 {
364 \xeCJK_peek_catcode_ignore_spaces:NTF \c_math_toggle_token
365 { \xeCJK_class_group_end: \CJKecglue }
366 {
367 \bool_if:NTF \l__xeCJK_peek_ignore_spaces_bool
368 { \__xeCJK_ulem_peek_math:w }
369 { \__xeCJK_ulem_group_end:n { CJK } }
370 }
371 }
372 { \__xeCJK_ulem_CJK_and_Boundary:w }
373 }
374 \cs_new_protected:Npn \__xeCJK_ulem_group_end:n #1
375 {
376 \xeCJK_class_group_end: \UL@stop
377 \UL@start { \xeCJK_make_node:n {#1} }
378 \xeCJK_make_group_tag:
379 }
380 \cs_new_protected:Npn \__xeCJK_ulem_peek_math:w
381 {
382 \cs_set_eq:NN \__xeCJK_ulem_start:w \__xeCJK_ulem_exp_stop:w
383 \exp_after:wN \peek_after:Nw
384 \exp_after:wN \__xeCJK_ulem_peek_math_branches:w
385 \exp:w \exp_end_continue_f:w
386 }
387 \cs_new_protected:Npn \__xeCJK_ulem_peek_math_branches:w
388 {
389 \token_if_math_toggle:NTF \l_peek_token
390 { \xeCJK_class_group_end: \CJKecglue }
391 { \__xeCJK_ulem_group_end:n { CJK-space } }
392 }
393 \cs_new_protected:Npn \__xeCJK_ulem_exp_stop:w
394 {
395 \cs_if_eq:NNTF \UL@start \@empty
396 { \exp_after:wN \exp_stop_f: }
397 { \exp_after:wN \UL@start }
398 }
399 \cs_new_protected:Npn \__xeCJK_ulem_fix_penalty:
400 {
401 \xeCJK_if_ulem_patch:TF
402 { \fix@penalty }
403 { \__xeCJK_ulem_fix_penalty: }
404 }
405 \cs_new_protected:Npn \__xeCJK_ulem_CJK_and_CJK:N
406 {
407 \xeCJK_if_ulem_patch:TF
408 {
409 \xeCJK_class_group_end:
410 \UL@stop \__xeCJK_ulem_ccglue: \UL@start
411 \__xeCJK_ulem_class_group_begin:
412 \xeCJK_select_font:
413 \xeCJK_fallback_symbol:NN
414 \CJKsymbol
415 }
416 { \__xeCJK_ulem_CJK_and_CJK:N }
417 }
418 \cs_new_protected:Npn \__xeCJK_ulem_class_group_begin:
419 {
420 \xeCJK_class_group_begin:
421 \xeCJK_clear_Boundary_and_CJK_toks:
422 }
423 \cs_new_protected:Npn \__xeCJK_ulem_between_CJK_blocks:nnN #1#2
424 {
425 \xeCJK_if_ulem_patch:TF
426 {
427 \xeCJK_class_group_end:
428 \UL@stop \__xeCJK_ulem_ccglue: \UL@start
429 \xeCJK_class_group_begin:
430 \xeCJK_clear_Boundary_and_CJK_toks:
431 \__xeCJK_switch_font:nn {#1} {#2}
432 \xeCJK_fallback_symbol:NN
433 \CJKsymbol
434 }
435 {
436 \skip_horizontal:N \l__xeCJK_ccglue_skip
437 \__xeCJK_switch_font:nn {#1} {#2}
438 \xeCJK_fallback_symbol:NN
439 \CJKsymbol
440 }
441 }
442 \cs_new_protected:Npn \__xeCJK_ulem_Default_and_FullLeft_glue:N #1
443 {
444 \xeCJK_if_ulem_patch:TF
445 {
446 \UL@stop
447 \__xeCJK_ulem_skip_punct_begin:
448 \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
449 \UL@start
450 }
451 { \__xeCJK_ulem_Default_and_FullLeft_glue:N #1 }
452 }
453 \cs_new_protected:Npn \__xeCJK_ulem_Boundary_and_FullLeft_glue:N #1
454 {
455 \xeCJK_if_ulem_patch:TF
456 {
457 \UL@stop
458 \__xeCJK_ulem_skip_punct_begin:
459 \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
460 \UL@start
461 }
462 { \__xeCJK_ulem_Boundary_and_FullLeft_glue:N #1 }
463 }
464 \cs_new_protected:Npn \__xeCJK_ulem_CJK_and_FullLeft_glue:N #1
465 {
466 \xeCJK_if_ulem_patch:TF
467 {
468 \xeCJK_class_group_end:
469 \UL@stop
470 \__xeCJK_ulem_skip_punct_begin:
471 \__xeCJK_ulem_punct_ccglue:
472 \__xeCJK_punct_glue:NN \c__xeCJK_left_tl #1
473 \UL@start
474 \__xeCJK_ulem_class_group_begin:
475 \xeCJK_select_punct_font:
476 }
477 { \__xeCJK_ulem_CJK_and_FullLeft_glue:N #1 }
478 }
479 \cs_new_protected:Npn \__xeCJK_ulem_Default_and_FullRight_glue:N #1
480 {
481 \xeCJK_if_ulem_patch:TF
482 {
483 \UL@stop
484 \__xeCJK_ulem_skip_punct_begin:
485 \__xeCJK_punct_if_long:NTF #1
486 { \xeCJK_allow_break: }
487 { \xeCJK_no_break: }
488 \__xeCJK_punct_if_middle:NT #1
489 {
490 \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
491 \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #1
492 }
493 \UL@start
494 }
495 { \__xeCJK_ulem_Default_and_FullRight_glue:N #1 }
496 }
497 \cs_new_protected:Npn \__xeCJK_ulem_CJK_and_FullRight_glue:N #1
498 {
499 \xeCJK_if_ulem_patch:TF
500 {
501 \xeCJK_class_group_end:
502 \UL@stop
503 \__xeCJK_ulem_skip_punct_begin:
504 \__xeCJK_punct_if_long:NTF #1
505 { \xeCJK_allow_break: }
506 { \xeCJK_no_break: }
507 \__xeCJK_punct_if_middle:NT #1
508 {
509 \__xeCJK_ulem_punct_ccglue:
510 \__xeCJK_punct_glue:NN \c__xeCJK_right_tl #1
511 \__xeCJK_punct_rule:NN \c__xeCJK_left_tl #1
512 }
513 \UL@start
514 \__xeCJK_ulem_class_group_begin:
515 \xeCJK_select_punct_font:
516 }
517 { \__xeCJK_ulem_CJK_and_FullRight_glue:N #1 }
518 }
519 \cs_new_protected:Npn \__xeCJK_ulem_FullLeft_and_Default:
520 {
521 \xeCJK_if_ulem_patch:TF
522 {
523 \__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
524 {
525 \xeCJK_get_punct_bounds:No \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
526 \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
527 \xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
528 \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
529 }
530 { \xeCJK_class_group_end: \UL@stop }
531 \__xeCJK_ulem_skip_punct_end:
532 \xeCJK_no_break:
533 \UL@start
534 }
535 { \__xeCJK_ulem_FullLeft_and_Default: }
536 }
537 \cs_new_protected:Npn \__xeCJK_ulem_FullLeft_and_Boundary:
538 {
539 \xeCJK_if_ulem_patch:TF
540 {
541 \__xeCJK_punct_if_middle:NTF \g__xeCJK_last_punct_tl
542 {
543 \xeCJK_get_punct_bounds:No \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
544 \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
545 \xeCJK_class_group_end: \UL@stop \xeCJK_no_break:
546 \__xeCJK_punct_glue:NN \c__xeCJK_left_tl \g__xeCJK_last_punct_tl
547 }
548 { \xeCJK_class_group_end: \UL@stop }
549 \__xeCJK_ulem_skip_punct_end:
550 \xeCJK_no_break:
551 \UL@start
552 \tex_ignorespaces:D
553 }
554 { \__xeCJK_ulem_FullLeft_and_Boundary: }
555 }
556 \cs_new_protected:Npn \__xeCJK_ulem_FullLeft_and_CJK:
557 {
558 \xeCJK_if_ulem_patch:TF
559 {
560 \xeCJK_FullLeft_and_Default:
561 \__xeCJK_ulem_class_group_begin:
562 \xeCJK_select_font:
563 }
564 { \__xeCJK_ulem_FullLeft_and_CJK: }
565 }
566 \cs_new_protected:Npn \__xeCJK_ulem_FullRight_and_Default:
567 {
568 \xeCJK_if_ulem_patch:TF
569 {
570 \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
571 \xeCJK_class_group_end:
572 \UL@stop
573 \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
574 \__xeCJK_ulem_skip_punct_end:
575 \UL@start
576 }
577 { \__xeCJK_ulem_FullRight_and_Default: }
578 }
579 \cs_new_protected:Npn \__xeCJK_ulem_FullRight_and_Boundary:
580 {
581 \xeCJK_if_ulem_patch:TF
582 {
583 \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
584 \xeCJK_class_group_end:
585 \UL@stop
586 \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
587 \__xeCJK_ulem_skip_punct_end:
588 \UL@start
589 \tex_ignorespaces:D
590 }
591 { \__xeCJK_ulem_FullRight_and_Boundary: }
592 }
593 \cs_new_protected:Npn \__xeCJK_ulem_FullRight_and_CJK:
594 {
595 \xeCJK_if_ulem_patch:TF
596 {
597 \__xeCJK_punct_rule:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
598 \xeCJK_class_group_end:
599 \UL@stop
600 \__xeCJK_punct_glue:NN \c__xeCJK_right_tl \g__xeCJK_last_punct_tl
601 \__xeCJK_ulem_punct_ccglue:
602 \__xeCJK_ulem_skip_punct_end:
603 \UL@start
604 \__xeCJK_ulem_class_group_begin:
605 \xeCJK_select_font:
606 }
607 { \__xeCJK_ulem_FullRight_and_CJK: }
608 }
609 \cs_new_protected:Npn \__xeCJK_ulem_punct_hskip:n
610 {
611 \xeCJK_if_ulem_patch:TF
612 { \xeCJK_ulem_hskip:n }
613 { \__xeCJK_ulem_punct_hskip:n }
614 }
615 \cs_new_protected:Npn \__xeCJK_ulem_punct_breakable_kern:n #1
616 {
617 \xeCJK_if_ulem_patch:TF
618 {
619 \xeCJK_class_group_end:
620 \UL@stop \xeCJK_ulem_hskip:n {#1} \UL@start
621 \__xeCJK_ulem_class_group_begin:
622 \xeCJK_select_punct_font:
623 }
624 { \__xeCJK_ulem_punct_breakable_kern:n {#1} }
625 }
626 \cs_new_protected:Npn \__xeCJK_ulem_glue:n #1
627 {
628 \xeCJK_if_ulem_patch:TF
629 {
630 \tl_if_empty:NTF \l__xeCJK_group_tag_tl
631 { \UL@stop \__xeCJK_ulem_hskip:n {#1} \UL@start }
632 {
633 \str_if_eq:eeTF { \l__xeCJK_group_tag_tl } { \c__xeCJK_group_tag_tl }
634 { \UL@stop \__xeCJK_ulem_hskip:n {#1} \UL@start }
635 { \skip_horizontal:n {#1} }
636 }
637 }
638 { \skip_horizontal:n {#1} }
639 }
640 \cs_new_protected:Npn \xeCJK_make_group_tag:
641 { \tl_set:Nx \l__xeCJK_group_tag_tl { \c__xeCJK_group_tag_tl } }
642 \tl_new:N \l__xeCJK_group_tag_tl
643 \tl_const:Nn \c__xeCJK_group_tag_tl
644 {
645 T \int_use:N \tex_currentgrouptype:D
646 L \int_use:N \tex_currentgrouplevel:D
647 }
648 \cs_new_protected:Npn \__xeCJK_ulem_ccglue:
649 { { \skip_set_eq:NN \UL@skip \l__xeCJK_ccglue_skip \UL@leaders } }
650 \cs_new_protected:Npn \__xeCJK_ulem_punct_ccglue:
651 { \__xeCJK_punct_hskip:n { \l__xeCJK_ccglue_skip } }
652 \cs_new_protected:Npn \xeCJK_ulem_group_begin:
653 {
654 \mode_leave_vertical:
655 \c_group_begin_token
656 }
657 \cs_new_protected:Npn \xeCJK_ulem_group_end:
658 { \c_group_end_token }
659 \cs_new_protected:Npn \xeCJK_ulem_on:n
660 { \ULon }
661 \cs_new_eq:NN \__xeCJK_ulem_on:n \UL@on
662 \cs_set_protected:Npn \UL@on #1
663 { \__xeCJK_ulem_on:n { \xeCJK_ulem_left: #1 \xeCJK_ulem_right: } }
664 \NewDocumentCommand \xeCJKfntefon { s t- s o }
665 {
666 \mode_leave_vertical:
667 \xeCJK_ulem_boot:NNNn #1#2#3 {#4}
668 \xeCJK_ulem_on:n
669 }
670 \NewDocumentCommand \CJKunderline { s t- s o }
671 {
672 \xeCJK_ulem_group_begin:
673 \xeCJK_fntef_boot:nnNNNn { underline } { uline } #1#2#3 {#4}
674 \xeCJK_fntef_initial:nnn
675 { \l__xeCJK_uline_depth_tl }
676 { \l__xeCJK_uline_sep_tl }
677 {
678 \l__xeCJK_uline_format_tl
679 \tex_vrule:D
680 height \dim_eval:n { \l__xeCJK_uline_thickness_tl }
681 depth \c_zero_dim
682 width .2em
683 }
684 \xeCJK_ulem_on:n
685 }
686 \NewDocumentCommand \varCJKunderline { }
687 { \CJKunderline - }
688 \NewDocumentCommand \CJKunderwave { s t- s o }
689 {
690 \xeCJK_ulem_group_begin:
691 \xeCJK_fntef_boot:nnNNNn { underwave } { uwave } #1#2#3 {#4}
692 \xeCJK_fntef_initial:nnn
693 { \l__xeCJK_uwave_depth_tl }
694 { \l__xeCJK_uwave_sep_tl }
695 { \l__xeCJK_uwave_format_tl \l__xeCJK_uwave_symbol_tl }
696 \xeCJK_ulem_on:n
697 }
698 \NewDocumentCommand \CJKunderdblline { s t- s o }
699 {
700 \xeCJK_ulem_group_begin:
701 \xeCJK_fntef_boot:nnNNNn { underdblline } { udbline } #1#2#3 {#4}
702 \xeCJK_fntef_initial:nnn
703 { \l__xeCJK_udbline_depth_tl }
704 { \l__xeCJK_udbline_sep_tl }
705 {
706 \l__xeCJK_udbline_format_tl
707 \vbox_top:n
708 {
709 \tex_hrule:D
710 height \dim_eval:n { \l__xeCJK_udbline_thickness_tl }
711 depth \c_zero_dim
712 width .2em
713 \tex_kern:D \dim_eval:n { \l__xeCJK_udbline_gap_tl }
714 \tex_hrule:D
715 height \dim_eval:n { \l__xeCJK_udbline_thickness_tl }
716 depth \c_zero_dim
717 width .2em
718 }
719 }
720 \xeCJK_ulem_on:n
721 }
722 \NewDocumentCommand \CJKsout { s t- s o }
723 {
724 \xeCJK_ulem_group_begin:
725 \xeCJK_fntef_boot:nnNNNn { sout } { sout } #1#2#3 {#4}
726 \xeCJK_fntef_initial:nn
727 {
728 \l__xeCJK_sout_format_tl
729 \tex_vrule:D
730 height \dim_eval:n { \l__xeCJK_sout_thickness_tl }
731 depth \c_zero_dim
732 width .2em
733 }
734 {
735 \box_move_up:nn
736 { \l__xeCJK_sout_height_tl - \box_ht:N \l__xeCJK_fntef_box / 2 }
737 { \box_use:N \l__xeCJK_fntef_box }
738 }
739 \xeCJK_ulem_on:n
740 }
741 \NewDocumentCommand \CJKxout { s t- s o }
742 {
743 \xeCJK_ulem_group_begin:
744 \xeCJK_fntef_boot:nnNNNn { xout } { xout } #1#2#3 {#4}
745 \xeCJK_fntef_initial:nn
746 {
747 \l__xeCJK_xout_format_tl
748 \tex_kern:D -.1 em $/$
749 \tex_kern:D -.1 em
750 }
751 {
752 \box_move_up:nn
753 { \box_dp:N \l__xeCJK_fntef_box / 2 }
754 { \box_use:N \l__xeCJK_fntef_box }
755 }
756 \xeCJK_ulem_on:n
757 }
758 \NewDocumentCommand \CJKunderanyline { s t- s o m m }
759 {
760 \xeCJK_ulem_group_begin:
761 \xeCJK_ulem_boot:NNNn #1#2#3 {#4}
762 \xeCJK_fntef_initial:nn
763 {#6}
764 {
765 \box_move_down:nn
766 {#5}
767 { \box_use:N \l__xeCJK_fntef_box }
768 }
769 \tl_if_empty:NF \l__xeCJK_ulem_boxdepth_tl
770 { \box_set_dp:Nn \ULC@box { \l__xeCJK_ulem_boxdepth_tl } }
771 \tl_if_empty:NF \l__xeCJK_ulem_sep_tl
772 {
773 \bool_set_true:N \l__xeCJK_fntef_bool
774 \dim_set:Nn \l__xeCJK_fntef_dim
775 { \l__xeCJK_ulem_sep_tl + \box_dp:N \ULC@box }
776 }
777 \xeCJK_ulem_on:n
778 }
779 \cs_new_protected:Npn \xeCJK_fntef_boot:nnNNNn #1#2#3#4#5#6
780 {
781 \bool_lazy_or:nnT {#3} {#5}
782 { \bool_set_false:c { l__xeCJK_#2_skip_bool } }
783 \bool_if:NT #4
784 { \bool_set_true:c { l__xeCJK_#2_subtract_bool } }
785 \tl_if_novalue:nF {#6}
786 { \keys_set:nn { xeCJK / options / #1 } {#6} }
787 \bool_set_eq:Nc \l__xeCJK_ulem_skip_bool { l__xeCJK_#2_skip_bool }
788 \bool_set_eq:Nc \l__xeCJK_ulem_hidden_bool { l__xeCJK_#2_hidden_bool }
789 \bool_set_eq:Nc \l__xeCJK_ulem_subtract_bool { l__xeCJK_#2_subtract_bool }
790 \tl_set_eq:Nc \l__xeCJK_ulem_text_format_tl { l__xeCJK_#2_text_format_tl }
791 }
792 \cs_new_protected:Npn \xeCJK_ulem_boot:NNNn #1#2#3#4
793 {
794 \bool_lazy_or:nnT {#1} {#3}
795 { \bool_set_false:N \l__xeCJK_ulem_skip_bool }
796 \bool_if:NT #2
797 { \bool_set_true:N \l__xeCJK_ulem_subtract_bool }
798 \tl_if_novalue:nF {#4}
799 { \keys_set:nn { xeCJK / options / ulem } {#4} }
800 }
801 \cs_new_protected:Npn \xeCJK_fntef_initial:n
802 {
803 \bool_if:NTF \l__xeCJK_nest_bool
804 { \__xeCJK_warning:n { fntef-nesting } }
805 {
806 \bool_set_true:N \l__xeCJK_nest_bool
807 \__xeCJK_restore_shipout_fntef:
808 }
809 \xeCJK_fntef_sbox:n
810 }
811 \cs_new_protected:Npn \xeCJK_fntef_initial:nn #1
812 {
813 \xeCJK_fntef_initial:n {#1}
814 \bool_if:NF \l__xeCJK_fntef_bool
815 { \dim_zero:N \l__xeCJK_fntef_dim }
816 \markoverwith
817 }
818 \cs_new_protected:Npn \xeCJK_fntef_initial:nnn #1#2#3
819 {
820 \xeCJK_fntef_initial:n {#3}
821 \bool_if:NF \l__xeCJK_fntef_bool
822 {
823 \bool_set_true:N \l__xeCJK_fntef_bool
824 \dim_set:Nn \l__xeCJK_fntef_dim {#1}
825 }
826 \markoverwith
827 {
828 \box_move_down:nn
829 { \l__xeCJK_fntef_dim + \box_ht:N \l__xeCJK_fntef_box }
830 { \box_use:N \l__xeCJK_fntef_box }
831 }
832 \dim_set:Nn \l__xeCJK_fntef_dim { #2 + \box_dp:N \ULC@box }
833 }
834 \box_new:N \l__xeCJK_fntef_box
835 \cs_new_eq:NN \xeCJKfntefbox \l__xeCJK_fntef_box
836 \bool_new:N \l__xeCJK_nest_bool
837 \bool_new:N \l__xeCJK_fntef_bool
838 \__xeCJK_msg_new:nn { fntef-nesting }
839 { Nesting~is~not~supported. }
840 \cs_new_eq:NN \l__xeCJK_fntef_dim \ULdepth
841 \cs_new_protected:Npn \xeCJK_fntef_sbox:n #1
842 {
843 \hbox_set:Nn \l__xeCJK_fntef_box
844 { \color_ensure_current: #1 }
845 }
846 \keys_define:nn { xeCJK / options }
847 {
848 underdot / symbol .tl_set:N = \l__xeCJK_udot_symbol_tl ,
849 underdot / depth .tl_set:N = \l__xeCJK_udot_depth_tl ,
850 underdot / sep .tl_set:N = \l__xeCJK_udot_sep_tl ,
851 underdot / format .tl_set:N = \l__xeCJK_udot_format_tl ,
852 underdot / textformat .tl_set:N = \l__xeCJK_udot_text_format_tl ,
853 underdot / boxdepth .tl_set:N = \l__xeCJK_udot_boxdepth_tl ,
854 symbol / sep .tl_set:N = \l__xeCJK_symbol_sep_tl ,
855 symbol / boxdepth .tl_set:N = \l__xeCJK_symbol_boxdepth_tl ,
856 symbol / textformat .tl_set:N = \l__xeCJK_symbol_text_format_tl ,
857 underline / skip .bool_set:N = \l__xeCJK_uline_skip_bool ,
858 underline / hidden .bool_set:N = \l__xeCJK_uline_hidden_bool ,
859 underline / subtract .bool_set:N = \l__xeCJK_uline_subtract_bool ,
860 underline / thickness .tl_set:N = \l__xeCJK_uline_thickness_tl ,
861 underline / depth .tl_set:N = \l__xeCJK_uline_depth_tl ,
862 underline / sep .tl_set:N = \l__xeCJK_uline_sep_tl ,
863 underline / format .tl_set:N = \l__xeCJK_uline_format_tl ,
864 underline / textformat .tl_set:N = \l__xeCJK_uline_text_format_tl ,
865 underdblline / skip .bool_set:N = \l__xeCJK_udbline_skip_bool ,
866 underdblline / hidden .bool_set:N = \l__xeCJK_udbline_hidden_bool ,
867 underdblline / subtract .bool_set:N = \l__xeCJK_udbline_subtract_bool ,
868 underdblline / thickness .tl_set:N = \l__xeCJK_udbline_thickness_tl ,
869 underdblline / depth .tl_set:N = \l__xeCJK_udbline_depth_tl ,
870 underdblline / sep .tl_set:N = \l__xeCJK_udbline_sep_tl ,
871 underdblline / format .tl_set:N = \l__xeCJK_udbline_format_tl ,
872 underdblline / textformat .tl_set:N = \l__xeCJK_udbline_text_format_tl ,
873 underdblline / gap .tl_set:N = \l__xeCJK_udbline_gap_tl ,
874 underwave / skip .bool_set:N = \l__xeCJK_uwave_skip_bool ,
875 underwave / hidden .bool_set:N = \l__xeCJK_uwave_hidden_bool ,
876 underwave / subtract .bool_set:N = \l__xeCJK_uwave_subtract_bool ,
877 underwave / symbol .tl_set:N = \l__xeCJK_uwave_symbol_tl ,
878 underwave / depth .tl_set:N = \l__xeCJK_uwave_depth_tl ,
879 underwave / sep .tl_set:N = \l__xeCJK_uwave_sep_tl ,
880 underwave / format .tl_set:N = \l__xeCJK_uwave_format_tl ,
881 underwave / textformat .tl_set:N = \l__xeCJK_uwave_text_format_tl ,
882 sout / skip .bool_set:N = \l__xeCJK_sout_skip_bool ,
883 sout / hidden .bool_set:N = \l__xeCJK_sout_hidden_bool ,
884 sout / subtract .bool_set:N = \l__xeCJK_sout_subtract_bool ,
885 sout / thickness .tl_set:N = \l__xeCJK_sout_thickness_tl ,
886 sout / height .tl_set:N = \l__xeCJK_sout_height_tl ,
887 sout / format .tl_set:N = \l__xeCJK_sout_format_tl ,
888 sout / textformat .tl_set:N = \l__xeCJK_sout_text_format_tl ,
889 xout / skip .bool_set:N = \l__xeCJK_xout_skip_bool ,
890 xout / hidden .bool_set:N = \l__xeCJK_xout_hidden_bool ,
891 xout / subtract .bool_set:N = \l__xeCJK_xout_subtract_bool ,
892 xout / format .tl_set:N = \l__xeCJK_xout_format_tl ,
893 xout / textformat .tl_set:N = \l__xeCJK_xout_text_format_tl ,
894 ulem / skip .bool_set:N = \l__xeCJK_ulem_skip_bool ,
895 ulem / hidden .bool_set:N = \l__xeCJK_ulem_hidden_bool ,
896 ulem / subtract .bool_set:N = \l__xeCJK_ulem_subtract_bool ,
897 ulem / sep .tl_set:N = \l__xeCJK_ulem_sep_tl ,
898 ulem / boxdepth .tl_set:N = \l__xeCJK_ulem_boxdepth_tl ,
899 ulem / textformat .tl_set:N = \l__xeCJK_ulem_text_format_tl
900 }
901 \clist_map_inline:nn
902 { underdot , underline , underdblline , underwave , sout , xout , ulem }
903 {
904 \keys_define:nn { xeCJK / options }
905 { #1 .meta:nn = { xeCJK / options / #1 } { ##1 } }
906 }
907 \keys_set:nn { xeCJK / options }
908 {
909 underdot / symbol = \normalfont . ,
910 underdot / depth = 0.20 em ,
911 underdot / sep = 0.04 em ,
912 symbol / sep = \c_zero_dim ,
913 underline / skip = true ,
914 underline / thickness = \ULthickness ,
915 underline / depth = 0.20 em ,
916 underline / sep = 0.07 em ,
917 underdblline / skip = true ,
918 underdblline / thickness = \ULthickness ,
919 underdblline / depth = 0.20 em ,
920 underdblline / sep = 0.17 em ,
921 underdblline / gap = 1.1 pt ,
922 underwave / skip = true ,
923 underwave / symbol = \sixly \tex_char:D 58 \exp_stop_f: ,
924 underwave / depth = 0.20 em ,
925 underwave / sep = 0.00 em ,
926 sout / skip = true ,
927 sout / thickness = \ULthickness ,
928 sout / height = 0.35 em ,
929 xout / skip = true
930 }
931 \NewDocumentCommand \CJKunderanysymbol { o m m m }
932 {
933 \xeCJK_under_symbol:nnnnnn { symbol } { symbol } {#1} {#2} {#3} {#4}
934 \tex_ignorespaces:D
935 }
936 \NewDocumentCommand \CJKunderdot { o m }
937 {
938 \xeCJK_under_symbol:nnnnnn { underdot } { udot }
939 {#1}
940 { \l__xeCJK_udot_depth_tl }
941 { \l__xeCJK_udot_format_tl \l__xeCJK_udot_symbol_tl }
942 {#2}
943 \tex_ignorespaces:D
944 }
945 \cs_new_protected:Npn \xeCJK_under_symbol:nnnnnn
946 {
947 \xeCJK_if_ulem_patch:TF
948 { \__xeCJK_under_symbol_auxi:nnnnnn }
949 { \__xeCJK_under_symbol_auxii:nnnnnn }
950 }
951 \cs_new_protected:Npn \__xeCJK_under_symbol_auxi:nnnnnn #1#2#3#4#5#6
952 {
953 \xeCJK_ulem_right: \UL@stop
954 \group_begin:
955 \xeCJK_under_symbol_initial:nnnnn {#1} {#2} {#3} {#4} {#5}
956 \use:c { l__xeCJK_#2_text_format_tl }
957 \UL@start \xeCJK_ulem_right_node:
958 #6
959 \xeCJK_ulem_right: \UL@stop
960 \group_end:
961 \UL@start \xeCJK_ulem_right_node:
962 }
963 \cs_new_protected:Npn \__xeCJK_under_symbol_auxii:nnnnnn #1#2#3#4#5#6
964 {
965 \mode_leave_vertical:
966 \group_begin:
967 \xeCJK_under_symbol_initial:nnnnn {#1} {#2} {#3} {#4} {#5}
968 \__xeCJK_under_symbol_text_format:c { l__xeCJK_#2_text_format_tl }
969 #6
970 \xeCJK_ulem_right:
971 \group_end:
972 \xeCJK_ulem_right_node:
973 }
974 \cs_new_protected:Npn \xeCJK_under_symbol_initial:nnnnn #1#2#3#4#5
975 {
976 \tl_if_novalue:nF {#3}
977 { \keys_set:nn { xeCJK / options / #1 } {#3} }
978 \xeCJK_fntef_sbox:n {#5}
979 \bool_if:NTF \l__xeCJK_fntef_bool
980 { \xeCJK_make_under_symbol:n { \l__xeCJK_fntef_dim } }
981 {
982 \bool_set_true:N \l__xeCJK_fntef_bool
983 \xeCJK_make_under_symbol:n {#4}
984 }
985 \tl_if_empty:cF { l__xeCJK_#2_boxdepth_tl }
986 {
987 \box_set_dp:Nn \l__xeCJK_under_symbol_box
988 { \use:c { l__xeCJK_#2_boxdepth_tl } }
989 }
990 \dim_set:Nn \l__xeCJK_fntef_dim
991 { \use:c { l__xeCJK_#2_sep_tl } + \box_dp:N \l__xeCJK_under_symbol_box }
992 \xeCJK_swap_cs:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N
993 \__xeCJK_restore_shipout_CJKsymbol:
994 }
995 \cs_new_protected:Npn \__xeCJK_under_symbol_text_format:N #1
996 {
997 \tl_if_empty:NF #1
998 { \xeCJK_ulem_right: #1 \xeCJK_ulem_right_node: }
999 }
1000 \cs_generate_variant:Nn \__xeCJK_under_symbol_text_format:N { c }
1001 \box_new:N \l__xeCJK_under_symbol_box
1002 \cs_new_protected:Npn \xeCJK_make_under_symbol:n #1
1003 {
1004 \hbox_set:Nn \l__xeCJK_under_symbol_box
1005 {
1006 \box_move_down:nn { #1 + \box_ht:N \l__xeCJK_fntef_box }
1007 {
1008 \hbox_to_zero:n
1009 {
1010 \xeCJK_select_font:
1011 \tex_kern:D \tex_fontcharwd:D \tex_font:D "4E00 \exp_stop_f:
1012 \tex_hss:D \box_use:N \l__xeCJK_fntef_box \tex_hss:D
1013 }
1014 }
1015 }
1016 }
1017 \cs_new_protected:Npn \__xeCJK_restore_shipout_CJKsymbol:
1018 {
1019 \tl_put_right:Nn \l__xeCJK_fntef_shipout_tl
1020 { \xeCJK_swap_cs:NN \CJKsymbol \__xeCJK_under_CJKsymbol:N }
1021 \__xeCJK_restore_shipout_fntef:
1022 \xeCJK_cs_clear:N \__xeCJK_restore_shipout_CJKsymbol:
1023 }
1024 \cs_new_protected:Npn \__xeCJK_restore_shipout_fntef:
1025 {
1026 \tl_put_right:Nn \l__xeCJK_fntef_shipout_tl
1027 {
1028 \bool_set_false:N \l__xeCJK_fntef_bool
1029 \dim_zero:N \l__xeCJK_fntef_dim
1030 }
1031 \xeCJK_cs_clear:N \__xeCJK_restore_shipout_fntef:
1032 }
1033 \tl_new:N \l__xeCJK_fntef_shipout_tl
1034 \xeCJK_add_to_shipout:n { \l__xeCJK_fntef_shipout_tl }
1035 \cs_new_protected:Npn \__xeCJK_under_CJKsymbol:N
1036 {
1037 \box_use:N \l__xeCJK_under_symbol_box
1038 \xeCJK_no_break: \__xeCJK_under_CJKsymbol:N
1039 }
1040 \NewDocumentEnvironment { CJKfilltwosides } { O { c } m }
1041 {
1042 \use:e { \exp_not:N \minipage [#1] { \dim_eval:n {#2} } }
1043 \cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
1044 }
1045 {
1046 \endminipage
1047 \ignorespacesafterend
1048 }
1049 \NewDocumentEnvironment { CJKfilltwosides* } { O { c } m +b }
1050 {
1051 \mode_leave_vertical:
1052 \cs_set_eq:NN \CJKglue \xeCJK_fntef_hfilll:
1053 \tl_set:Nn \arraystretch { 1 }
1054 \cs_if_free:NF \extrarowheight
1055 { \cs_set_eq:NN \extrarowheight \c_zero_dim }
1056 \use:e { \__xeCJK_fill_two_sides:nnn {#1} { \dim_eval:n {#2} } } {#3}
1057 }
1058 { \ignorespacesafterend }
1059 \cs_new_protected:Npn \__xeCJK_fill_two_sides:nnn #1#2#3
1060 {
1061 \dim_compare:nNnTF {#2} > \c_zero_dim
1062 {
1063 \hbox_set:Nn \l__xeCJK_tmp_box
1064 { \tabular [#1] { @ { } c @ { } } #3 \endtabular }
1065 \dim_compare:nNnTF {#2} > { \box_wd:N \l__xeCJK_tmp_box }
1066 { \tabular [#1] { @ { } p {#2} @ { } } #3 \endtabular }
1067 { \box_use:N \l__xeCJK_tmp_box }
1068 }
1069 { \tabular [#1] { @ { } c @ { } } #3 \endtabular }
1070 }
1071 \cs_new_protected:Npn \xeCJK_fntef_hfilll:
1072 { \skip_horizontal:N \c__xeCJK_filll_skip }
1073 \skip_const:Nn \c__xeCJK_filll_skip { \c_zero_dim plus 1 filll }
1074 %%
1075 %% This package consists of the files xeCJK.dtx,
1076 %% full-stop.map,
1077 %% fullwidth-stop.map,
1078 %% han-simp.map,
1079 %% han-trad.map,
1080 %% and the derived files xeCJK.pdf,
1081 %% xeCJK.sty,
1082 %% xeCJK.cfg,
1083 %% xeCJK.ins,
1084 %% xeCJKfntef.sty,
1085 %% xeCJK-listings.sty,
1086 %% xunicode-addon.sty,
1087 %% xunicode-extra.def,
1088 %% xeCJK-example-autofake.tex,
1089 %% xeCJK-example-fallback.tex,
1090 %% xeCJK-example-subCJKblock.tex,
1091 %% xeCJK-example-CJKecglue.tex,
1092 %% xeCJK-example-checksingle.tex,
1093 %% xeCJK-example-CJKfntef.tex,
1094 %% xeCJK-example-punctstyle.tex,
1095 %% xeCJK-example-verbatim.tex,
1096 %% xeCJK-example-CM.tex,
1097 %% xeCJK-example-listings.tex,
1098 %% xeCJK-example-mathblock.tex,
1099 %% xunicode-symbols.tex,
1100 %% xunicode-commands.tex,
1101 %% xunicode-combine-marks.tex,
1102 %% xunicode-symbols.pdf,
1103 %% full-stop.tec,
1104 %% fullwidth-stop.tec,
1105 %% han-simp.tec,
1106 %% han-trad.tec, and
1107 %% README.md.
1108 %%
1109 %% End of file `xeCJKfntef.sty'.