diff options
author | Karl Berry <karl@freefriends.org> | 2010-06-09 22:19:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-06-09 22:19:47 +0000 |
commit | c02aeef45b983ed627811c3fb323ce89b4c778d5 (patch) | |
tree | 8b791563cde13ba00dcdef2733939580c247e9de /Master/texmf-dist/tex/xelatex/xecjk | |
parent | cbff04af8ef44a84b301ef7e606946111c6b2676 (diff) |
xecjk update (9jun10)
git-svn-id: svn://tug.org/texlive/trunk@18848 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 215 |
1 files changed, 60 insertions, 155 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index ce72b7ce0ac..53e47711b36 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.10 (30-Sept-2009) +%% Version 2.3.15 (31-May-2010) %% %% Copyright (C) Wenchang Sun <sunwch@hotmail.com> %% @@ -18,9 +18,9 @@ %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% -\def\fileversion{2.3.10} -\def\filedate{2009/09/30} -\ProvidesPackage{xeCJK}[\filedate\space\fileversion] +\def\fileversion{2.3.15} +\def\filedate{2010/05/31} +\ProvidesPackage{xeCJK}[\filedate\space\fileversion\space package for typesetting CJK scripts with XeLaTeX] \RequirePackage{ifxetex} \RequireXeTeX \expandafter\def\csname ver@CJK.sty\endcsname{2020/01/01} @@ -37,11 +37,15 @@ \newif\ifxeCJK@checksingle \xeCJK@checksinglefalse +\newif\ifxeCJK@indentfirst +\xeCJK@indentfirsttrue + \DeclareOption{boldfont}{\xeCJK@BoldFont@true} \DeclareOption{BoldFont}{\ExecuteOptions{boldfont}} \DeclareOption{slantfont}{\xeCJK@SlantFont@true} \DeclareOption{SlantFont}{\ExecuteOptions{slantfont}} \DeclareOption{CJKnumber}{\xeCJK@numtrue} +\DeclareOption{normalindentfirst}{\xeCJK@indentfirstfalse} \DeclareOption{CJKnormalspaces}{} \DeclareOption{CJKaddspaces}{} \DeclareOption{CJKtextspaces}{} @@ -54,6 +58,10 @@ \RequirePackage{fontspec} \relax + +\ifxeCJK@indentfirst + \let\@afterindentfalse\relax +\fi \endlinechar \m@ne \def\makexeCJKactive{ \XeTeXinterchartokenstate=1\relax} @@ -463,6 +471,8 @@ \def\xeCJK@@@checksingle#1{ \def\xeCJK@setcurrentchar@ii{ \xeCJK@setcurrentchar@i #1} + \def\xeCJK@setcurrentchar@ii@s{ + \xeCJK@setcurrentchar@i #1 } \def\xeCJK@setcurrentnobreakchar@ii{ \xeCJK@setcurrentnobreakchar@i #1} \futurelet\@let@token\xeCJK@@@@checksingle} @@ -476,7 +486,7 @@ \let\xeCJK@par\par \def\xeCJK@checkpar{ - \@ifnextchar\xeCJK@par{\xeCJK@setcurrentnobreakchar@ii}{\xeCJK@setcurrentchar@ii}} + \@ifnextchar\xeCJK@par{\xeCJK@setcurrentnobreakchar@ii}{\xeCJK@setcurrentchar@ii@s}} \def\xeCJKsetecglue#1{ \def\CJK@ecglue{#1} @@ -492,6 +502,15 @@ \let\xeCJKpunctnobreak\nobreak} \xeCJKnobreakbetweenpuncts +\let\xeCJK@itcorr\/ +\def\/{% + \relax + \ifnum\lastkern=4 % + \unkern\unkern + \fi + \xeCJK@itcorr} +\let\@@italiccorr=\/ + \newcount\xeCJK@cnta \newcount\xeCJK@cntb \newcount\xeCJK@cntc @@ -636,8 +655,6 @@ \def\xeCJK@ps@plain{5} \punctstyle{quanjiao} -\let\@afterindentfalse\relax - \def\xeCJKplainchr{\punctstyle{plain}} \def\xeCJK@sidespace{10} @@ -759,6 +776,15 @@ \def\setCJKfamilyfont#1{ \xeCJK@newfontfamily{#1}} +\DeclareRobustCommand\normalfont + {\CJKfamily{rm}% + \usefont\encodingdefault + \familydefault + \seriesdefault + \shapedefault + \relax} +\let\reset@font\normalfont + \DeclareRobustCommand\rmfamily {\not@math@alphabet\rmfamily\mathrm \fontfamily\rmdefault\CJKfamily{rm}\selectfont} @@ -775,17 +801,24 @@ {\xeCJK@newfontfamily@{#1}} {\xeCJK@newfontfamily@{#1}[]}} +\def\xeCJK@setmacro@define@key#1{ + \define@key[xeCJK]{preparse}{#1}{ + \expandafter\xdef\csname xeCJK@#1\endcsname{##1}}} + +\xeCJK@setmacro@define@key{ItalicFont} +\xeCJK@setmacro@define@key{BoldFont} +\xeCJK@setmacro@define@key{BoldItalicFont} + \def\xeCJK@newfontfamily@#1[#2]#3{ % % Get user defined options - \def\xeCJK@temp{#2,} - \expandafter - \xeCJK@getBoldFont\xeCJK@temp BoldFont={},{}\relax - \expandafter - \xeCJK@getBoldItalicFont\xeCJK@temp BoldItalicFont={},{}\relax - \expandafter - \xeCJK@getItalicFont\xeCJK@temp ItalicFont={},{}\relax + \let\xeCJK@BoldFont\@empty + \let\xeCJK@ItalicFont\@empty + \let\xeCJK@BoldItalicFont\@empty + \bgroup + \setkeys*[xeCJK]{preparse}{#2} + \egroup \edef\xeCJK@Features{} \ifxeCJK@BoldFont@ @@ -827,139 +860,11 @@ \fi \fi - \edef\@tempa{\noexpand\zf@fontspec{\xeCJK@Features}{#3}} - \@tempa - \edef\@tempa{ - \noexpand\DeclareRobustCommand\expandafter\noexpand\csname xeCJK@font@#1\endcsname - {\noexpand\fontfamily{\zf@family}\noexpand\selectfont}} - \@tempa - \expandafter\edef\csname xeCJK@nsff#1\endcsname{\zf@family}} - -\def\xeCJK@setmacro@getkey#1{ - \expandafter\def\csname xeCJK@get#1\endcsname ##1#1=##2,##3\relax{ - \expandafter\edef\csname xeCJK@#1\endcsname{##2} - \edef\xeCJK@temp{##1##3}}} - -\xeCJK@setmacro@getkey{BoldFont} -\xeCJK@setmacro@getkey{ItalicFont} -\xeCJK@setmacro@getkey{BoldItalicFont} - -\define@key[zf]{preparse}{ItalicFeatures}{ - \edef\zf@it@feat{,#1} - \edef\zf@family@long{\zf@family@long itfeat:#1}} - -\renewcommand*\zf@fontspec[2]{% - \begingroup - \zf@init - \edef\zf@fontname{#2}% - \let\zf@family@long\zf@fontname - \setkeys*[zf]{prepreparse}{#1}% - \let\zf@up\zf@fontname - \edef\@tempa{\noexpand\setkeys*[zf]{preparse}{\XKV@rm}}\@tempa - \let\zf@fontname\zf@up - \let\zf@font@feat\XKV@rm - \font\zf@basefont="\zf@font@wrap\zf@fontname\zf@suffix" at \f@size pt - \unless\ifzf@icu - \zf@set@font@type - \fi - \ifx\zf@suffix\@empty - \ifzf@atsui - \def\zf@suffix{/AAT}% - \else - \ifzf@icu - \def\zf@suffix{/ICU}% - \fi - \fi - \font\zf@basefont="\zf@font@wrap\zf@fontname\zf@suffix" at \f@size pt - \fi - \zf@firsttimetrue - \zf@get@feature@requests{\zf@font@feat}% - \zf@firsttimefalse - \unless\ifcsname zf@UID@\zf@family@long\endcsname - \edef\@tempa{#2}% - \ifcsname c@zf@famc@\@tempa\endcsname - \expandafter\stepcounter\else - \expandafter\newcounter\fi - {zf@famc@\@tempa}% - \gdef@cx{zf@UID@\zf@family@long}{% - \expandafter\expandafter\expandafter - \zap@space\expandafter\@tempa\space\@empty - (\expandafter\the\csname c@zf@famc@\@tempa\endcsname)}% - \fi - \xdef\zf@family{\@nameuse{zf@UID@\zf@family@long}}% - \unless\ifcsname zf@family@fontname\zf@family\endcsname - \zf@PackageInfo{Defining font family for '#2' - with options [\zf@default@options #1]}% - \gdef@cx{zf@family@fontname\zf@family}{\zf@fontname}% - \gdef@cx{zf@family@options\zf@family}{\zf@default@options #1}% - \gdef@cx{zf@family@fontdef\zf@family} - {\zf@fontname\zf@suffix:\zf@pre@ff\zf@ff}% - \DeclareFontFamily{\zf@enc}{\zf@family}{}% - \zf@make@font@shapes{\zf@fontname} - {\mddefault}{\updefault}{\zf@font@feat\zf@up@feat}% - \unless\ifzf@nobf - \ifx\zf@bf\@empty - \zf@make@font@shapes[\zf@fontname]{/B} - {\bfdefault}{\updefault}{\zf@font@feat\zf@bf@feat}% - \else - \zf@make@font@shapes{\zf@bf} - {\bfdefault}{\updefault}{\zf@font@feat\zf@bf@feat}% - \fi - \fi - \unless\ifzf@noit - \ifx\zf@it\@empty - \zf@make@font@shapes[\zf@fontname]{/I} - {\mddefault}{\itdefault}{\zf@font@feat\zf@it@feat}% - \else - \zf@make@font@shapes{\zf@it} - {\mddefault}{\itdefault}{\zf@font@feat\zf@it@feat}% - \fi - \fi - \@tempswatrue - \ifzf@nobf\@tempswafalse\fi - \ifzf@noit\@tempswafalse\fi - \if@tempswa - \ifx\zf@bfit\@empty - \ifx\zf@bf\@empty - \ifx\zf@it\@empty - \zf@make@font@shapes[\zf@fontname]{/BI} - {\bfdefault}{\itdefault}{\zf@font@feat\zf@bfit@feat}% - \else - \zf@make@font@shapes[\zf@it]{/B} - {\bfdefault}{\itdefault}{\zf@font@feat\zf@bfit@feat}% - \fi - \else - \zf@make@font@shapes[\zf@bf]{/I} - {\bfdefault}{\itdefault}{\zf@font@feat\zf@bfit@feat}% - \fi - \else - \zf@make@font@shapes{\zf@bfit} - {\bfdefault}{\itdefault}{\zf@font@feat\zf@bfit@feat}% - \fi - \fi - \ifxeCJK@SlantFont@ - \zf@make@font@shapes{\zf@fontname}{\mddefault}{\sldefault} - {\zf@font@feat,RawFeature={slant=0.167}} - \ifx\zf@bf\@empty - \ifzf@nobf - \zf@make@font@shapes{\zf@fontname}{\bfdefault}{\sldefault} - {\zf@font@feat,RawFeature={embolden=4,slant=0.167}} - \else - \zf@make@font@shapes[\zf@fontname]{/B} - {\bfdefault}{\sldefault}{\zf@font@feat\zf@bf@feat,RawFeature={slant=0.167}} - \fi - \else - \ifx\zf@fontname\zf@bf - \zf@make@font@shapes{\zf@fontname}{\bfdefault}{\sldefault} - {\zf@font@feat,RawFeature={embolden=4,slant=0.167}} - \else - \zf@make@font@shapes{\zf@bf}{\bfdefault}{\sldefault} - {\zf@font@feat\zf@bf@feat,RawFeature={slant=0.167}} - \fi - \fi - \fi - \fi - \endgroup} + \expandafter\edef\csname xeCJK@font@#1\endcsname{ + \noexpand\fontspec[\xeCJK@Features]{#3}} + \expandafter\edef\csname xeCJK@fontoptions@#1\endcsname{\xeCJK@Features} + \expandafter\edef\csname xeCJK@fontname@#1\endcsname{#3}} + \newcount\xeCJK@featureadded \xeCJK@featureadded=0 @@ -968,14 +873,14 @@ \def\addCJKfontfeatures#1{ \global\advance\xeCJK@featureadded\@ne \ifcsname xeCJK@family\endcsname - \edef\xeCJK@temp{\csname xeCJK@nsff\xeCJK@family\endcsname} - \edef\xeCJK@Features{[\csname zf@family@options\xeCJK@temp\endcsname,#1]} - \expandafter - \newfontfamily@i\csname xeCJK@font@\xeCJK@family @\the\xeCJK@featureadded\expandafter\endcsname - \xeCJK@Features - {\csname zf@family@fontname\xeCJK@temp\endcsname} - \expandafter\edef\csname xeCJK@nsff\xeCJK@family @\the\xeCJK@featureadded\endcsname{\zf@family} - \CJKfamily{\xeCJK@family @\the\xeCJK@featureadded} + \edef\xeCJK@tempa{\csname xeCJK@fontoptions@\xeCJK@family\endcsname,#1} + \edef\xeCJK@tempb{\csname xeCJK@fontname@\xeCJK@family\endcsname} + \edef\xeCJK@tempf{\xeCJK@family @\the\xeCJK@featureadded} + \expandafter\edef\csname xeCJK@font@\xeCJK@tempf\endcsname{ + \noexpand\fontspec[\xeCJK@tempa]{\xeCJK@tempb}} + \expandafter\edef\csname xeCJK@fontoptions@\xeCJK@tempf\endcsname{\xeCJK@tempa} + \expandafter\edef\csname xeCJK@fontname@\xeCJK@tempf\endcsname{\xeCJK@tempb} + \CJKfamily{\xeCJK@tempf} \fi} \def\addfontfeatures#1{ |