diff options
author | Karl Berry <karl@freefriends.org> | 2012-02-04 00:54:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-02-04 00:54:02 +0000 |
commit | e5ef52124ad078285133094925a787ff19172c5e (patch) | |
tree | 0f9afa05bdc66dd39aa1c8d998eafa920932e931 /Master | |
parent | 6520e34c1a3077670ffdee218186448cfa45a839 (diff) |
xecjk (1feb12)
git-svn-id: svn://tug.org/texlive/trunk@25283 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
12 files changed, 122 insertions, 44 deletions
diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex b/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex index 360fc87dd82..b58fc7fdc3f 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-CJKchecksingle') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example-CJKfntef.tex b/Master/texmf-dist/doc/xelatex/xecjk/example-CJKfntef.tex index a7987f7b6d7..0fa0c13eeee 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/example-CJKfntef.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/example-CJKfntef.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-CJKfntef') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example-addspaces.tex b/Master/texmf-dist/doc/xelatex/xecjk/example-addspaces.tex index 1df3bffd6d9..efe6b88277f 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/example-addspaces.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/example-addspaces.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-addspaces') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex b/Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex index 243bac236c8..cb55fc010ce 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-fallback') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKchecksingle.tex b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKchecksingle.tex index 360fc87dd82..b58fc7fdc3f 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKchecksingle.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKchecksingle.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-CJKchecksingle') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKfntef.tex b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKfntef.tex index a7987f7b6d7..0fa0c13eeee 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKfntef.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKfntef.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-CJKfntef') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex index 1df3bffd6d9..efe6b88277f 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-addspaces') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex index 243bac236c8..cb55fc010ce 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex +++ b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `example-fallback') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% diff --git a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf Binary files differindex f821e47025e..00525cb0522 100644 --- a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf +++ b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx index 0678e72f489..13c8f2a3f8e 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx @@ -36,7 +36,7 @@ may observe \keepsilent \preamble - Version 2.4.4 (17-Sep-2011) + Version 2.4.5 (31-Jan-2012) Copyright (C) Wenchang Sun <sunwch@hotmail.com> @@ -140,8 +140,8 @@ may observe %</driver> % %<*xeCJK> -\def\fileversion{2.4.4} -\def\filedate{2011/09/17} +\def\fileversion{2.4.5} +\def\filedate{2012/01/31} \ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX] %</xeCJK> % @@ -258,6 +258,10 @@ may observe % 放缩的方式或改变间距的方式,让 CJK 字符的宽度等于西文字体中两个空格的宽度。 % 这有利于等宽字体的代码对齐等情形。 % +% \defmacro{\CJKfixedspacing} 命令设置固定字距和不压缩标点格式,符合上面加 |+| +% 命令的意义。\defmacro{\CJKflexiblespacing} 命令恢复可伸缩的字距和标点压缩。 +% 抄录(|verbatim|)环境将自动使用 |\CJKfixedspacing| 的效果。 +% % \defmacro{\setCJKmonoscale} 和 \defmacro{\setCJKmonoexspace} 命令分别计算并设置 % 当前字号下西文等宽字体与 CJK 字体的放缩比例和字距,以符合上面加 |*| 与加 |+| 号 % 命令的意义。在字号改变时,应该使用两个命令之一;但注意两个命令不能同时使用。 @@ -544,6 +548,11 @@ may observe % that the width of a CJK glyph equals to 2 space for monospace fonts, by scaling and % spacing, respectively. % +% \defmacro{\CJKfixedspacing} sets fixed CJK character spacing and |plain| +% punctuation style. \defmacro{\CJKflexiblespacing} restores flexible CJK +% character spacing and old punctuation style. |verbatim| environemnts sets +% |\CJKfixedspacing| automatically. +% % \defmacro{\setCJKmonoscale} and \defmacro{\setCJKmonoexspace} reset the scale and extra % space introduced by |\setCJKmainfont*| and |\setCJKmonofont+|, respectively. They are % useful when changing the font size. @@ -910,13 +919,18 @@ may observe % \end{macrocode} % -% 单独处理宽度有分歧的两个标点:省略号和间隔号。保证其命令形式输出的是西文字体。 -% 并对间隔号(U+00B7)为一些编码的符号宏包做特殊处理: +% 单独处理宽度有分歧的几个标点:包括省略号、破折号、间隔号、引号等中西文混用的 +% 符号,保证其命令形式输出的是西文字体。并对一些编码的符号宏包做特殊处理: % \begin{macrocode} \AtBeginDocument{% \xeCJK@patch\textellipsis {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textemdash {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\textperiodcentered {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\textcentereddot {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquoteleft {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquoteright {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquotedblleft {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquotedblright {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\tipaencoding {\makexeCJKinactive}{} % tipa package in T3 encoding \let\xeCJK@save@r\r \def\r#1{{\makexeCJKinactive\xeCJK@save@r{#1}}} % \r{u} in T1 encoding @@ -1695,8 +1709,8 @@ may observe \def\setCJKfamilyfont#1{ \xeCJK@newfontfamily{#1}} % \end{macrocode} -% 重定义 |\normalfont|, |\rmfamily|, |\sffamily|,添加 CJK 字体族的设置。 -% |\ttfamily| 可能需要单独调整宽度,将在后面定义。 +% 重定义 |\normalfont|, |\rmfamily|, |\sffamily|, |\ttfamily|,添加 CJK 字体族 +% 的设置。 % \begin{macrocode} \def\CJKfamilydefault{\CJKrmdefault} \DeclareRobustCommand\normalfont @@ -1716,6 +1730,10 @@ may observe {\not@math@alphabet\sffamily\mathsf \fontfamily\sfdefault\CJKfamily{\CJKsfdefault}\selectfont} +\DeclareRobustCommand\ttfamily + {\not@math@alphabet\ttfamily\mathtt + \fontfamily\ttdefault\CJKfamily{\CJKttdefault}\selectfont} + % \end{macrocode} % \string\xeCJK@newfontfamily is similar to \string\newfontfamily % but introduce fake slant/bold fonts for CJK characters. @@ -1878,13 +1896,45 @@ may observe \newcommand*\setCJKmonoexspace{ \xecjk_set_monoexspace: - \CJKsetecglue{\skip_horizontal:N .5\g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim} } +\cs_new:Nn \xecjk_fixed_ecglue: +{ + \skip_horizontal:N .5\g_xecjk_exspace_dim +} + +\cs_new:Nn \xecjk_fixed_cjkglue: +{ + \skip_horizontal:N \g_xecjk_exspace_dim +} + +\tl_set_eq:NN \l_xecjk_flexible_punctstyle_tl \xeCJK@punctstyle +\cs_set_eq:NN \xecjk_flexible_ecglue: \CJKecglue +\cs_set_eq:NN \xecjk_flexible_cjkglue: \CJKglue + +\newcommand*\CJKfixedspacing{ + \unless\ifnum \xeCJK@punctstyle = \xeCJK@ps@plain + \tl_set_eq:NN \l_xecjk_flexible_punctstyle_tl \xeCJK@punctstyle + \punctstyle{plain} + \fi + \unless\ifx \CJKecglue \xecjk_fixed_ecglue: + \cs_set_eq:NN \xecjk_flexible_ecglue: \CJKecglue + \let \CJKecglue \xecjk_fixed_ecglue: + \fi + \unless\ifx \CJKglue \xecjk_fixed_cjkglue: + \cs_set_eq:NN \xecjk_flexible_cjkglue: \CJKglue + \let \CJKglue \xecjk_fixed_cjkglue: + \fi +} + +\newcommand*\CJKflexiblespacing{ + \let \xeCJK@punctstyle \l_xecjk_flexible_punctstyle_tl + \let \CJKecglue \xecjk_flexible_ecglue: + \let \cjkglue \xecjk_flexible_cjkglue: +} \DeclareRobustCommand\setCJKmonoexspacefont[2][]{ - \setCJKmonoexspace + \xecjk_set_monoexspace: \xeCJK@newfontfamily{\CJKttdefault}[#1]{#2}} \def\xeCJK@ifplus#1{\@ifnextchar +{\@firstoftwo{#1}}} @@ -1895,20 +1945,13 @@ may observe {\setCJKmonoexspacefont} {\xeCJK@newfontfamily{\CJKttdefault}}}} -\DeclareRobustCommand\ttfamily - {\not@math@alphabet\ttfamily\mathtt - \fontfamily\ttdefault\CJKfamily{\CJKttdefault}\selectfont - \CJKsetecglue{\skip_horizontal:N .5\g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim}} - % \end{macrocode} % 修补 \verbatim@font % \begin{macrocode} \AtBeginDocument{ \tl_put_right:Nn \verbatim@font { - \punctstyle{plain} - \CJKsetecglue{\skip_horizontal:N \g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim}} + \CJKfixedspacing + } } \ExplSyntaxOff diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins index 6fda2caa5e9..0c822f6c7ad 100644 --- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins +++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins @@ -6,7 +6,7 @@ %% %% xeCJK.dtx (with options: `batchfile') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% @@ -22,7 +22,7 @@ \keepsilent \preamble - Version 2.4.4 (17-Sep-2011) + Version 2.4.5 (31-Jan-2012) Copyright (C) Wenchang Sun <sunwch@hotmail.com> diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 441dc0605fe..eeed2ec6cf4 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: `xeCJK') %% -%% Version 2.4.4 (17-Sep-2011) +%% Version 2.4.5 (31-Jan-2012) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% @@ -18,8 +18,8 @@ %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% -\def\fileversion{2.4.4} -\def\filedate{2011/09/17} +\def\fileversion{2.4.5} +\def\filedate{2012/01/31} \ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX] \RequirePackage{ifxetex} \RequireXeTeX @@ -178,8 +178,13 @@ \AtBeginDocument{% \xeCJK@patch\textellipsis {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textemdash {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\textperiodcentered {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\textcentereddot {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquoteleft {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquoteright {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquotedblleft {\begingroup\makexeCJKinactive}{\endgroup} + \xeCJK@patch\textquotedblright {\begingroup\makexeCJKinactive}{\endgroup} \xeCJK@patch\tipaencoding {\makexeCJKinactive}{} % tipa package in T3 encoding \let\xeCJK@save@r\r \def\r#1{{\makexeCJKinactive\xeCJK@save@r{#1}}} % \r{u} in T1 encoding @@ -895,6 +900,10 @@ {\not@math@alphabet\sffamily\mathsf \fontfamily\sfdefault\CJKfamily{\CJKsfdefault}\selectfont} +\DeclareRobustCommand\ttfamily + {\not@math@alphabet\ttfamily\mathtt + \fontfamily\ttdefault\CJKfamily{\CJKttdefault}\selectfont} + \newcommand*\xeCJK@newfontfamily[1]{ \@ifnextchar[ {\xeCJK@newfontfamily@{#1}} @@ -1046,12 +1055,45 @@ \newcommand*\setCJKmonoexspace{ \xecjk_set_monoexspace: - \CJKsetecglue{\skip_horizontal:N .5\g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim} +} + +\cs_new:Nn \xecjk_fixed_ecglue: +{ + \skip_horizontal:N .5\g_xecjk_exspace_dim +} + +\cs_new:Nn \xecjk_fixed_cjkglue: +{ + \skip_horizontal:N \g_xecjk_exspace_dim +} + +\tl_set_eq:NN \l_xecjk_flexible_punctstyle_tl \xeCJK@punctstyle +\cs_set_eq:NN \xecjk_flexible_ecglue: \CJKecglue +\cs_set_eq:NN \xecjk_flexible_cjkglue: \CJKglue + +\newcommand*\CJKfixedspacing{ + \unless\ifnum \xeCJK@punctstyle = \xeCJK@ps@plain + \tl_set_eq:NN \l_xecjk_flexible_punctstyle_tl \xeCJK@punctstyle +\punctstyle{plain} + \fi + \unless\ifx \CJKecglue \xecjk_fixed_ecglue: + \cs_set_eq:NN \xecjk_flexible_ecglue: \CJKecglue + \let \CJKecglue \xecjk_fixed_ecglue: + \fi + \unless\ifx \CJKglue \xecjk_fixed_cjkglue: + \cs_set_eq:NN \xecjk_flexible_cjkglue: \CJKglue + \let \CJKglue \xecjk_fixed_cjkglue: + \fi +} + +\newcommand*\CJKflexiblespacing{ + \let \xeCJK@punctstyle \l_xecjk_flexible_punctstyle_tl + \let \CJKecglue \xecjk_flexible_ecglue: + \let \cjkglue \xecjk_flexible_cjkglue: } \DeclareRobustCommand\setCJKmonoexspacefont[2][]{ - \setCJKmonoexspace + \xecjk_set_monoexspace: \xeCJK@newfontfamily{\CJKttdefault}[#1]{#2}} \def\xeCJK@ifplus#1{\@ifnextchar +{\@firstoftwo{#1}}} @@ -1062,17 +1104,10 @@ {\setCJKmonoexspacefont} {\xeCJK@newfontfamily{\CJKttdefault}}}} -\DeclareRobustCommand\ttfamily - {\not@math@alphabet\ttfamily\mathtt - \fontfamily\ttdefault\CJKfamily{\CJKttdefault}\selectfont - \CJKsetecglue{\skip_horizontal:N .5\g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim}} - \AtBeginDocument{ \tl_put_right:Nn \verbatim@font { - \punctstyle{plain} - \CJKsetecglue{\skip_horizontal:N \g_xecjk_exspace_dim} - \def\CJKglue{\skip_horizontal:N \g_xecjk_exspace_dim}} + \CJKfixedspacing + } } \ExplSyntaxOff |