diff options
author | Karl Berry <karl@freefriends.org> | 2011-05-15 22:19:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-05-15 22:19:28 +0000 |
commit | 953f11c8761fc6eee458f57c36974515bc365b3b (patch) | |
tree | 237e154241f213e44d2dc65d321ba1b85b520ced | |
parent | 84add25b1941f4a2447c8d13da3b056007dd98b4 (diff) |
xecjk 2.3.19 (14may11)
git-svn-id: svn://tug.org/texlive/trunk@22487 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/example-CJKfntef.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/example-addspaces.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex | 49 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKchecksingle.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/examples/example-CJKfntef.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/examples/example-addspaces.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex | 49 | ||||
-rw-r--r-- | Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf | bin | 272026 -> 286263 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx | 138 | ||||
-rw-r--r-- | Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 48 |
12 files changed, 270 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex b/Master/texmf-dist/doc/xelatex/xecjk/example-CJKchecksingle.tex index 19f23f818dc..407594d5d50 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 360fbc466aa..c337e344b61 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 045c5b01d08..c47d73ac3bf 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 new file mode 100644 index 00000000000..b9491022652 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xecjk/example-fallback.tex @@ -0,0 +1,49 @@ +%% +%% This is file `example-fallback.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xeCJK.dtx (with options: `example-fallback') +%% +%% Version 2.3.19 (01-May-2011) +%% +%% Copyright (C) Wenchang Sun <sunwch@hotmail.com> +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +\documentclass{article} +\usepackage[fallback]{xeCJK} +\usepackage{CJKfntef} +\setCJKmainfont{SimSun} +\setCJKfallbackfamilyfont{rm}{SimSun-ExtB} +\begin{document} + +漢字源𣴑考 + +\CJKunderwave{漢字源𣴑考} + +\begin{table}[ht] +\caption{生僻字测试} +\centering +\begin{tabular}{|cc|cc|cc|cc|} +𠀀 & 20000 & 𠀁 & 20001 & 𠀂 & 20002 & 𠀃 & 20003 \\ +𠀄 & 20004 & 𠀅 & 20005 & 𠀆 & 20006 & 𠀇 & 20007 \\ +𠀈 & 20008 & 𠀉 & 20009 & 𠀊 & 2000A & 𠀋 & 2000B \\ +𠀌 & 2000C & 𠀍 & 2000D & 𠀎 & 2000E & 𠀏 & 2000F \\ +𠀐 & 20010 & 𠀑 & 20011 & 𠀒 & 20012 & 𠀓 & 20013 \\ +𠀔 & 20014 & 𠀕 & 20015 & 𠀖 & 20016 & 𠀗 & 20017 \\ +𠀘 & 20018 & 𠀙 & 20019 & 𠀚 & 2001A & 𠀛 & 2001B \\ +𠀜 & 2001C & 𠀝 & 2001D & 𠀞 & 2001E & 𠀟 & 2001F \\ +\end{tabular} +\end{table} +\end{document} +\endinput +%% +%% End of file `example-fallback.tex'. 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 19f23f818dc..407594d5d50 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 360fbc466aa..c337e344b61 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 045c5b01d08..c47d73ac3bf 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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 new file mode 100644 index 00000000000..b9491022652 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/xecjk/examples/example-fallback.tex @@ -0,0 +1,49 @@ +%% +%% This is file `example-fallback.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xeCJK.dtx (with options: `example-fallback') +%% +%% Version 2.3.19 (01-May-2011) +%% +%% Copyright (C) Wenchang Sun <sunwch@hotmail.com> +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +\documentclass{article} +\usepackage[fallback]{xeCJK} +\usepackage{CJKfntef} +\setCJKmainfont{SimSun} +\setCJKfallbackfamilyfont{rm}{SimSun-ExtB} +\begin{document} + +漢字源𣴑考 + +\CJKunderwave{漢字源𣴑考} + +\begin{table}[ht] +\caption{生僻字测试} +\centering +\begin{tabular}{|cc|cc|cc|cc|} +𠀀 & 20000 & 𠀁 & 20001 & 𠀂 & 20002 & 𠀃 & 20003 \\ +𠀄 & 20004 & 𠀅 & 20005 & 𠀆 & 20006 & 𠀇 & 20007 \\ +𠀈 & 20008 & 𠀉 & 20009 & 𠀊 & 2000A & 𠀋 & 2000B \\ +𠀌 & 2000C & 𠀍 & 2000D & 𠀎 & 2000E & 𠀏 & 2000F \\ +𠀐 & 20010 & 𠀑 & 20011 & 𠀒 & 20012 & 𠀓 & 20013 \\ +𠀔 & 20014 & 𠀕 & 20015 & 𠀖 & 20016 & 𠀗 & 20017 \\ +𠀘 & 20018 & 𠀙 & 20019 & 𠀚 & 2001A & 𠀛 & 2001B \\ +𠀜 & 2001C & 𠀝 & 2001D & 𠀞 & 2001E & 𠀟 & 2001F \\ +\end{tabular} +\end{table} +\end{document} +\endinput +%% +%% End of file `example-fallback.tex'. diff --git a/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf b/Master/texmf-dist/doc/xelatex/xecjk/xeCJK.pdf Binary files differindex 91544248b7b..9c5d1b97441 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 9153b0038cc..9c5e8ab6efb 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.3.17 (20-Nov-2010) + Version 2.3.19 (01-May-2011) Copyright (C) Wenchang Sun <sunwch@hotmail.com> @@ -54,6 +54,7 @@ may observe \generate{\file{example-addspaces.tex}{\from{xeCJK.dtx}{example-addspaces}}} \generate{\file{example-CJKchecksingle.tex}{\from{xeCJK.dtx}{example-CJKchecksingle}}} \generate{\file{example-CJKfntef.tex}{\from{xeCJK.dtx}{example-CJKfntef}}} +\generate{\file{example-fallback.tex}{\from{xeCJK.dtx}{example-fallback}}} %</batchfile> %<batchfile>\endbatchfile %<*internal> @@ -139,8 +140,8 @@ may observe %</driver> % %<*xeCJK> -\def\fileversion{2.3.17} -\def\filedate{2010/11/20} +\def\fileversion{2.3.19} +\def\filedate{2011/05/01} \ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX] %</xeCJK> % @@ -213,9 +214,10 @@ may observe % \end{decl} % % \begin{tabular}{ll} -% Options & \\ +% 宏包选项 & \\ % BoldFont:& 启用CJK\textbf{粗体字}\\ % SlantFont:& 启用 \textsl{斜体字slshape}\\ +% fallback: & 启用备用字体功能 \\ % CJKnumber: & 调用CJKnumb宏包\\ % CJKchecksingle: &避免单个汉字单独占一行。 % \end{tabular} @@ -226,9 +228,12 @@ may observe % \defmacro{\setCJKsansfont} [\textcolor{optioncolor}{<font features>}]\arg{font name}\\ % \defmacro{\setCJKmonofont} [\textcolor{optioncolor}{<font features>}]\arg{font name}\\ % \defmacro{\setCJKfamilyfont} \arg{family name}[\textcolor{optioncolor} -% {<font features>}]\arg{font name} +% {<font features>}]\arg{font name}\\ +% \defmacro{\setCJKfallbackfamilyfont} \arg{family name} +% [\textcolor{optioncolor}{<font features>}]\arg{font name} % \end{decl} -% 分别设置缺省CJK字体, CJK sffamily, CJK ttfamily 和某个 CJKfamily 所对应中文字体, +% 分别设置缺省CJK字体, CJK sffamily, CJK ttfamily, 某个 CJKfamily 所对应中文字 +% 体,以及某个 CJKfamily 所对应的备用字体(通常用于生僻字)。 % 其中最后两个参数的意义请参考 \verb+\fontspec.+ % % 定义CJK字体时指定的\texttt{ItalicFont=\{...\}}比宏包的 @@ -351,7 +356,11 @@ may observe %\end{enumerate} % % -% +% \begin{decl} +% \defmacro{\xeCJKenablefallback}\\ +% \defmacro{\xeCJKdisablefallback} +% \end{decl} +% 打开或关闭备用字体功能。 % % % \begin{decl} @@ -468,20 +477,23 @@ may observe % \defmacro{\setCJKsansfont} [\textcolor{optioncolor}{<font features>}]\arg{font name}\\ % \defmacro{\setCJKmonofont} [\textcolor{optioncolor}{<font features>}]\arg{font name}\\ % \defmacro{\setCJKfamilyfont} \arg{family name}[\textcolor{optioncolor} -% {<font features>}]\arg{font name} +% {<font features>}]\arg{font name}\\ +% \defmacro{\setCJKfallbackfamilyfont} \arg{family name} +% [\textcolor{optioncolor}{<font features>}]\arg{font name} % \end{decl} % % The first three macros are analogs of -% +% \begin{quote} % \defmacro{\setmainfont}, \defmacro{\setsansfont}, and \defmacro{\setmonofont}, -% -% \noindent respectively. +% \end{quote} +% respectively. % The only difference is that they effect only CJK characters. % -% The last macro sets a font for a CJK family which will be called by -% +% The last two macros set the primary font and fallback font for a CJK family +% which will be called by +% \begin{quote} % \defmacro{\CJKfamily}\arg{family name}. -% +% \end{quote} % With these macros, one can set different default fonts for CJK and other characters, % respectively. % @@ -543,7 +555,11 @@ may observe % Note that both macros effect only CJK families defined after them. % % -% +% \begin{decl} +% \defmacro{\xeCJKenablefallback}\\ +% \defmacro{\xeCJKdisablefallback} +% \end{decl} +% Enable or disable fallback fonts for CJK families. % % % \section{Compatibility} @@ -576,6 +592,8 @@ may observe \newif\ifxeCJK@BoldFont@ +\newif\ifxeCJK@fallback@ + \newif\ifxeCJK@num \newif\ifxeCJK@checksingle @@ -587,6 +605,7 @@ may observe \DeclareOption{BoldFont}{\ExecuteOptions{boldfont}} \DeclareOption{slantfont}{\xeCJK@SlantFont@true} \DeclareOption{SlantFont}{\ExecuteOptions{slantfont}} +\DeclareOption{fallback}{\xeCJK@fallback@true} \DeclareOption{CJKnumber}{\xeCJK@numtrue} \DeclareOption{normalindentfirst}{\xeCJK@indentfirstfalse} \DeclareOption{CJKchecksingle}{\AtEndOfPackage{\let\xeCJK@i@i\xeCJK@checksingle}} @@ -691,6 +710,7 @@ may observe \xeCJK@postPunct{FF}{01,05,09,0C,0E,1A,1B,1F,3D,5D, 61,63,64,65,67,68,69,6A,6B,6C,6D,6E,6F,70,9E,9F} + \xeCJK@setPunct{1}{0}{B7} \xeCJK@setPunct{4}{0}{28,2D,5B,60,7B} \xeCJK@setPunct{5}{0}{21,22,25,27,29,2C,2E,3A,3B,3F,5D,7D}} @@ -811,6 +831,20 @@ may observe \normalspacedchars{/} % \end{macrocode} +% 处理宽度有分歧的两个标点:省略号和间隔号。保证其命令形式输出的是西文字体。 +% \begin{macrocode} +\AtBeginDocument{% + \let\xeCJK@save@textellipsis\textellipsis + \def\textellipsis{\begingroup\makexeCJKinactive + \xeCJK@save@textellipsis\endgroup} + \let\xeCJK@save@textperiodcentered\textperiodcentered + \def\textperiodcentered{\begingroup\makexeCJKinactive + \xeCJK@save@textperiodcentered\endgroup} + \let\xeCJK@save@textcentereddot\textcentereddot + \def\textcentereddot{\begingroup\makexeCJKinactive + \xeCJK@save@textcentereddot\endgroup} +} +% \end{macrocode} % % \section{字符输出规则} % \begin{macrocode} @@ -1441,6 +1475,37 @@ may observe \def\CJKsymbol#1{#1} \def\CJKpunctsymbol#1{#1} +% \end{macrocode} +% 设置备用字体,如果主字体没有相应的符号,将尝试使用备用字体显示。 +% \begin{macrocode} +\def\xeCJK@fallback@testsymbol#1{ + \iffontchar\font`#1 + #1 + \else + {\csname xeCJK@fallback@\xeCJK@family\endcsname #1} + \fi} +% \end{macrocode} +% |\xeCJKenablefallback| 命令打开备用字体功能,|\xeCJKdisablefallback| 命令关 +% 闭备用字体功能。此功能默认关闭。 +% \begin{macrocode} +\newcommand\xeCJKenablefallback{\let\xeCJK@fallback@CJKsymbol\CJKsymbol + \def\CJKsymbol##1{\xeCJK@fallback@CJKsymbol{\xeCJK@fallback@testsymbol{##1}}}} +\newcommand\xeCJKdisablefallback{\let\CJKsymbol\xeCJK@fallback@CJKsymbol} +\ifxeCJK@fallback@ + \xeCJKenablefallback +\fi +% \end{macrocode} +% |\setCJKfallbackfamilyfont| 为 CJK 字体族设置备用字体。 +% \begin{macrocode} +\newcommand\setCJKfallbackfamilyfont[1]{ + \@ifnextchar[ + {\xeCJK@setfallbackfamilyfont{#1}} + {\xeCJK@setfallbackfamilyfont{#1}[]}} +\def\xeCJK@setfallbackfamilyfont#1[#2]#3{ + \expandafter\newfontfamily\csname xeCJK@fallback@#1\endcsname[#2]{#3} +} + + \DeclareRobustCommand{\xeCJK@ULprepunctchar}[1]{ {\XeTeXinterchartokenstate=0 \CJKpunctsymbol{#1} @@ -1467,8 +1532,11 @@ may observe \AtBeginDocument{ \ifcsname UL@hook\endcsname \addto@hook\UL@hook{ - \def\CJKsymbol#1{{\xeCJK@setfont #1}\kern -1sp\kern 1sp\xeCJK@ignorespaces} - \def\CJKpunctsymbol#1{{\xeCJK@setfont #1}} + \let\xeCJK@UL@CJKsymbol\CJKsymbol + \let\xeCJK@UL@CJKpunctsymbol\CJKpunctsymbol + \def\CJKsymbol#1{{\xeCJK@setfont \xeCJK@UL@CJKsymbol{#1}} + \kern -1sp\kern 1sp\xeCJK@ignorespaces} + \def\CJKpunctsymbol#1{{\xeCJK@setfont \xeCJK@UL@CJKpunctsymbol{#1}}} \xeCJK@ULroutines} \fi \ifcsname ver@CJKfntef.sty\endcsname @@ -1822,8 +1890,42 @@ xeCJK 改进了中英文间距的处理, 并且还可以避免单个汉字独 % \end{macrocode} % \iffalse %</example-CJKfntef> +%<*example-fallback> +% \fi +% \part{example-fallback.tex} +% \setCJKfallbackfamilyfont{rm}{SimSun-ExtB} +% \xeCJKenablefallback +% \begin{macrocode} +\documentclass{article} +\usepackage[fallback]{xeCJK} +\usepackage{CJKfntef} +\setCJKmainfont{SimSun} +\setCJKfallbackfamilyfont{rm}{SimSun-ExtB} +\begin{document} + +漢字源𣴑考 + +\CJKunderwave{漢字源𣴑考} + +\begin{table}[ht] +\caption{生僻字测试} +\centering +\begin{tabular}{|cc|cc|cc|cc|} +𠀀 & 20000 & 𠀁 & 20001 & 𠀂 & 20002 & 𠀃 & 20003 \\ +𠀄 & 20004 & 𠀅 & 20005 & 𠀆 & 20006 & 𠀇 & 20007 \\ +𠀈 & 20008 & 𠀉 & 20009 & 𠀊 & 2000A & 𠀋 & 2000B \\ +𠀌 & 2000C & 𠀍 & 2000D & 𠀎 & 2000E & 𠀏 & 2000F \\ +𠀐 & 20010 & 𠀑 & 20011 & 𠀒 & 20012 & 𠀓 & 20013 \\ +𠀔 & 20014 & 𠀕 & 20015 & 𠀖 & 20016 & 𠀗 & 20017 \\ +𠀘 & 20018 & 𠀙 & 20019 & 𠀚 & 2001A & 𠀛 & 2001B \\ +𠀜 & 2001C & 𠀝 & 2001D & 𠀞 & 2001E & 𠀟 & 2001F \\ +\end{tabular} +\end{table} +\end{document} +% \end{macrocode} +% \iffalse +%</example-fallback> % \fi -% % \Finale % % \typeout{*************************************************************} diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.ins index b3876a76468..610a376bf1e 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% @@ -22,7 +22,7 @@ \keepsilent \preamble - Version 2.3.17 (20-Nov-2010) + Version 2.3.19 (01-May-2011) Copyright (C) Wenchang Sun <sunwch@hotmail.com> @@ -40,6 +40,7 @@ \generate{\file{example-addspaces.tex}{\from{xeCJK.dtx}{example-addspaces}}} \generate{\file{example-CJKchecksingle.tex}{\from{xeCJK.dtx}{example-CJKchecksingle}}} \generate{\file{example-CJKfntef.tex}{\from{xeCJK.dtx}{example-CJKfntef}}} +\generate{\file{example-fallback.tex}{\from{xeCJK.dtx}{example-fallback}}} \endbatchfile \endinput %% diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 8113393abe5..e97b05950d6 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.3.17 (20-Nov-2010) +%% Version 2.3.19 (01-May-2011) %% %% 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.3.17} -\def\filedate{2010/11/20} +\def\fileversion{2.3.19} +\def\filedate{2011/05/01} \ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX] \RequirePackage{ifxetex} \RequireXeTeX @@ -29,6 +29,8 @@ \newif\ifxeCJK@BoldFont@ +\newif\ifxeCJK@fallback@ + \newif\ifxeCJK@num \newif\ifxeCJK@checksingle @@ -40,6 +42,7 @@ \DeclareOption{BoldFont}{\ExecuteOptions{boldfont}} \DeclareOption{slantfont}{\xeCJK@SlantFont@true} \DeclareOption{SlantFont}{\ExecuteOptions{slantfont}} +\DeclareOption{fallback}{\xeCJK@fallback@true} \DeclareOption{CJKnumber}{\xeCJK@numtrue} \DeclareOption{normalindentfirst}{\xeCJK@indentfirstfalse} \DeclareOption{CJKchecksingle}{\AtEndOfPackage{\let\xeCJK@i@i\xeCJK@checksingle}} @@ -117,6 +120,7 @@ \xeCJK@postPunct{FF}{01,05,09,0C,0E,1A,1B,1F,3D,5D, 61,63,64,65,67,68,69,6A,6B,6C,6D,6E,6F,70,9E,9F} + \xeCJK@setPunct{1}{0}{B7} \xeCJK@setPunct{4}{0}{28,2D,5B,60,7B} \xeCJK@setPunct{5}{0}{21,22,25,27,29,2C,2E,3A,3B,3F,5D,7D}} @@ -158,6 +162,17 @@ \normalspacedchars{/} +\AtBeginDocument{% + \let\xeCJK@save@textellipsis\textellipsis + \def\textellipsis{\begingroup\makexeCJKinactive + \xeCJK@save@textellipsis\endgroup} + \let\xeCJK@save@textperiodcentered\textperiodcentered + \def\textperiodcentered{\begingroup\makexeCJKinactive + \xeCJK@save@textperiodcentered\endgroup} + \let\xeCJK@save@textcentereddot\textcentereddot + \def\textcentereddot{\begingroup\makexeCJKinactive + \xeCJK@save@textcentereddot\endgroup} +} \XeTeXinterchartoks 1 0{\egroup\CJKecglue} \XeTeXinterchartoks 1 1{\xeCJK@i@i} \XeTeXinterchartoks 1 2{\xeCJK@i@ii} @@ -753,6 +768,26 @@ \def\CJKsymbol#1{#1} \def\CJKpunctsymbol#1{#1} +\def\xeCJK@fallback@testsymbol#1{ + \iffontchar\font`#1 + #1 + \else + {\csname xeCJK@fallback@\xeCJK@family\endcsname #1} + \fi} +\newcommand\xeCJKenablefallback{\let\xeCJK@fallback@CJKsymbol\CJKsymbol + \def\CJKsymbol##1{\xeCJK@fallback@CJKsymbol{\xeCJK@fallback@testsymbol{##1}}}} +\newcommand\xeCJKdisablefallback{\let\CJKsymbol\xeCJK@fallback@CJKsymbol} +\ifxeCJK@fallback@ + \xeCJKenablefallback +\fi +\newcommand\setCJKfallbackfamilyfont[1]{ + \@ifnextchar[ + {\xeCJK@setfallbackfamilyfont{#1}} + {\xeCJK@setfallbackfamilyfont{#1}[]}} +\def\xeCJK@setfallbackfamilyfont#1[#2]#3{ + \expandafter\newfontfamily\csname xeCJK@fallback@#1\endcsname[#2]{#3} +} + \DeclareRobustCommand{\xeCJK@ULprepunctchar}[1]{ {\XeTeXinterchartokenstate=0 \CJKpunctsymbol{#1} @@ -779,8 +814,11 @@ \AtBeginDocument{ \ifcsname UL@hook\endcsname \addto@hook\UL@hook{ - \def\CJKsymbol#1{{\xeCJK@setfont #1}\kern -1sp\kern 1sp\xeCJK@ignorespaces} - \def\CJKpunctsymbol#1{{\xeCJK@setfont #1}} + \let\xeCJK@UL@CJKsymbol\CJKsymbol + \let\xeCJK@UL@CJKpunctsymbol\CJKpunctsymbol + \def\CJKsymbol#1{{\xeCJK@setfont \xeCJK@UL@CJKsymbol{#1}} + \kern -1sp\kern 1sp\xeCJK@ignorespaces} + \def\CJKpunctsymbol#1{{\xeCJK@setfont \xeCJK@UL@CJKpunctsymbol{#1}}} \xeCJK@ULroutines} \fi \ifcsname ver@CJKfntef.sty\endcsname |