From 766d9bbc3ad2de6c916ce68496922fe993550974 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 2 Mar 2014 13:46:23 +0000 Subject: xdcjk 3.2.10 (28Feb) git-svn-id: svn://tug.org/texlive/trunk@33074 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty | 56 +++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty') diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty index 31b275dbe42..5f586a2ffcb 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: `package') %% -%% $Id: xeCJK.dtx 537 2013-12-08 13:01:40Z sobenlee $ +%% $Id: xeCJK.dtx 549 2014-03-01 09:06:08Z sobenlee $ %% $URL: https://ctex-kit.googlecode.com/svn/trunk/xeCJK/xeCJK.dtx $ %% ----------------------------------------------------------------- %% Author: @@ -15,9 +15,9 @@ %% Leo Liu %% Qing Lee %% -%% Copyright (C) 2007--2013 Wenchang Sun -%% (C) 2009--2013 Leo Liu -%% (C) 2012--2013 Qing Lee +%% Copyright (C) 2007--2014 Wenchang Sun +%% (C) 2009--2014 Leo Liu +%% (C) 2012--2014 Qing Lee %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -33,11 +33,11 @@ %% \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} -\GetIdInfo$Id: xeCJK.dtx 537 2013-12-08 13:01:40Z sobenlee $ +\GetIdInfo$Id: xeCJK.dtx 549 2014-03-01 09:06:08Z sobenlee $ {Typesetting CJK scripts with XeLaTeX} \ProvidesExplPackage {\ExplFileName} - {\ExplFileDate}{3.2.9}{\ExplFileDescription} + {\ExplFileDate}{3.2.10}{\ExplFileDescription} \msg_new:nnn { xeCJK } { Require-XeTeX } { The~xeCJK~package~requires~XeTeX~to~function.\\\\ @@ -2926,6 +2926,15 @@ } \cs_generate_variant:Nn \prop_get:NnN { Nx } \cs_generate_variant:Nn \prop_get:NnNTF { Nx } +\keys_define:nn { xeCJK / options } + { LoadFandol .bool_gset:N = \g__xeCJK_fandol_bool } +\cs_new_protected_nopar:Npn \__xeCJK_load_fandol: + { + \setCJKmainfont + [ BoldFont = FandolSong-Bold , ItalicFont = FandolKai ] { FandolSong-Regular } + \setCJKsansfont [ BoldFont = FandolHei-Bold ] { FandolHei-Regular } + \setCJKmonofont { FandolFang } + } \__xeCJK_at_end_preamble:n { \cs_set_eq:NN \__xeCJK_family_default_wrap:n \exp_not:n @@ -2944,7 +2953,19 @@ } \cs_undefine:N \__xeCJK_family_default_wrap:n \prop_if_empty:NTF \g__xeCJK_family_font_name_prop - { \__xeCJK_warning:nx { no-CJKfamily } { \CJKfamilydefault } } + { + \bool_if:NTF \g__xeCJK_fandol_bool + { + \__xeCJK_warning:n { fandol } + \__xeCJK_load_fandol: + \use:n + } + { + \__xeCJK_warning:nx { no-CJKfamily } { \CJKfamilydefault } + \use_none:n + } + } + { \use:n } { \xeCJK_family_if_exist:xF { \CJKfamilydefault } { @@ -2982,6 +3003,11 @@ has~been~replaced~by~`\__xeCJK_msg_family_map:n {#2}'.\\\\ Try~to~use~`\__xeCJK_msg_def_family_map:n {#1}'~to~define~it. } +\__xeCJK_msg_new:nn { fandol } + { + Fandol~is~being~set~as~the~default~font~for~CJK~text.\\ + Please~make~sure~it~has~been~properly~installed. + } \keys_define:nn { xeCJK / options } { CJKmath .bool_gset:N = \g__xeCJK_math_bool } \NewDocumentCommand \setCJKmathfont { O { } m } { \xeCJK_set_family:xxx { \c__xeCJK_math_tl } {#1} {#2} } @@ -3386,6 +3412,7 @@ xeCJKactive = true , LocalConfig = true , indentfirst = true , + LoadFandol = true , Verb = env , EmboldenFactor = 4 , SlantFactor = 0.167 , @@ -3804,13 +3831,16 @@ \str_if_eq:nnT {#1} { \CJK@UnicodeEnc } { \group_begin: - \cs_set_nopar:Npn \Unicode ##1##2 - { (##1) * \c_two_hundred_fifty_six + (##2) } - \cs_set_eq:NN \def \xeCJK_char_from_charcode:Nn - #2 + \cs_set_eq:NN \Unicode \__xeCJK_calc_unicode:nn + \cs_set_eq:NN \def \xeCJK_char_from_charcode:Nn + #2 \group_end: \tl_gset:Nn \CJK@tenthousand { ^^^^4e07 } \tl_gset:Nn \CJK@hundredmillion { ^^^^4ebf } + \tl_if_exist:NF \CJK@UnicodeEnc + { \tl_const:Nn \CJK@UnicodeEnc { UTF8 } } + \cs_if_exist:NF \Unicode + { \cs_new_eq:NN \Unicode \xeCJK_unicode_char:nn } } } \cs_new_protected_nopar:Npn \xeCJK_char_from_charcode:Nn #1#2 @@ -3823,6 +3853,10 @@ \tl_const:Nn #1 { ^^^^4e00 } } } +\cs_new_nopar:Npn \__xeCJK_calc_unicode:nn #1#2 + { (#1) * \c_two_hundred_fifty_six + (#2) } +\cs_new_protected_nopar:Npn \xeCJK_unicode_char:nn #1#2 + { \tex_char:D \etex_numexpr:D \__xeCJK_calc_unicode:nn {#1} {#2} \scan_stop: } \bool_if:NT \g__xeCJK_number_bool { \RequirePackage { CJKnumb } } \bool_if:NT \g__xeCJK_config_bool { -- cgit v1.2.3