From 61baa79e78e4c4e58908e4a028784eb87f5d8378 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 22 Feb 2017 23:03:37 +0000
Subject: ctex (22feb17)

git-svn-id: svn://tug.org/texlive/trunk@43306 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/ctex/ctex.dtx | 99 ++++++++++++++++++----------
 1 file changed, 64 insertions(+), 35 deletions(-)

(limited to 'Master/texmf-dist/source/latex/ctex/ctex.dtx')

diff --git a/Master/texmf-dist/source/latex/ctex/ctex.dtx b/Master/texmf-dist/source/latex/ctex/ctex.dtx
index 5643f78e98e..18a215df3d6 100644
--- a/Master/texmf-dist/source/latex/ctex/ctex.dtx
+++ b/Master/texmf-dist/source/latex/ctex/ctex.dtx
@@ -2,7 +2,7 @@
 % !TeX program  = XeLaTeX
 % !TeX encoding = UTF-8
 %
-% Copyright (C) 2003--2016
+% Copyright (C) 2003--2017
 % CTEX.ORG and any individual authors listed elsewhere in this file.
 % --------------------------------------------------------------------------
 %
@@ -54,7 +54,7 @@ Issues and pull requests are welcome.
 Copyright and Licence
 ---------------------
 
-    Copyright (C) 2003--2016
+    Copyright (C) 2003--2017
     CTEX.ORG and any individual authors listed elsewhere in this file.
     ----------------------------------------------------------------------
 
@@ -152,7 +152,7 @@ Copyright and Licence
 
 \preamble
 
-    Copyright (C) 2003--2016
+    Copyright (C) 2003--2017
     CTEX.ORG and any individual authors listed in the documentation.
 ------------------------------------------------------------------------------
 
@@ -413,7 +413,7 @@ Copyright and Licence
 %<*!(c19|c70|ctexspa|dict)>
 %<class|style|ctexcap|ctexhook|ctexpatch|ctxdoc>\NeedsTeXFormat{LaTeX2e}
 %<class|style|ctexcap|ctexhook|ctexpatch|ctxdoc>\RequirePackage{expl3}
-%<+!driver>\GetIdInfo$Id: ctex.dtx 6471e87 2016-12-27 17:33:18 +0800 Qing Lee <sobenlee@gmail.com> $
+%<+!driver>\GetIdInfo$Id: ctex.dtx d459e18 2017-02-23 02:07:49 +0800 Qing Lee <sobenlee@gmail.com> $
 %<ctxdoc>  {ctex documentation (CTEX)}
 %<ctxdoc>\ProvidesExplClass{ctxdoc}
 %<ctex>  {Chinese adapter in LaTeX (CTEX)}
@@ -502,7 +502,7 @@ Copyright and Licence
 %<founder>\ProvidesExplFile{ctex-fontset-founder.def}
 %<ubuntu>  {Ubuntu fonts definition (CTEX)}
 %<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def}
-%<!driver>  {\ExplFileDate}{2.4.7}{\ExplFileDescription}
+%<!driver>  {\ExplFileDate}{2.4.8}{\ExplFileDescription}
 %</!(c19|c70|ctexspa|dict)>
 %<c19&rm>\ProvidesFile{c19rm.fd}%
 %<c19&sf>\ProvidesFile{c19sf.fd}%
@@ -513,9 +513,9 @@ Copyright and Licence
 %<ctexspa>\ProvidesFile{ctexspa.def}%
 %<dict&theorem&GBK>\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}%
 %<dict&theorem&UTF8>\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}%
-%<c19|c70>  [2016/12/27 v2.4.7 Chinese font definition (CTEX)]
-%<ctexspa>  [2016/12/27 v2.4.7 Space info for CJKpunct (CTEX)]
-%<dict&theorem>  [2016/12/27 v2.4.7 Chinese translation for theorem name (CTEX)]
+%<c19|c70>  [2017/02/23 v2.4.8 Chinese font definition (CTEX)]
+%<ctexspa>  [2017/02/23 v2.4.8 Space info for CJKpunct (CTEX)]
+%<dict&theorem>  [2017/02/23 v2.4.8 Chinese translation for theorem name (CTEX)]
 %</!(driver|readme|install|zhmap|spa|docstrip)>
 %<*driver>
 \documentclass{ctxdoc}
