summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty54
1 files changed, 29 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index c376cac7fd6..7324b45ed38 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 06a6ce4 2020-02-10 22:37:50 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 2628481 2020-02-14 20:30:07 +0800 Qing Lee <sobenlee@gmail.com> $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{3.8.0}{\ExplFileDescription}
+ {\ExplFileDate}{3.8.1}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -3299,15 +3299,19 @@
}
\cs_new_protected_nopar:Npn \__xeCJK_select_font:Nn #1#2
{
- \cs_if_exist_use:NF #1
- {
- \__xeCJK_family_use:n {#2}
- \xeCJK_font_gset_to_current:N #1
- }
+ \cs_if_exist:NF #1 { \__xeCJK_font_initial:Nn #1 {#2} }
+ #1
}
\cs_generate_variant:Nn \__xeCJK_select_font:Nn { c }
\tl_new:N \l__xeCJK_current_coor_tl
\cs_new_eq:NN \xeCJK@setfont \xeCJK_select_font:
+\cs_new_protected_nopar:Npn \__xeCJK_font_initial:Nn #1#2
+ {
+ \group_begin:
+ \__xeCJK_family_use:n {#2}
+ \xeCJK_font_gset_to_current:N #1
+ \group_end:
+ }
\cs_new_eq:NN \xeCJK_select_punct_font: \xeCJK_select_font:
\cs_new_protected_nopar:Npn \__xeCJK_select_punct_font_aux:
{
@@ -3345,8 +3349,7 @@
\cs_if_exist_use:NF #1
{
\xeCJK_block_family:nn {#2} {#3}
- \__xeCJK_family_use:n { #2/#3 }
- \xeCJK_font_gset_to_current:N #1
+ \__xeCJK_font_initial:Nn #1 { #2/#3 }
}
}
\cs_generate_variant:Nn \__xeCJK_select_font:Nnn { c }
@@ -3366,24 +3369,21 @@
{ xeCJK/family/#1 }
\cs_new_nopar:Npn \__xeCJK_family_nfss_csname:n #1
{ xeCJK/family/nfss/#1 }
-\cs_new_nopar:Npn \__xeCJK_family_use:n #1
+\cs_new_protected_nopar:Npn \__xeCJK_family_use:n #1
{ \use:c { \__xeCJK_family_nfss_csname:n {#1} } }
\cs_new_protected_nopar:Npn \__xeCJK_gset_family_nfss_cs:nn #1#2
{
\prop_gput:Nnn \g__xeCJK_family_name_prop {#1} {#2}
\cs_gset_protected_nopar:cpx
{ \__xeCJK_family_nfss_csname:n {#1} }
- {
- \exp_not:N \fontencoding { \c__xeCJK_encoding_tl }
- \__xeCJK_nfss_family:n {#2}
- \exp_not:N \selectfont
- }
+ { \__xeCJK_nfss_family:nn { \c__xeCJK_encoding_tl } {#2} }
}
\cs_generate_variant:Nn \__xeCJK_gset_family_nfss_cs:nn { xx }
\cs_if_exist:NTF \fontseriesforce
{
- \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:n #1
+ \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:nn #1#2
{
+ \fontencoding {#1}
\str_if_eq:eeF { \f@series } { \bfdefault }
{
\str_case_e:nn { \f@family }
@@ -3393,7 +3393,8 @@
{ \ttdefault } { \__xeCJK_nfss_series:n { tt } }
}
}
- \fontfamily {#1}
+ \fontfamily {#2}
+ \selectfont
}
\cs_new_protected_nopar:Npn \__xeCJK_nfss_series:n #1
{
@@ -3402,8 +3403,12 @@
}
}
{
- \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:n #1
- { \tl_set:Nn \f@family {#1} }
+ \cs_new_protected_nopar:Npn \__xeCJK_nfss_family:nn #1#2
+ {
+ \fontencoding {#1}
+ \tl_set:Nn \f@family {#2}
+ \selectfont
+ }
}
\prg_new_protected_conditional:Npnn \xeCJK_family_if_exist:n #1 { T , F , TF }
{
@@ -3866,12 +3871,12 @@
\cs_new_protected_nopar:Npn \xeCJK_declare_mathfont:nn #1#2
{
\xeCJK_declare_symbol_font:nnnnn {#1} { \c__xeCJK_encoding_tl }
- {#2} { \mddefault } { \updefault }
+ {#2} { \mddefault } { \shapedefault }
\cs_if_free:cF
- { \c__xeCJK_encoding_tl/#2/\bfdefault/\updefault }
+ { \c__xeCJK_encoding_tl/#2/\bfdefault/\shapedefault }
{
\SetSymbolFont {#1} { bold } { \c__xeCJK_encoding_tl }
- {#2} { \bfdefault } { \updefault }
+ {#2} { \bfdefault } { \shapedefault }
}
\prop_gput:Nnx \g__xeCJK_fam_prop {#2} { \exp_not:c { sym #1 } }
}
@@ -4495,11 +4500,10 @@
\g@addto@macro \@rmfamilyhook { \xeCJK@family { \CJKrmdefault } }
\g@addto@macro \@sffamilyhook { \xeCJK@family { \CJKsfdefault } }
\g@addto@macro \@ttfamilyhook { \xeCJK@family { \CJKttdefault } }
- \exp_args:Nx \g@addto@macro
+ \exp_args:Nc \g@addto@macro
{
\cs_if_exist:NTF \@defaultfamilyhook
- { \exp_not:N \@defaultfamilyhook }
- { \exp_not:c { normalfont ~ } }
+ { @defaultfamilyhook } { normalfont ~ }
}
{ \xeCJK@family { \CJKfamilydefault } }
}