@@ -537,7 +537,7 @@ Copyright and Licence
 % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。}
 %
 %
-% \CheckSum{5878}
+% \CheckSum{5898}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -4725,12 +4725,12 @@ Copyright and Licence
 \newfontfeature { JFM-var } { jfmvar = #1 }
 %    \end{macrocode}
 %
-% 在新版本的 \pkg{fontspec} 中，\cs{__fontspec_namewrap:n} 变成了私有函数。
+% 在新版本的 \pkg{fontspec} 中，\cs{__fontspec_fontname_wrap:n} 变成了私有函数。
 %    \begin{macrocode}
 \keys_define:nn { fontspec-preparse-external }
   {
     NoEmbed .code:n =
-      { \cs_set_eq:NN \__fontspec_namewrap:n \@@_noembed_wrap:n }
+      { \cs_set_eq:NN \__fontspec_fontname_wrap:n \@@_noembed_wrap:n }
   }
 \cs_new:Npn \@@_noembed_wrap:n #1 { psft: #1 }
 %    \end{macrocode}
@@ -4813,6 +4813,7 @@ Copyright and Licence
         \group_begin:
         \@@_change_encoding:
         \exp_not:n { \cs_set_eq:NN \CJKfamily \use_none:n }
+        \exp_not:n { \cs_set_eq:NN \CTEX@fontfamily \use_none:n }
         \exp_not:n { \fontspec_set_family:Nnn \g_@@_fontspec_family_tl }
           { \exp_not:o { \l_@@_font_options_clist } } {#2}
         \prop_gput:Nno \exp_not:N \g_@@_family_name_prop {#1}
@@ -5094,24 +5095,39 @@ Copyright and Licence
 \tl_if_exist:NF \CJKrmdefault { \tl_const:Nn \CJKrmdefault { rm } }
 \tl_if_exist:NF \CJKsfdefault { \tl_const:Nn \CJKsfdefault { sf } }
 \tl_if_exist:NF \CJKttdefault { \tl_const:Nn \CJKttdefault { tt } }
-\ctex_preto_cmd:NnnTF \rmfamily { \ExplSyntaxOff }
-  { \CJKfamily { \CJKrmdefault } }
-  { }
-  { \ctex_patch_failure:N \rmfamily }
-\ctex_preto_cmd:NnnTF \sffamily { \ExplSyntaxOff }
-  { \CJKfamily { \CJKsfdefault } }
-  { }
-  { \ctex_patch_failure:N \sffamily }
-\ctex_preto_cmd:NnnTF \ttfamily { \ExplSyntaxOff }
-  { \CJKfamily { \CJKttdefault } }
-  { }
-  { \ctex_patch_failure:N \ttfamily }
-\ctex_preto_cmd:NnnTF \normalfont { \ExplSyntaxOff }
-  { \CJKfamily { \CJKfamilydefault } }
-  { \cs_set_eq:NN \reset@font \normalfont }
-  { \ctex_patch_failure:N \normalfont }
 %    \end{macrocode}
 %
+% \begin{macro}[int]{\fontfamily}
+% \begin{macro}[int]{\CTEX@fontfamily}
+% \changes{v2.4.8}{2017/02/23}
+%   {解决与 \pkg{fontspec} 2017/01/24 v2.5d 的字体族匹配兼容问题。}
+% 修改 \tn{fontfamily}，使主要 |CJK| 字体族能随西文主要字体更新。
+%    \begin{macrocode}
+\RenewDocumentCommand \fontfamily { m }
+  {
+    \tl_set:Nx \f@family {#1}
+    \CTEX@fontfamily {#1}
+  }
+\cs_new_protected_nopar:Npn \CTEX@fontfamily #1
+  {
+    \str_if_eq:nnTF {#1} { \familydefault }
+      { \CJKfamily { \CJKfamilydefault } }
+      { \@@_update_family_aux: }
+  }
+\cs_new_protected_nopar:Npn \@@_update_family_aux:
+  {
+    \str_case_x:nn { \f@family }
+      {
+        { \rmdefault }     { \CJKfamily { \CJKrmdefault } }
+        { \sfdefault }     { \CJKfamily { \CJKsfdefault } }
+        { \ttdefault }     { \CJKfamily { \CJKttdefault } }
+        { \familydefault } { \CJKfamily { \CJKfamilydefault } }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % 在导言区末尾更新 \tn{CJKfamilydefault}。
 %    \begin{macrocode}
 \ctex_at_end_preamble:n { \ctex_update_default_family: }
@@ -5680,9 +5696,22 @@ Copyright and Licence
 \tl_set:Nn \CJKsfdefault { sf }
 \tl_set:Nn \CJKttdefault { tt }
 \tl_set:Nn \CJKfamilydefault { \CJKrmdefault }
-\tl_put_left:Nn \rmfamily { \kanjifamily { \CJKrmdefault } }
-\tl_put_left:Nn \sffamily { \kanjifamily { \CJKsfdefault } }
-\tl_put_left:Nn \ttfamily { \kanjifamily { \CJKttdefault } }
+\ctex_preto_cmd:NnnTF \rmfamily { \ExplSyntaxOff }
+  { \kanjifamily { \CJKrmdefault } }
+  { }
+  { \ctex_patch_failure:N \rmfamily }
+\ctex_preto_cmd:NnnTF \sffamily { \ExplSyntaxOff }
+  { \kanjifamily { \CJKsfdefault } }
+  { }
+  { \ctex_patch_failure:N \sffamily }
+\ctex_preto_cmd:NnnTF \ttfamily { \ExplSyntaxOff }
+  { \kanjifamily { \CJKttdefault } }
+  { }
+  { \ctex_patch_failure:N \ttfamily }
+\ctex_preto_cmd:NnnTF \normalfont { \ExplSyntaxOff }
+  { \kanjifamily { \CJKfamilydefault } }
+  { \cs_set_eq:NN \reset@font \normalfont }
+  { \ctex_patch_failure:N \normalfont }
 \NewDocumentCommand \CJKfamily { m }
   {
     \kanjifamily { #1 }
@@ -9966,7 +9995,7 @@ Copyright and Licence
 %    \begin{macrocode}
 %<*windows>
 \ProvidesFile{zhwindowsfonts.tex}%
-  [2016/12/27 v2.4.7 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
+  [2017/02/23 v2.4.8 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
 
 \ifzhmappdf
   \pdfmapline{=gbk@UGBK@     <simsun.ttc}
@@ -10038,7 +10067,7 @@ Copyright and Licence
 %    \begin{macrocode}
 %<*adobe>
 \ProvidesFile{zhadobefonts.tex}%
-  [2016/12/27 v2.4.7 Adobe font map loader for DVIPDFMx (CTEX)]
+  [2017/02/23 v2.4.8 Adobe font map loader for DVIPDFMx (CTEX)]
 
 \ifzhmappdf
 %% pdfTeX does not support OTF fonts
@@ -10074,7 +10103,7 @@ Copyright and Licence
 %    \begin{macrocode}
 %<*fandol>
 \ProvidesFile{zhfandolfonts.tex}%
-  [2016/12/27 v2.4.7 Fandol font map loader for DVIPDFMx (CTEX)]
+  [2017/02/23 v2.4.8 Fandol font map loader for DVIPDFMx (CTEX)]
 
 \ifzhmappdf
 %% pdfTeX does not support OTF fonts
@@ -10110,7 +10139,7 @@ Copyright and Licence
 %    \begin{macrocode}
 %<*founder>
 \ProvidesFile{zhfounderfonts.tex}%
-  [2016/12/27 v2.4.7 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
+  [2017/02/23 v2.4.8 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
 
 \ifzhmappdf
   \pdfmapline{=gbk@UGBK@     <FZSSK.TTF}
@@ -10182,7 +10211,7 @@ Copyright and Licence
 %    \begin{macrocode}
 %<*ubuntu>
 \ProvidesFile{zhubuntufonts.tex}%
-  [2016/12/27 v2.4.7 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
+  [2017/02/23 v2.4.8 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)]
 
 \ifzhmappdf
   \pdfmapline{=gbk@UGBK@     <uming.ttc}
-- 
cgit v1.2.3

