From 817bd9ee7989899537f653d508b53cef3ad13d0e Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sun, 28 Feb 2016 23:29:26 +0800 Subject: [PATCH 01/20] =?UTF-8?q?ctex:=20upTeX=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=8C=E4=B9=9F=E5=8F=AF=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=20ptex-ng=E3=80=82=E6=9A=82=E4=BB=85=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=20Windows=20=E5=AE=8B=E9=BB=91=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E3=80=82=20update=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 206 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 172 insertions(+), 34 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 09c8519a..0c9c9b8c 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -87,6 +87,7 @@ This package consists of the file ctex.dtx, and the derived files ctex-engine-pdftex.def, ctex-engine-xetex.def, ctex-engine-luatex.def, + ctex-engine-uptex.def, c19rm.fd, c19sf.fd, c19tt.fd, @@ -231,6 +232,7 @@ This package consists of the file ctex.dtx, and the derived files ctex-engine-pdftex.def, ctex-engine-xetex.def, ctex-engine-luatex.def, + ctex-engine-uptex.def, c19rm.fd, c19sf.fd, c19tt.fd, @@ -300,6 +302,7 @@ This package consists of the file ctex.dtx, and the derived files \file{ctex-engine-pdftex.def} {\from{\jobname.dtx}{pdftex}} \file{ctex-engine-xetex.def} {\from{\jobname.dtx}{xetex}} \file{ctex-engine-luatex.def} {\from{\jobname.dtx}{luatex}} + \file{ctex-engine-uptex.def} {\from{\jobname.dtx}{uptex}} \file{c19rm.fd} {\from{\jobname.dtx}{rm,c19}} \file{c19sf.fd} {\from{\jobname.dtx}{sf,c19}} \file{c19tt.fd} {\from{\jobname.dtx}{tt,c19}} @@ -379,6 +382,7 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* ctex-engine-pdftex.def *} \Msg{* ctex-engine-xetex.def *} \Msg{* ctex-engine-luatex.def *} +\Msg{* ctex-engine-uptex.def *} \Msg{* c19rm.fd *} \Msg{* c19sf.fd *} \Msg{* c19tt.fd *} @@ -496,6 +500,8 @@ This package consists of the file ctex.dtx, and the derived files %\ProvidesExplFile{ctex-engine-xetex.def} % {LuaLaTeX adapter (CTEX)} %\ProvidesExplFile{ctex-engine-luatex.def} +% {upTeX adapter (CTEX)} +%\ProvidesExplFile{ctex-engine-uptex.def} % {Windows fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-windows.def} % {Windows fonts definition for Vista or later version (CTEX)} @@ -757,6 +763,8 @@ This package consists of the file ctex.dtx, and the derived files \def\LaTeXe{\hologo{LaTeX2e}} \def\LaTeXiii{\hologo{LaTeX3}} \def\dvipdfmx{DVIPDFM\textit{x}} +\def\upTeX{up\TeX} +\def\upLaTeX{up\LaTeX} \def\ctexkitrev#1{% \href{https://github.com/CTeX-org/ctex-kit/commit/#1}{\texttt{ctex-kit} rev. #1}} \patchcmd\theCodelineNo{\sffamily\tiny}{\normalfont\sffamily\tiny}{}{} @@ -5774,6 +5782,101 @@ This package consists of the file ctex.dtx, and the derived files % % \end{macrocode} % +% \subsubsection{\pkg{ctex-engine-uptex.def}} +% +% \begin{macrocode} +%<*uptex> +% \end{macrocode} +% +% \changes{v2.?}{2016/02/28}{初步支持 \upLaTeX。} ^^A FIXME +% +% \upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别表示横排与直排的日文。 +% 这里暂时不写 |.fd| 文件,直接定义宋体和黑体。 +% \begin{macrocode} +\DeclareKanjiFamily{JY2}{rm}{} +\DeclareRelationFont{JY2}{rm}{m}{}{T1}{cmr}{m}{} +\DeclareRelationFont{JY2}{rm}{bx}{}{T1}{cmr}{bx}{} +\DeclareFontShape{JY2}{rm}{m}{n}{<-> upstsl-h}{} +\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upstht-h}{} +\DeclareKanjiFamily{JY2}{sf}{} +\DeclareRelationFont{JY2}{sf}{m}{}{T1}{cmss}{m}{} +\DeclareRelationFont{JY2}{sf}{bx}{}{T1}{cmss}{bx}{} +\DeclareFontShape{JY2}{sf}{m}{n}{<-> upstht-h}{} +\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upstht-h}{} +\DeclareKanjiFamily{JT2}{rm}{} +\DeclareRelationFont{JT2}{rm}{m}{}{T1}{cmr}{m}{} +\DeclareRelationFont{JT2}{rm}{bx}{}{T1}{cmr}{bx}{} +\DeclareFontShape{JT2}{rm}{m}{n}{<-> upstsl-v}{} +\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upstht-v}{} +\DeclareKanjiFamily{JT2}{sf}{} +\DeclareRelationFont{JT2}{sf}{m}{}{T1}{cmss}{m}{} +\DeclareRelationFont{JT2}{sf}{bx}{}{T1}{cmss}{bx}{} +\DeclareFontShape{JT2}{sf}{m}{n}{<-> upstht-v}{} +\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upstht-v}{} +% \end{macrocode} +% +% 按 \pkg{CJK} 的命名习惯模拟部分命令,并设置默认字体。 +% \begin{macrocode} +\tl_set:Nn \CJKrmdefault { rm } +\tl_set:Nn \CJKsfdefault { sf } +\tl_set:Nn \CJKfamilydefault { \CJKrmdefault } +\tl_put_left:Nn \rmfamily { \kanjifamily { \CJKrmdefault } } +\tl_put_left:Nn \sffamily { \kanjifamily { \CJKsfdefault } } +\NewDocumentCommand \CJKfamily { m } + { + \kanjifamily { #1 } + \selectfont + } +\tl_set:Nn \kanjifamilydefault { \CJKfamilydefault } +% \end{macrocode} +% +% \begin{macro}[int]{\ctex_set_zhmap:n} +% 设置字体映射,同时作用于 \tn{AtBeginDvi} 与 \tn{AtBeginShipoutFirst}。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 + { + \AtBeginDvi { #1 } + \ctex_at_end_package:nn { atbegshi } + { \AtBeginShipoutFirst { #1 } } + } +\@onlypreamble \ctex_set_zhmap:n +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\@EverySelectfont@Init} +% \pkg{everysel} 宏包(2011/10/28)未考虑 \upLaTeX{} 对 \tn{selectfont} 的修 +% 改,因此这里需要对其给出正确的定义。因为不会使用 \pkg{CJK},这里忽略有关 +% \pkg{CJK} 的定义。 +% \begin{macrocode} +\cs_set_nopar:Npn \@EverySelectfont@Init + { + \ctex_patch_cmd:Nnn \selectfont + { \enc@update } + { + \@EverySelectfont@EveryHook + \@EverySelectfont@AtNextHook + \gdef \@EverySelectfont@AtNextHook { } + \enc@update + } + \@ifpackageloaded { tracefnt } + { + \EverySelectfont + { + \ifnum \tracingfonts > \tw@ + \@font@info { Switching~ to~ \font@name } + \fi + } + } + { } + \let \@EverySelectfont@Init \undefined + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +% +% \end{macrocode} +% % \subsubsection{调整 \tn{CJKfamilydefault}} % % \changes{v2.4}{2016/02/15}{正确更新 \pkg{CJK} 包的 \tn{CJKfamilydefault}。} @@ -5857,7 +5960,7 @@ This package consists of the file ctex.dtx, and the derived files % 文件系统的大小写敏感性来判断。Mac~OS~X 的大小写敏感性在安装时是可选的。为了 % 保险起见,这里的判断很繁琐,最多要进行 4 次文件操作! % \begin{macrocode} -%<*xetex|pdftex> +%<*xetex|pdftex|uptex> \cs_new_protected_nopar:Npn \ctex_detected_platform: { \file_if_exist:nTF { /dev/null } @@ -5888,7 +5991,7 @@ This package consists of the file ctex.dtx, and the derived files { \tl_gset:Nn \g_@@_fontset_tl {#2} } } \str_const:Nn \c_@@_macosx_file_str { /Library/Fonts/Songti.ttc } -% +% % \end{macrocode} % \end{macro} % @@ -5995,7 +6098,17 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % % \begin{macrocode} -%<*pdftex|xetex|luatex> +%<*uptex> +\PassOptionsToPackage { dvipdfmx } { hyperref } +\ctex_at_end_package:nn { hyperref } + { + \AtBeginShipoutFirst{ \special{ pdf:tounicode~ UTF8-UTF16 } } + } +% +% \end{macrocode} +% +% \begin{macrocode} +%<*pdftex|xetex|luatex|uptex> % \end{macrocode} % % \subsubsection{\pkg{CJKfntef}、\pkg{xeCJKfntef} 相关设置} @@ -6056,11 +6169,11 @@ This package consists of the file ctex.dtx, and the derived files } \cs_new_protected_nopar:Npn { \endCTEXfilltwosides } { \endCJKfilltwosides } % -%<*luatex> +%<*luatex|uptex> { \cs_new_eq:cN { CTEX#1 } \use:n } \cs_new_eq:NN \CTEXfilltwosides \use_none:n \cs_new_eq:NN \endCTEXfilltwosides \prg_do_nothing: -% +% %<*pdftex> \clist_map_inline:nn { @@ -6091,6 +6204,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } } % +%<*uptex> + { \skip_set:Nn \ccwd { 1zw } } +% \dim_new:N \ccwd % \end{macrocode} % \end{macro} @@ -6111,6 +6227,9 @@ This package consists of the file ctex.dtx, and the derived files %<*luatex> { \ltjsetkanjiskip \l_@@_ccglue_skip } % +%<*uptex> + { \kanjiskip \l_@@_ccglue_skip } +% \skip_new:N \l_@@_ccglue_skip % \end{macrocode} % \end{macro} @@ -6128,6 +6247,10 @@ This package consists of the file ctex.dtx, and the derived files \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ltjgetparameter { kanjiskip } } { \prg_return_false: } { \prg_return_true: } % +%<*uptex> + \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \kanjiskip } + { \prg_return_false: } { \prg_return_true: } +% } % \end{macrocode} % 注意下面的标记不能用 \verb"%",它会导致旧版本的 \pkg{l3docstrip} @@ -6152,6 +6275,7 @@ This package consists of the file ctex.dtx, and the derived files \cs_new_protected_nopar:Npn \ctex_update_em_unit: % { \dim_set:Nn \ccwd { \f@size \p@ } } % { \dim_set:Nn \ccwd { \zw } } +% { \dim_set:Nn \ccwd { 1zw } } % \end{macrocode} % \end{macro} % @@ -6186,9 +6310,9 @@ This package consists of the file ctex.dtx, and the derived files %<*pdftex> \EverySelectfont { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } } % -%<*xetex|luatex> +%<*xetex|luatex|uptex> \EverySelectfont { \CTEX@selectfont@hook } -% +% % \end{macrocode} % % Attribute 寄存器 \tn{ltj@curjfnt} 的初始值是 $-1$,必须把它设置为一个有效的 @@ -6208,7 +6332,8 @@ This package consists of the file ctex.dtx, and the derived files % % \begin{macro}{space} % 在导言区或正文中设置忽略空格方式。 -% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{} 下是无效选项。 +% \pdfTeX{} 和 \XeTeX{} 下初始设置为 \opt{auto},\LuaTeX{}、\upTeX{} 下是无效 +% 选项。 % \begin{macrocode} \keys_define:nn { ctex } { @@ -6226,17 +6351,17 @@ This package consists of the file ctex.dtx, and the derived files space .default:n = { true } , space .initial:n = { auto } % -%<*luatex> +%<*luatex|uptex> space .code:n = { \msg_warning:nn { ctex } { invalid-option } } -% +% } % \end{macrocode} % \end{macro} % % \begin{macro}{punct} % 在导言区或正文中设置标点符号输出格式。\pkg{LuaTeX-ja} 设置的是字体的默认 \texttt{JFM}, -% 只会影响到之后设置的字体。 +% 只会影响到之后设置的字体。\upTeX{} 暂时无效。 % \begin{macrocode} \keys_define:nn { ctex } { @@ -6246,21 +6371,22 @@ This package consists of the file ctex.dtx, and the derived files % \punctstyle { \l_@@_punct_tl } % \xeCJKsetup { PunctStyle = \l_@@_punct_tl } % \ctex_mono_jfm:o { \l_@@_punct_tl } +% \msg_warning:nn { ctex } { invalid-option } } , punct .default:n = { quanjiao } , } % \end{macrocode} % \end{macro} % -% \XeLaTeX{} 和 \LuaLaTeX{} 总是使用 \texttt{UTF8} 编码。 +% \XeLaTeX{}、\LuaLaTeX{} 和 \upLaTeX{} 总是使用 \texttt{UTF8} 编码。 % \begin{macrocode} -%<*xetex|luatex> +%<*xetex|luatex|uptex> \tl_set:Nn \l_@@_encoding_tl { UTF8 } -% +% % \end{macrocode} % % \begin{macrocode} -% +% %<*class|ctex> % \end{macrocode} % @@ -8845,31 +8971,43 @@ This package consists of the file ctex.dtx, and the derived files } } { + \sys_if_engine_uptex:TF + { + \ctex_set_zhmap:n + { + \special{ pdf:mapline~ upstsl-h~ UniGB-UTF16-H~ simsun.ttc } + \special{ pdf:mapline~ upstsl-v~ UniGB-UTF16-V~ simsun.ttc } + \special{ pdf:mapline~ upstht-h~ UniGB-UTF16-H~ simhei.ttf } + \special{ pdf:mapline~ upstht-v~ UniGB-UTF16-V~ simhei.ttf } + } + } + { %<*windowsold> - \setCJKmainfont - [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun } - \setCJKsansfont { SimHei } - \setCJKmonofont { FangSong_GB2312 } - \setCJKfamilyfont { zhkai } { KaiTi_GB2312 } - \setCJKfamilyfont { zhfs } { FangSong_GB2312 } + \setCJKmainfont + [ BoldFont = SimHei , ItalicFont = KaiTi_GB2312 ] { SimSun } + \setCJKsansfont { SimHei } + \setCJKmonofont { FangSong_GB2312 } + \setCJKfamilyfont { zhkai } { KaiTi_GB2312 } + \setCJKfamilyfont { zhfs } { FangSong_GB2312 } % %<*windowsnew> - \setCJKmainfont - [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun } - \setCJKsansfont - [ BoldFont = { *~Bold } ] { Microsoft~YaHei } - \setCJKmonofont { FangSong } - \setCJKfamilyfont { zhkai } { KaiTi } - \setCJKfamilyfont { zhfs } { FangSong } + \setCJKmainfont + [ BoldFont = SimHei , ItalicFont = KaiTi ] { SimSun } + \setCJKsansfont + [ BoldFont = { *~Bold } ] { Microsoft~YaHei } + \setCJKmonofont { FangSong } + \setCJKfamilyfont { zhkai } { KaiTi } + \setCJKfamilyfont { zhfs } { FangSong } % - \setCJKfamilyfont { zhsong } { SimSun } - \setCJKfamilyfont { zhhei } { SimHei } - \setCJKfamilyfont { zhli } { LiSu } - \setCJKfamilyfont { zhyou } { YouYuan } + \setCJKfamilyfont { zhsong } { SimSun } + \setCJKfamilyfont { zhhei } { SimHei } + \setCJKfamilyfont { zhli } { LiSu } + \setCJKfamilyfont { zhyou } { YouYuan } %<*windowsnew> - \setCJKfamilyfont { zhyahei } - [ BoldFont = { *~Bold } ] { Microsoft~YaHei } + \setCJKfamilyfont { zhyahei } + [ BoldFont = { *~Bold } ] { Microsoft~YaHei } % + } } % % \end{macrocode} From b298fe47249af0419b4f90f40630901f92c289ba Mon Sep 17 00:00:00 2001 From: Qing Lee Date: Mon, 29 Feb 2016 09:31:08 +0800 Subject: [PATCH 02/20] =?UTF-8?q?ctex:=20=E4=BD=BF=E7=94=A8=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=20upTeX=20=E5=AD=97=E4=BD=93=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #159 --- ctex/ctex.dtx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 0c9c9b8c..c69d81db 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -822,7 +822,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5329} +% \CheckSum{5421} % % \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 @@ -5796,23 +5796,23 @@ This package consists of the file ctex.dtx, and the derived files \DeclareKanjiFamily{JY2}{rm}{} \DeclareRelationFont{JY2}{rm}{m}{}{T1}{cmr}{m}{} \DeclareRelationFont{JY2}{rm}{bx}{}{T1}{cmr}{bx}{} -\DeclareFontShape{JY2}{rm}{m}{n}{<-> upstsl-h}{} -\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upstht-h}{} +\DeclareFontShape{JY2}{rm}{m}{n}{<-> upschrm-h}{} +\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upschgt-h}{} \DeclareKanjiFamily{JY2}{sf}{} \DeclareRelationFont{JY2}{sf}{m}{}{T1}{cmss}{m}{} \DeclareRelationFont{JY2}{sf}{bx}{}{T1}{cmss}{bx}{} -\DeclareFontShape{JY2}{sf}{m}{n}{<-> upstht-h}{} -\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upstht-h}{} +\DeclareFontShape{JY2}{sf}{m}{n}{<-> upschgt-h}{} +\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upschgt-h}{} \DeclareKanjiFamily{JT2}{rm}{} \DeclareRelationFont{JT2}{rm}{m}{}{T1}{cmr}{m}{} \DeclareRelationFont{JT2}{rm}{bx}{}{T1}{cmr}{bx}{} -\DeclareFontShape{JT2}{rm}{m}{n}{<-> upstsl-v}{} -\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upstht-v}{} +\DeclareFontShape{JT2}{rm}{m}{n}{<-> upschrm-v}{} +\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upschgt-v}{} \DeclareKanjiFamily{JT2}{sf}{} \DeclareRelationFont{JT2}{sf}{m}{}{T1}{cmss}{m}{} \DeclareRelationFont{JT2}{sf}{bx}{}{T1}{cmss}{bx}{} -\DeclareFontShape{JT2}{sf}{m}{n}{<-> upstht-v}{} -\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upstht-v}{} +\DeclareFontShape{JT2}{sf}{m}{n}{<-> upschgt-v}{} +\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upschgt-v}{} % \end{macrocode} % % 按 \pkg{CJK} 的命名习惯模拟部分命令,并设置默认字体。 From fc090c691bfbd3a4bf8af73e0bb06f5f31a5a9e8 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Mon, 21 Mar 2016 11:20:26 +0800 Subject: [PATCH 03/20] =?UTF-8?q?ctex-uptex:=20=E6=81=A2=E5=A4=8D=20LaTeX2?= =?UTF-8?q?e=20=E5=AF=B9=20\em=20=E7=9A=84=E5=8E=9F=E5=A7=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index c69d81db..4fe4c3aa 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -5830,6 +5830,15 @@ This package consists of the file ctex.dtx, and the derived files \tl_set:Nn \kanjifamilydefault { \CJKfamilydefault } % \end{macrocode} % +% \begin{macro}{\em} +% 恢复 \LaTeXe{} 对 \tn{em} 的原始定义。 +% \begin{macrocode} +\DeclareRobustCommand\em + {\@nomath\em \ifdim \fontdimen\@ne\font >\z@ + \eminnershape \else \itshape \fi} +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\ctex_set_zhmap:n} % 设置字体映射,同时作用于 \tn{AtBeginDvi} 与 \tn{AtBeginShipoutFirst}。 % \begin{macrocode} From 78ce798c97cb7faf2e90b1c4dbc96f90971dad40 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sun, 17 Apr 2016 21:26:55 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20zhmetrics-uptex?= =?UTF-8?q?=EF=BC=9A=E4=B8=BA=20upTeX=20=E7=BC=96=E5=86=99=E7=9A=84?= =?UTF-8?q?=E7=AE=80=E5=8D=95=E7=9A=84=20JFM=20=E5=8F=8A=20JVF=20=E4=BB=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=AD=E6=96=87=E3=80=82=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=206=20=E7=A7=8D=E5=AD=97=E4=BD=93=EF=BC=8C=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20Fandol=20=E5=AD=97=E4=BD=93=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E3=80=82=20JFM=20=E6=95=B0=E6=8D=AE=E6=8B=B7?= =?UTF-8?q?=E8=B4=9D=E8=87=AA=20upTeX=20=E8=87=AA=E5=B8=A6=E7=9A=84=20upji?= =?UTF-8?q?sr-{h,v}.pl=EF=BC=8CJVF=20=E7=94=A8=20makejvf=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E3=80=82=20=E6=B3=A8=E6=84=8F=E5=B0=BD=E7=AE=A1?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=BA=86=20Unicode=20=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=B9=B3=E9=9D=A2=E6=94=AF=E6=8C=81=EF=BC=8CJVF=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BD=93=E7=A7=AF=E4=BB=8D=E7=84=B6=E8=BE=83=E5=A4=A7?= =?UTF-8?q?=E3=80=82=20ctex=20=E5=8C=85=E8=B0=83=E7=94=A8=E8=BF=99?= =?UTF-8?q?=E7=BB=84=E5=AD=97=E4=BD=93=E6=97=B6=EF=BC=8C=E8=80=83=E8=99=91?= =?UTF-8?q?=E8=B7=A8=E5=B9=B3=E5=8F=B0=EF=BC=8C=E5=8F=AF=E4=BB=A5=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9B=B4=E5=A4=8D=E6=9D=82=E7=9A=84=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++ zhmetrics-uptex/README.md | 15 +++ zhmetrics-uptex/build.lua | 16 +++ zhmetrics-uptex/upzhfandolfonts-test.tex | 22 ++++ zhmetrics-uptex/upzhfandolfonts.tex | 15 +++ zhmetrics-uptex/upzhm-h.pl | 135 +++++++++++++++++++++++ zhmetrics-uptex/upzhm-v.pl | 135 +++++++++++++++++++++++ 7 files changed, 345 insertions(+) create mode 100644 zhmetrics-uptex/README.md create mode 100644 zhmetrics-uptex/build.lua create mode 100644 zhmetrics-uptex/upzhfandolfonts-test.tex create mode 100644 zhmetrics-uptex/upzhfandolfonts.tex create mode 100644 zhmetrics-uptex/upzhm-h.pl create mode 100644 zhmetrics-uptex/upzhm-v.pl diff --git a/.gitignore b/.gitignore index 0dadee3b..caeb74fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.aux *.dmp +*.dvi *.fd *.glo *.gls @@ -8,6 +9,7 @@ *.ilg *.ind *.ins +*.log *.out *.swp *.synctex.gz @@ -138,6 +140,11 @@ zhmetrics/zhmCJK.sty zhmetrics/zhmCJK-test.pdf zhmetrics/zhmCJK-test.tex +# zhmetrics-uptex +zhmetrics-uptex/*.tfm +zhmetrics-uptex/*.vf +zhmetrics-uptex/*.pdf + # zhnumber zhnumber/build/ diff --git a/zhmetrics-uptex/README.md b/zhmetrics-uptex/README.md new file mode 100644 index 00000000..0b5130d0 --- /dev/null +++ b/zhmetrics-uptex/README.md @@ -0,0 +1,15 @@ +# zhmetrics-uptex: Chinese Font Metrics for upTeX + +## Files + +* `upzh*-{h,v}.tfm` are the JFM files used for upTeX. +* `upzh*-{h,v}.vf` are the virtual fonts used for output driver (dvipdfmx). +* `up*-{h,v}.tfm` are the PS TFM files used for output driver. +* `upzhwinfonts.tex` contains the font mappings for Simplified Chinese version of Windows 8+. +* `upzhwinfonts-test.tex` is a small LaTeX test file. + +## Build + +Run: + +`texlua buld.lua` \ No newline at end of file diff --git a/zhmetrics-uptex/build.lua b/zhmetrics-uptex/build.lua new file mode 100644 index 00000000..b38881f3 --- /dev/null +++ b/zhmetrics-uptex/build.lua @@ -0,0 +1,16 @@ +#!/usr/bin/env texlua + +dirs = {'h', 'v'} +fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} +pltopf = 'uppltotf -kanji=uptex' +makejvf = 'makejvf -i -u gb' + +for _, hv in pairs(dirs) do + for _, fnt in pairs(fonts) do + pl = string.format("upzhm-%s.pl", hv) + jfm = string.format('upzh%s-%s.tfm', fnt, hv) + pstfm = string.format('up%s-%s.tfm', fnt, hv) + os.execute(string.format("%s %s %s", pltopf, pl, jfm)) + os.execute(string.format("%s %s %s", makejvf, jfm, pstfm)) + end +end diff --git a/zhmetrics-uptex/upzhfandolfonts-test.tex b/zhmetrics-uptex/upzhfandolfonts-test.tex new file mode 100644 index 00000000..92a36aba --- /dev/null +++ b/zhmetrics-uptex/upzhfandolfonts-test.tex @@ -0,0 +1,22 @@ +\documentclass{article} + +\font\rm=upzhserif-h +\font\it=upzhserifit-h +\font\bf=upzhserifb-h +\font\sf=upzhsans-h +\font\sfbf=upzhsansb-h +\font\tt=upzhmono-h + +\AtBeginDvi{\input{upzhfandolfonts}} + +\begin{document} + +\makeatletter +\@for\fnt:=\rm,\it,\bf,\sf,\sfbf,\tt \do{% + {\fnt + 庄子曰:“吾生也有涯,而知也无涯。以有涯随无涯,殆已!已而为知者,殆而已矣! + 为善无近名,为恶无近刑,缘督以为经,可以保身,可以全生,可以养亲,可以尽年。” + \par} +} + +\end{document} diff --git a/zhmetrics-uptex/upzhfandolfonts.tex b/zhmetrics-uptex/upzhfandolfonts.tex new file mode 100644 index 00000000..00eb699b --- /dev/null +++ b/zhmetrics-uptex/upzhfandolfonts.tex @@ -0,0 +1,15 @@ +% Fandol 字体映射 + +\special{pdf:mapline upserif-h UniGB-UTF16-H FandolSong-Regular.otf} +\special{pdf:mapline upserifit-h UniGB-UTF16-H FandolKai-Regular.otf} +\special{pdf:mapline upserifb-h UniGB-UTF16-H FandolSong-Bold.otf} +\special{pdf:mapline upsans-h UniGB-UTF16-H FandolHei-Regular.otf} +\special{pdf:mapline upsansb-h UniGB-UTF16-H FandolHei-Bold.otf} +\special{pdf:mapline upmono-h UniGB-UTF16-H FandolFang-Regular.otf} + +\special{pdf:mapline upserif-v UniGB-UTF16-V FandolSong-Regular.otf} +\special{pdf:mapline upserifit-v UniGB-UTF16-V FandolKai-Regular.otf} +\special{pdf:mapline upserifb-v UniGB-UTF16-V FandolSong-Bold.otf} +\special{pdf:mapline upsans-v UniGB-UTF16-V FandolHei-Regular.otf} +\special{pdf:mapline upsansb-v UniGB-UTF16-V FandolHei-Bold.otf} +\special{pdf:mapline upmono-v UniGB-UTF16-V FandolFang-Regular.otf} diff --git a/zhmetrics-uptex/upzhm-h.pl b/zhmetrics-uptex/upzhm-h.pl new file mode 100644 index 00000000..bf6bfdbf --- /dev/null +++ b/zhmetrics-uptex/upzhm-h.pl @@ -0,0 +1,135 @@ +(COMMENT Chinese Font Metrics for upTeX Horizontal Typesetting) +(DIRECTION YOKO) +(FAMILY UPZHM HANZI) +(FACE F MRR) +(CODINGSCHEME TEX KANJI TEXT) +(DESIGNSIZE R 10.0) +(COMMENT DESIGNSIZE IS IN POINTS) +(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) +(CHECKSUM O 0) +(FONTDIMEN + (SLANT R 0.0) + (SPACE R 0.0) + (STRETCH R 0.100000) + (SHRINK R 0.0) + (XHEIGHT R 1.000000) + (QUAD R 1.000000) + (EXTRASPACE R 0.250000) + (EXTRASTRETCH R 0.200000) + (EXTRASHRINK R 0.125000) + ) +(GLUEKERN + (LABEL O 0) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 1) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 2) + (GLUE O 0 R 0.500000 R 0.0 R 0.500000) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.500000) + (STOP) + (LABEL O 3) + (GLUE O 0 R 0.250000 R 0.0 R 0.250000) + (GLUE O 1 R 0.250000 R 0.0 R 0.250000) + (GLUE O 2 R 0.250000 R 0.0 R 0.250000) + (GLUE O 3 R 0.500000 R 0.0 R 0.250000) + (GLUE O 4 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 4) + (GLUE O 0 R 0.500000 R 0.0 R 0.0) + (GLUE O 1 R 0.500000 R 0.0 R 0.0) + (GLUE O 3 R 0.750000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.0) + (STOP) + (LABEL O 5) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (KRN O 5 R 0.0) + (STOP) + ) +(CHARSINTYPE O 1 + ‘ “ ( 〔 [ { 〈 《 「 『 + 【 + UFF5F U3018 U3016 U301D + ) +(CHARSINTYPE O 2 + 、 , ’ ” ) 〕 ] } 〉 》 + 」 』 】 + UFF60 U3019 U3017 U301F + ) +(CHARSINTYPE O 3 + ・ : ; + ) +(CHARSINTYPE O 4 + 。 . + ) +(CHARSINTYPE O 5 + — ― … ‥ + ) +(TYPE O 0 + (CHARWD R 1.000000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 1 + (CHARWD R 0.500000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 2 + (CHARWD R 0.500000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 0 R 0.500000 R 0.0 R 0.500000) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.500000) + ) + ) +(TYPE O 3 + (CHARWD R 0.500000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 0 R 0.250000 R 0.0 R 0.250000) + (GLUE O 1 R 0.250000 R 0.0 R 0.250000) + (GLUE O 2 R 0.250000 R 0.0 R 0.250000) + (GLUE O 3 R 0.500000 R 0.0 R 0.250000) + (GLUE O 4 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 4 + (CHARWD R 0.500000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 0 R 0.500000 R 0.0 R 0.0) + (GLUE O 1 R 0.500000 R 0.0 R 0.0) + (GLUE O 3 R 0.750000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.0) + ) + ) +(TYPE O 5 + (CHARWD R 1.000000) + (CHARHT R 0.880000) + (CHARDP R 0.120000) + (COMMENT + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (KRN O 5 R 0.0) + ) + ) diff --git a/zhmetrics-uptex/upzhm-v.pl b/zhmetrics-uptex/upzhm-v.pl new file mode 100644 index 00000000..d2c1efe6 --- /dev/null +++ b/zhmetrics-uptex/upzhm-v.pl @@ -0,0 +1,135 @@ +(COMMENT Chinese Font Metrics for upTeX Vertical Typesetting) +(DIRECTION TATE) +(FAMILY UPZHM HANZI) +(FACE F MRR) +(CODINGSCHEME TEX KANJI TEXT) +(DESIGNSIZE R 10.0) +(COMMENT DESIGNSIZE IS IN POINTS) +(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) +(CHECKSUM O 0) +(FONTDIMEN + (SLANT R 0.0) + (SPACE R 0.0) + (STRETCH R 0.100000) + (SHRINK R 0.0) + (XHEIGHT R 1.000000) + (QUAD R 1.000000) + (EXTRASPACE R 0.250000) + (EXTRASTRETCH R 0.200000) + (EXTRASHRINK R 0.125000) + ) +(GLUEKERN + (LABEL O 0) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 1) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 2) + (GLUE O 0 R 0.500000 R 0.0 R 0.500000) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.500000) + (STOP) + (LABEL O 3) + (GLUE O 0 R 0.250000 R 0.0 R 0.250000) + (GLUE O 1 R 0.250000 R 0.0 R 0.250000) + (GLUE O 2 R 0.250000 R 0.0 R 0.250000) + (GLUE O 3 R 0.500000 R 0.0 R 0.250000) + (GLUE O 4 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.250000 R 0.0 R 0.250000) + (STOP) + (LABEL O 4) + (GLUE O 0 R 0.500000 R 0.0 R 0.0) + (GLUE O 1 R 0.500000 R 0.0 R 0.0) + (GLUE O 3 R 0.750000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.0) + (STOP) + (LABEL O 5) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (KRN O 5 R 0.0) + (STOP) + ) +(CHARSINTYPE O 1 + ‘ “ ( 〔 [ { 〈 《 「 『 + 【 + UFF5F U3018 U3016 U301D + ) +(CHARSINTYPE O 2 + 、 , ’ ” ) 〕 ] } 〉 》 + 」 』 】 + UFF60 U3019 U3017 U301F + ) +(CHARSINTYPE O 3 + ・ : ; + ) +(CHARSINTYPE O 4 + 。 . + ) +(CHARSINTYPE O 5 + — ― … ‥ + ) +(TYPE O 0 + (CHARWD R 1.000000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 1 + (CHARWD R 0.500000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 2 + (CHARWD R 0.500000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 0 R 0.500000 R 0.0 R 0.500000) + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.500000) + ) + ) +(TYPE O 3 + (CHARWD R 0.500000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 0 R 0.250000 R 0.0 R 0.250000) + (GLUE O 1 R 0.250000 R 0.0 R 0.250000) + (GLUE O 2 R 0.250000 R 0.0 R 0.250000) + (GLUE O 3 R 0.500000 R 0.0 R 0.250000) + (GLUE O 4 R 0.250000 R 0.0 R 0.250000) + (GLUE O 5 R 0.250000 R 0.0 R 0.250000) + ) + ) +(TYPE O 4 + (CHARWD R 0.500000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 0 R 0.500000 R 0.0 R 0.0) + (GLUE O 1 R 0.500000 R 0.0 R 0.0) + (GLUE O 3 R 0.750000 R 0.0 R 0.250000) + (GLUE O 5 R 0.500000 R 0.0 R 0.0) + ) + ) +(TYPE O 5 + (CHARWD R 1.000000) + (CHARHT R 0.500000) + (CHARDP R 0.500000) + (COMMENT + (GLUE O 1 R 0.500000 R 0.0 R 0.500000) + (GLUE O 3 R 0.250000 R 0.0 R 0.250000) + (KRN O 5 R 0.0) + ) + ) From 8727412851c406763ee8ccd03167e86a330bf050 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sun, 17 Apr 2016 21:34:48 +0800 Subject: [PATCH 05/20] typo --- zhmetrics-uptex/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhmetrics-uptex/README.md b/zhmetrics-uptex/README.md index 0b5130d0..0fe64d19 100644 --- a/zhmetrics-uptex/README.md +++ b/zhmetrics-uptex/README.md @@ -12,4 +12,4 @@ Run: -`texlua buld.lua` \ No newline at end of file +`texlua build.lua` \ No newline at end of file From 13aa8510db910707a7ac388b11ddc102f53002d5 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Mon, 18 Apr 2016 00:25:22 +0800 Subject: [PATCH 06/20] =?UTF-8?q?ctex:=20=E4=BD=BF=E7=94=A8=20.fd=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=BA=20upLaTeX=20=E5=AE=9A=E4=B9=89=20JY?= =?UTF-8?q?2=20=E5=92=8C=20JT2=20=E7=BC=96=E7=A0=81=E7=9A=84=20rm=E3=80=81?= =?UTF-8?q?sf=E3=80=81tt=20=E4=B8=89=E4=B8=AA=E5=AD=97=E4=BD=93=E6=97=8F?= =?UTF-8?q?=E3=80=82=20=E5=AD=97=E4=BD=93=E4=BD=BF=E7=94=A8=20zhmetrics-up?= =?UTF-8?q?tex=20=E4=B8=AD=E7=9A=84=20JFM=E3=80=81JVF=E3=80=82=20=E4=B8=BA?= =?UTF-8?q?=20Windows=20=E8=AE=BE=E7=BD=AE=E5=AD=97=E4=BD=93=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #159 --- ctex/ctex.dtx | 152 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 100 insertions(+), 52 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 4fe4c3aa..7dddca18 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -94,6 +94,12 @@ This package consists of the file ctex.dtx, and the derived files c70rm.fd, c70sf.fd, c70tt.fd, + jy2rm.fd, + jy2sf.fd, + jy2tt.fd, + jt2rm.fd, + jt2sf.fd, + jt2tt.fd, ctex-fontset-windows.def, ctex-fontset-windowsnew.def, ctex-fontset-windowsold.def, @@ -239,6 +245,12 @@ This package consists of the file ctex.dtx, and the derived files c70rm.fd, c70sf.fd, c70tt.fd, + jy2rm.fd, + jy2sf.fd, + jy2tt.fd, + jt2rm.fd, + jt2sf.fd, + jt2tt.fd, ctex-fontset-windows.def, ctex-fontset-windowsnew.def, ctex-fontset-windowsold.def, @@ -309,6 +321,12 @@ This package consists of the file ctex.dtx, and the derived files \file{c70rm.fd} {\from{\jobname.dtx}{rm,c70}} \file{c70sf.fd} {\from{\jobname.dtx}{sf,c70}} \file{c70tt.fd} {\from{\jobname.dtx}{tt,c70}} + \file{jy2rm.fd} {\from{\jobname.dtx}{rm,jy2}} + \file{jy2sf.fd} {\from{\jobname.dtx}{sf,jy2}} + \file{jy2tt.fd} {\from{\jobname.dtx}{tt,jy2}} + \file{jt2rm.fd} {\from{\jobname.dtx}{rm,jt2}} + \file{jt2sf.fd} {\from{\jobname.dtx}{sf,jt2}} + \file{jt2tt.fd} {\from{\jobname.dtx}{tt,jt2}} \file{ctex-fontset-windows.def} {\from{\jobname.dtx}{fontset,windows}} \file{ctex-fontset-windowsnew.def} {\from{\jobname.dtx}{fontset,windowsnew}} \file{ctex-fontset-windowsold.def} {\from{\jobname.dtx}{fontset,windowsold}} @@ -421,12 +439,12 @@ This package consists of the file ctex.dtx, and the derived files \fi % %<*!(readme|install|zhmap|spa)> -%<*!(c19|c70|ctexspa|dict)> +%<*!(c19|c70|jy2|jt2|ctexspa|dict)> %<*driver|class|style|ctexcap|ctexhook|ctexpatch> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} % -%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion +%<.!(readme|install|zhmap|spa|c19|c70|jy2|jt2|ctexspa)>\ctexPutVersion %<*driver> \InputIfFileExists{ctex.ver}{}{ \def\ctexGetVersionInfo{\GetIdInfo$Id$}} @@ -519,17 +537,23 @@ This package consists of the file ctex.dtx, and the derived files % {Ubuntu fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-ubuntu.def} {\ExplFileDate}{2.4}{\ExplFileDescription} -% +% %\ProvidesFile{c19rm.fd}% %\ProvidesFile{c19sf.fd}% %\ProvidesFile{c19tt.fd}% %\ProvidesFile{c70rm.fd}% %\ProvidesFile{c70sf.fd}% %\ProvidesFile{c70tt.fd}% +%\ProvidesFile{jy2rm.fd}% +%\ProvidesFile{jy2sf.fd}% +%\ProvidesFile{jy2tt.fd}% +%\ProvidesFile{jt2rm.fd}% +%\ProvidesFile{jt2sf.fd}% +%\ProvidesFile{jt2tt.fd}% %\ProvidesFile{ctexspa.def}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -% [2016/02/02 v2.3 Chinese font definition (CTEX)] +% [2016/02/02 v2.3 Chinese font definition (CTEX)] % [2016/02/02 v2.3 Space info for CJKpunct (CTEX)] % [2016/02/20 v1.0 Chinese translation for theorem name (CTEX)] % @@ -822,7 +846,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5421} +% \CheckSum{5460} % % \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 @@ -5790,38 +5814,15 @@ This package consists of the file ctex.dtx, and the derived files % % \changes{v2.?}{2016/02/28}{初步支持 \upLaTeX。} ^^A FIXME % -% \upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别表示横排与直排的日文。 -% 这里暂时不写 |.fd| 文件,直接定义宋体和黑体。 -% \begin{macrocode} -\DeclareKanjiFamily{JY2}{rm}{} -\DeclareRelationFont{JY2}{rm}{m}{}{T1}{cmr}{m}{} -\DeclareRelationFont{JY2}{rm}{bx}{}{T1}{cmr}{bx}{} -\DeclareFontShape{JY2}{rm}{m}{n}{<-> upschrm-h}{} -\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upschgt-h}{} -\DeclareKanjiFamily{JY2}{sf}{} -\DeclareRelationFont{JY2}{sf}{m}{}{T1}{cmss}{m}{} -\DeclareRelationFont{JY2}{sf}{bx}{}{T1}{cmss}{bx}{} -\DeclareFontShape{JY2}{sf}{m}{n}{<-> upschgt-h}{} -\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upschgt-h}{} -\DeclareKanjiFamily{JT2}{rm}{} -\DeclareRelationFont{JT2}{rm}{m}{}{T1}{cmr}{m}{} -\DeclareRelationFont{JT2}{rm}{bx}{}{T1}{cmr}{bx}{} -\DeclareFontShape{JT2}{rm}{m}{n}{<-> upschrm-v}{} -\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upschgt-v}{} -\DeclareKanjiFamily{JT2}{sf}{} -\DeclareRelationFont{JT2}{sf}{m}{}{T1}{cmss}{m}{} -\DeclareRelationFont{JT2}{sf}{bx}{}{T1}{cmss}{bx}{} -\DeclareFontShape{JT2}{sf}{m}{n}{<-> upschgt-v}{} -\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upschgt-v}{} -% \end{macrocode} -% % 按 \pkg{CJK} 的命名习惯模拟部分命令,并设置默认字体。 % \begin{macrocode} \tl_set:Nn \CJKrmdefault { rm } \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 } } \NewDocumentCommand \CJKfamily { m } { \kanjifamily { #1 } @@ -8802,17 +8803,18 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{传统定义方式} % % \begin{macrocode} -%<*c19|c70> +%<*c19|c70|jy2|jt2> %% %% Chinese characters %% %%% character set: GBK (extension of GB 2312) -%%% character set: Unicode +%%% character set: Unicode %% font encoding: Unicode %% -% +% % \end{macrocode} % +% \pkg{CJK} 宏包使用的字体族。 % \begin{macrocode} %\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne} %\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne} @@ -8822,6 +8824,19 @@ This package consists of the file ctex.dtx, and the derived files %\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne} % \end{macrocode} % +% \changes{v2.?}{2016/04/17}{提供 \upLaTeX{} 的 NFSS 字体定义。} ^^A FIXME +% \upTeX{} 使用的字体族。\upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别 +% 表示横排与直排的日文。 +% \begin{macrocode} +%\DeclareKanjiFamily{JY2}{rm}{} +%\DeclareKanjiFamily{JY2}{sf}{} +%\DeclareKanjiFamily{JY2}{tt}{} +%\DeclareKanjiFamily{JT2}{rm}{} +%\DeclareKanjiFamily{JT2}{sf}{} +%\DeclareKanjiFamily{JT2}{tt}{} +% \end{macrocode} +% +% % \begin{macrocode} %<*rm> %<*c19> @@ -8846,6 +8861,16 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{rm}{b}{it}{<-> CJKb * unikai}{\CJKbold} \DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * unikai}{\CJKbold} % +%<*jy2> +\DeclareFontShape{JY2}{rm}{m}{n}{<-> upzhserif-h}{} +\DeclareFontShape{JY2}{rm}{m}{it}{<-> upzhserifit-h}{} +\DeclareFontShape{JY2}{rm}{bx}{n}{<-> upzhserifb-h}{} +% +%<*jt2> +\DeclareFontShape{JT2}{rm}{m}{n}{<-> upzhserif-v}{} +\DeclareFontShape{JT2}{rm}{m}{it}{<-> upzhserifit-v}{} +\DeclareFontShape{JT2}{rm}{bx}{n}{<-> upzhserifb-v}{} +% % % \end{macrocode} % @@ -8873,6 +8898,14 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{sf}{b}{it}{<-> CJKb * uniyou}{\CJKbold} \DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold} % +%<*jy2> +\DeclareFontShape{JY2}{sf}{m}{n}{<-> upzhsans-h}{} +\DeclareFontShape{JY2}{sf}{bx}{n}{<-> upzhsansb-h}{} +% +%<*jt2> +\DeclareFontShape{JT2}{sf}{m}{n}{<-> upzhsans-v}{} +\DeclareFontShape{JT2}{sf}{bx}{n}{<-> upzhsansb-v}{} +% % % \end{macrocode} % @@ -8900,6 +8933,8 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{tt}{b}{it}{<-> CJKb * unifs}{\CJKbold} \DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold} % +%\DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} +%\DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} % % \end{macrocode} % @@ -8922,7 +8957,18 @@ This package consists of the file ctex.dtx, and the derived files % % 旧的 Windows 字体设置使用黑体作为无衬线体,楷体和仿宋是 GB2312 编码;新的 % Windows 字体设置使用微软雅黑作为无衬线体,楷体和仿宋是大字库。 +% Windows 8 以后,微软雅黑由原来的 \file{.ttf} 后缀改为 \file{.ttc} 后缀,需要 +% 加以区分。 % \begin{macrocode} +%<*windowsnew> +\tl_new:N \l_@@_msyh_suffix +\tl_set:Nn \l_@@_msyh_suffix { .ttc } +\file_if_exist:nF { C:/Windows/Fonts/msyh.ttc } + { + \file_if_exist:nF { msyh.ttc } + { \tl_set:Nn \l_@@_msyh_suffix { .ttf } } + } +% %<*windowsnew|windowsold> \sys_if_engine_pdftex:TF { @@ -8935,22 +8981,10 @@ This package consists of the file ctex.dtx, and the derived files \setCJKsansfont { simhei.ttf } \ctex_punct_map_family:nn { \CJKsfdefault } { zhhei } % -% \end{macrocode} -% Windows 8 以后,微软雅黑由原来的 \file{.ttf} 后缀改为 \file{.ttc} 后缀,需要 -% 加以区分。 -% \begin{macrocode} %<*windowsnew> - \file_if_exist:nTF { C:/Windows/Fonts/msyh.ttc } - { - \setCJKsansfont [ BoldFont = msyhbd.ttc ] { msyh.ttc } - \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd.ttc ] { msyh.ttc } - } - { - \setCJKsansfont [ BoldFont = msyhbd.ttf ] { msyh.ttf } - \setCJKfamilyfont { zhyahei } - [ BoldFont = msyhbd.ttf ] { msyh.ttf } - } + \setCJKsansfont [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } + \setCJKfamilyfont { zhyahei } + [ BoldFont = msyhbd\l_@@_msyh_suffix ] { msyh\l_@@_msyh_suffix } \ctex_punct_map_family:nn { \CJKsfdefault } { zhyahei } \ctex_punct_map_bfseries:nn { \CJKsfdefault , zhyahei } { zhyaheib } % @@ -8984,10 +9018,24 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_set_zhmap:n { - \special{ pdf:mapline~ upstsl-h~ UniGB-UTF16-H~ simsun.ttc } - \special{ pdf:mapline~ upstsl-v~ UniGB-UTF16-V~ simsun.ttc } - \special{ pdf:mapline~ upstht-h~ UniGB-UTF16-H~ simhei.ttf } - \special{ pdf:mapline~ upstht-v~ UniGB-UTF16-V~ simhei.ttf } + \special{ pdf:mapline~ upserif-h~ UniGB-UTF16-H~ simsun.ttc } + \special{ pdf:mapline~ upserif-v~ UniGB-UTF16-V~ simsun.ttc } + \special{ pdf:mapline~ upserifit-h~ UniGB-UTF16-H~ simkai.ttf } + \special{ pdf:mapline~ upserifit-v~ UniGB-UTF16-V~ simkai.ttf } + \special{ pdf:mapline~ upserifb-h~ UniGB-UTF16-H~ simhei.ttf } + \special{ pdf:mapline~ upserifb-v~ UniGB-UTF16-V~ simhei.ttf } +%<*windowsnew> + \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ msyh\l_@@_msyh_suffix } + \special{ pdf:mapline~ upsans-v~ UniGB-UTF16-V~ msyh\l_@@_msyh_suffix } + \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ msyhbd\l_@@_msyh_suffix } + \special{ pdf:mapline~ upsansb-v~ UniGB-UTF16-V~ msyhbd\l_@@_msyh_suffix } +% +%<*windowsold> + \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ simhei.ttf } + \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ simhei.ttf } +% + \special{ pdf:mapline~ upmono-h~ UniGB-UTF16-H~ simfang.ttf } + \special{ pdf:mapline~ upmono-v~ UniGB-UTF16-V~ simfang.ttf } } } { From 2639aa81e93c2ca1e9ba874737bcb6dbc4832c5b Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Mon, 18 Apr 2016 01:31:19 +0800 Subject: [PATCH 07/20] =?UTF-8?q?ctex:=20=E4=B8=BA=20upTeX=20=E8=A1=A5?= =?UTF-8?q?=E5=AE=8C=E5=90=84=E4=B8=AA=E5=AD=97=E4=BD=93=E9=9B=86=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E3=80=82=20=E5=9C=A8=20Windows=20=E4=B8=8B?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BA=86=20windowsnew,=20windowsold,=20found?= =?UTF-8?q?er,=20adobe,=20fandol=20=E5=AD=97=E4=BD=93=E9=9B=86=E3=80=82=20?= =?UTF-8?q?=E6=9C=AA=E6=B5=8B=E8=AF=95=20ubuntu,=20mac=20=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E9=9B=86=E3=80=82=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 214 +++++++++++++++++++++++++++++++------------------- 1 file changed, 135 insertions(+), 79 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 7dddca18..4999b60f 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -846,7 +846,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5460} +% \CheckSum{5472} % % \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 @@ -3890,6 +3890,22 @@ This package consists of the file ctex.dtx, and the derived files % % \subsubsection{\pkg{ctex-engine-pdftex.def}} % +% \begin{macro}[int]{\ctex_set_zhmap:n} +% 设置 \upTeX{} 字体映射,同时作用于 \tn{AtBeginDvi} 与 +% \tn{AtBeginShipoutFirst}。该宏对 \pdfTeX{} 和 \upTeX{} 均有用。 +% \begin{macrocode} +%<*pdftex|uptex> +\cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 + { + \AtBeginDvi { #1 } + \ctex_at_end_package:nn { atbegshi } + { \AtBeginShipoutFirst { #1 } } + } +\@onlypreamble \ctex_set_zhmap:n +% +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %<*pdftex> % \end{macrocode} @@ -3991,9 +4007,7 @@ This package consists of the file ctex.dtx, and the derived files \tl_set:Nn \CJKrmdefault {#1} \tl_set:Nn \CJKsfdefault {#2} \tl_set:Nn \CJKttdefault {#3} - \AtBeginDvi { \file_input:n {#4} } - \ctex_at_end_package:nn { atbegshi } - { \AtBeginShipoutFirst { \file_input:n {#4} } } + \ctex_set_zhmap:n { \file_input:n {#4} } } \@onlypreamble \ctex_load_zhmap:nnnn % \end{macrocode} @@ -5840,16 +5854,29 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\ctex_set_zhmap:n} -% 设置字体映射,同时作用于 \tn{AtBeginDvi} 与 \tn{AtBeginShipoutFirst}。 +% \begin{macro}[int]{\ctex_set_upmap:nnnnnn} +% 设置 \upTeX{} 字体映射,按 \pkg{zhmetrics-uptex} 的定义,依次设置衬线体正、 +% 斜、粗,无衬线体正、粗,等宽体正——共 6 种字体,并分横排及直排。 % \begin{macrocode} -\cs_new_protected_nopar:Npn \ctex_set_zhmap:n #1 +\cs_new_protected_nopar:Npn \ctex_set_upmap:nnnnnn #1 #2 #3 #4 #5 #6 { - \AtBeginDvi { #1 } - \ctex_at_end_package:nn { atbegshi } - { \AtBeginShipoutFirst { #1 } } + \ctex_set_zhmap:n + { + \special{ pdf:mapline~ upserif-h~ UniGB-UTF16-H~ #1 } + \special{ pdf:mapline~ upserif-v~ UniGB-UTF16-V~ #1 } + \special{ pdf:mapline~ upserifit-h~ UniGB-UTF16-H~ #2 } + \special{ pdf:mapline~ upserifit-v~ UniGB-UTF16-V~ #2 } + \special{ pdf:mapline~ upserifb-h~ UniGB-UTF16-H~ #3 } + \special{ pdf:mapline~ upserifb-v~ UniGB-UTF16-V~ #3 } + \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ #4 } + \special{ pdf:mapline~ upsans-v~ UniGB-UTF16-V~ #4 } + \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ #5 } + \special{ pdf:mapline~ upsansb-v~ UniGB-UTF16-V~ #5 } + \special{ pdf:mapline~ upmono-h~ UniGB-UTF16-H~ #6 } + \special{ pdf:mapline~ upmono-v~ UniGB-UTF16-V~ #6 } + } } -\@onlypreamble \ctex_set_zhmap:n +\@onlypreamble \ctex_set_upmap:nnnnnn % \end{macrocode} % \end{macro} % @@ -9016,27 +9043,11 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_zhmap:n - { - \special{ pdf:mapline~ upserif-h~ UniGB-UTF16-H~ simsun.ttc } - \special{ pdf:mapline~ upserif-v~ UniGB-UTF16-V~ simsun.ttc } - \special{ pdf:mapline~ upserifit-h~ UniGB-UTF16-H~ simkai.ttf } - \special{ pdf:mapline~ upserifit-v~ UniGB-UTF16-V~ simkai.ttf } - \special{ pdf:mapline~ upserifb-h~ UniGB-UTF16-H~ simhei.ttf } - \special{ pdf:mapline~ upserifb-v~ UniGB-UTF16-V~ simhei.ttf } -%<*windowsnew> - \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ msyh\l_@@_msyh_suffix } - \special{ pdf:mapline~ upsans-v~ UniGB-UTF16-V~ msyh\l_@@_msyh_suffix } - \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ msyhbd\l_@@_msyh_suffix } - \special{ pdf:mapline~ upsansb-v~ UniGB-UTF16-V~ msyhbd\l_@@_msyh_suffix } -% -%<*windowsold> - \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ simhei.ttf } - \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ simhei.ttf } -% - \special{ pdf:mapline~ upmono-h~ UniGB-UTF16-H~ simfang.ttf } - \special{ pdf:mapline~ upmono-v~ UniGB-UTF16-V~ simfang.ttf } - } + \ctex_set_upmap:nnnnnn + {simsun.ttc} {simkai.ttf} {simhei.ttf} +% {msyh\l_@@_msyh_suffix} {msyhbd\l_@@_msyh_suffix} +% {simhei.ttf} {simhei.ttf} + {simfang.ttf} } { %<*windowsold> @@ -9119,17 +9130,26 @@ This package consists of the file ctex.dtx, and the derived files } } { - \setCJKmainfont - [ - BoldFont = AdobeHeitiStd-Regular , - ItalicFont = AdobeKaitiStd-Regular - ] { AdobeSongStd-Light } - \setCJKsansfont { AdobeHeitiStd-Regular} - \setCJKmonofont { AdobeFangsongStd-Regular} - \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } - \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } - \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } - \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + \sys_if_engine_uptex:TF + { + \ctex_set_upmap:nnnnnn + {AdobeSongStd-Light.otf} {AdobeKaitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} + {AdobeHeitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} + {AdobeFangsongStd-Regular.otf} + } + { + \setCJKmainfont + [ + BoldFont = AdobeHeitiStd-Regular , + ItalicFont = AdobeKaitiStd-Regular + ] { AdobeSongStd-Light } + \setCJKsansfont { AdobeHeitiStd-Regular} + \setCJKmonofont { AdobeFangsongStd-Regular} + \setCJKfamilyfont { zhsong } { AdobeSongStd-Light } + \setCJKfamilyfont { zhhei } { AdobeHeitiStd-Regular } + \setCJKfamilyfont { zhfs } { AdobeFangsongStd-Regular } + \setCJKfamilyfont { zhkai } { AdobeKaitiStd-Regular } + } } % \end{macrocode} % @@ -9193,17 +9213,26 @@ This package consists of the file ctex.dtx, and the derived files } } { - \setCJKmainfont - [ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular ] - { FandolSong-Regular } - \setCJKsansfont [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } - \setCJKmonofont [ Extension = .otf ] { FandolFang-Regular } - \setCJKfamilyfont { zhsong } - [ Extension = .otf , BoldFont = FandolSong-Bold ] { FandolSong-Regular } - \setCJKfamilyfont { zhhei } - [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } - \setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular } - \setCJKfamilyfont { zhkai } [ Extension = .otf ] { FandolKai-Regular } + \sys_if_engine_uptex:TF + { + \ctex_set_upmap:nnnnnn + {FandolSong-Regular.otf} {FandolKai-Regular.otf} {FandolSong-Bold.otf} + {FandolHei-Regular.otf} {FandolHei-Bold.otf} + {FandolFang-Regular.otf} + } + { + \setCJKmainfont + [ Extension = .otf , BoldFont = FandolSong-Bold , ItalicFont = FandolKai-Regular ] + { FandolSong-Regular } + \setCJKsansfont [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } + \setCJKmonofont [ Extension = .otf ] { FandolFang-Regular } + \setCJKfamilyfont { zhsong } + [ Extension = .otf , BoldFont = FandolSong-Bold ] { FandolSong-Regular } + \setCJKfamilyfont { zhhei } + [ Extension = .otf , BoldFont = FandolHei-Bold ] { FandolHei-Regular } + \setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular } + \setCJKfamilyfont { zhkai } [ Extension = .otf ] { FandolKai-Regular } + } } % \end{macrocode} % @@ -9282,13 +9311,22 @@ This package consists of the file ctex.dtx, and the derived files \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } { - \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong } - \setCJKsansfont [ BoldFont = STHeiti ] { STXihei } - \setCJKmonofont { STFangsong } - \setCJKfamilyfont { zhsong } { STSong } - \setCJKfamilyfont { zhhei } { STHeiti } - \setCJKfamilyfont { zhfs } { STFangsong } - \setCJKfamilyfont { zhkai } { STKaiti } + \sys_if_engine_uptex:TF + { + \ctex_set_upmap:nnnnnn + { :3:Songti.ttc } { :2:Kaiti.ttc } { :1:Kaiti.ttc } + { \detokenize{华文细黑}.ttf } { \detokenize{华文黑体}.ttf } + { \detokenize{华文仿宋}.ttf } + } + { + \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong } + \setCJKsansfont [ BoldFont = STHeiti ] { STXihei } + \setCJKmonofont { STFangsong } + \setCJKfamilyfont { zhsong } { STSong } + \setCJKfamilyfont { zhhei } { STHeiti } + \setCJKfamilyfont { zhfs } { STFangsong } + \setCJKfamilyfont { zhkai } { STKaiti } + } } % \end{macrocode} % @@ -9333,8 +9371,16 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_fontset_error:n { founder } } } { - \setCJKmainfont - [ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 } + \sys_if_engine_uptex:TF + { + \ctex_set_upmap:nnnnnn + { FZSSK.TTF } { FZKTK.TTF } { FZXBSK.TTF } + { FZXH1K.TTF } { FZHTK.TTF } + { FZFSK.TTF } + } + { + \setCJKmainfont + [ BoldFont = FZXiaoBiaoSong-B05 , ItalicFont = FZKai-Z03 ] { FZShuSong-Z01 } % \end{macrocode} % % 在 WPS For Linux 附带的 5.00 版和家庭版 5.20 版的“方正细黑一\_GBK”的字体名称 @@ -9345,15 +9391,16 @@ This package consists of the file ctex.dtx, and the derived files % 遂采用汉字名称。由于 \pkg{luaotfload} 不支持汉字名称,故使用 Postscript 名字, % 速度不受影响。 % \begin{macrocode} - \setCJKsansfont [ BoldFont = FZHei-B01 ] - { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } } - \setCJKmonofont { FZFangSong-Z02 } - \setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 } - \setCJKfamilyfont { zhhei } { FZHei-B01 } - \setCJKfamilyfont { zhkai } { FZKai-Z03 } - \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } - \setCJKfamilyfont { zhli } { FZLiShu-S01 } - \setCJKfamilyfont { zhyou } [ BoldFont = FZZhunYuan-M02 ] { FZXiYuan-M01 } + \setCJKsansfont [ BoldFont = FZHei-B01 ] + { \sys_if_engine_xetex:TF { 方正细黑一_GBK } { FZXH1K--GBK1-0 } } + \setCJKmonofont { FZFangSong-Z02 } + \setCJKfamilyfont { zhsong } [ BoldFont = FZXiaoBiaoSong-B05 ] { FZShuSong-Z01 } + \setCJKfamilyfont { zhhei } { FZHei-B01 } + \setCJKfamilyfont { zhkai } { FZKai-Z03 } + \setCJKfamilyfont { zhfs } { FZFangSong-Z02 } + \setCJKfamilyfont { zhli } { FZLiShu-S01 } + \setCJKfamilyfont { zhyou } [ BoldFont = FZZhunYuan-M02 ] { FZXiYuan-M01 } + } } % \end{macrocode} % @@ -9401,13 +9448,22 @@ This package consists of the file ctex.dtx, and the derived files { \ctex_fontset_error:n { ubuntu } } } { - \setCJKmainfont - [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } - \setCJKsansfont { WenQuanYi~Zen~Hei } - \setCJKmonofont { AR~PL~UMing~CN } - \setCJKfamilyfont { zhsong } { AR~PL~UMing~CN } - \setCJKfamilyfont { zhhei } { WenQuanYi~Zen~Hei } - \setCJKfamilyfont { zhkai } { AR~PL~UKai~CN } + \sys_if_engine_uptex:TF + { + \ctex_set_upmap:nnnnnn + { uming.ttc } { ukai.ttc } { wqy-zenhei.ttc } + { wqy-zenhei.ttc } { wqy-zenhei.ttc } + { uming.ttc } + } + { + \setCJKmainfont + [ BoldFont = WenQuanYi~Zen~Hei , ItalicFont = AR~PL~UKai~CN ] { AR~PL~UMing~CN } + \setCJKsansfont { WenQuanYi~Zen~Hei } + \setCJKmonofont { AR~PL~UMing~CN } + \setCJKfamilyfont { zhsong } { AR~PL~UMing~CN } + \setCJKfamilyfont { zhhei } { WenQuanYi~Zen~Hei } + \setCJKfamilyfont { zhkai } { AR~PL~UKai~CN } + } } % \end{macrocode} % From a6d316b5934ce3bd8e5a89a4ae7783fb4482857a Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Mon, 18 Apr 2016 01:48:28 +0800 Subject: [PATCH 08/20] typo --- ctex/ctex.dtx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 4999b60f..1f3a7b28 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -407,6 +407,12 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* c70rm.fd *} \Msg{* c70sf.fd *} \Msg{* c70tt.fd *} +\Msg{* jy2rm.fd *} +\Msg{* jy2sf.fd *} +\Msg{* jy2tt.fd *} +\Msg{* jt2rm.fd *} +\Msg{* jt2sf.fd *} +\Msg{* jt2tt.fd *} \Msg{* ctex-fontset-windows.def *} \Msg{* ctex-fontset-windowsnew.def *} \Msg{* ctex-fontset-windowsold.def *} From 61775f4c80cd34f72922a9655cc32362bfc2da59 Mon Sep 17 00:00:00 2001 From: Liam Huang Date: Mon, 18 Apr 2016 22:50:47 +0800 Subject: [PATCH 09/20] ctex-uptex: fix typo in uptex mac fontset. :1:Kaiti.ttc => :1:Songti.ttc --- ctex/ctex.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 1f3a7b28..bd18ab02 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -9320,7 +9320,7 @@ This package consists of the file ctex.dtx, and the derived files \sys_if_engine_uptex:TF { \ctex_set_upmap:nnnnnn - { :3:Songti.ttc } { :2:Kaiti.ttc } { :1:Kaiti.ttc } + { :3:Songti.ttc } { :2:Kaiti.ttc } { :1:Songti.ttc } { \detokenize{华文细黑}.ttf } { \detokenize{华文黑体}.ttf } { \detokenize{华文仿宋}.ttf } } From 5a7963790b7251056681e46681f063091f256b81 Mon Sep 17 00:00:00 2001 From: Liam Huang Date: Mon, 18 Apr 2016 23:22:21 +0800 Subject: [PATCH 10/20] =?UTF-8?q?ctex-uptex:=20uptex=20=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E8=AE=BE=E7=BD=AE=E5=9C=A8=20Mac=20=E4=B8=8A=E9=81=87?= =?UTF-8?q?=E5=88=B0=E4=BA=86=E5=92=8C=20pdfTeX=20=E5=90=8C=E6=A0=B7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 字体不可用,给出报错。 --- ctex/ctex.dtx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index bd18ab02..9e7b6be9 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -852,7 +852,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5472} +% \CheckSum{5469} % % \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 @@ -9313,17 +9313,14 @@ This package consists of the file ctex.dtx, and the derived files % 在 \pdfTeX{} 下生成的 PDF 只有方框^^A % \footnote{\url{http://www.newsmth.net/bbscon.php?bid=460&id=312640}}。 % 华文细黑和华文仿宋的情况类似。 +% 这确认为 \dvipdfmx{} 的 bug^^A +% \footnote{\url{https://github.com/clerkma/ptex-ng/blob/master/texk/libdpx/cidtype2.c#L597}}。 % \begin{macrocode} \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } { \sys_if_engine_uptex:TF - { - \ctex_set_upmap:nnnnnn - { :3:Songti.ttc } { :2:Kaiti.ttc } { :1:Songti.ttc } - { \detokenize{华文细黑}.ttf } { \detokenize{华文黑体}.ttf } - { \detokenize{华文仿宋}.ttf } - } + { \ctex_fontset_error:n { mac } } { \setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong } \setCJKsansfont [ BoldFont = STHeiti ] { STXihei } From 91689cd145d478b03fc6a71883f2199f5e8552af Mon Sep 17 00:00:00 2001 From: Qing Lee Date: Mon, 18 Apr 2016 23:40:38 +0800 Subject: [PATCH 11/20] =?UTF-8?q?ctex:=20=E5=A2=9E=E5=A4=A7=20\IndexMin?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 1 + 1 file changed, 1 insertion(+) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 9e7b6be9..0fbda61c 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -828,6 +828,7 @@ This package consists of the file ctex.dtx, and the derived files \textit{意大利体的数字表示描述对应索引项的页码; 带下划线的数字表示定义对应索引项的代码行号; 罗马字体的数字表示使用对应索引项的代码行号。}} +\setlength\IndexMin{.4\textheight} \usepackage{makecell} \newcommand{\bashcmd}{\texttt} \newcommand{\TeXLive}{\TeX\ Live} From 9255005bafbdda0b882041e95d98153c30fd5c34 Mon Sep 17 00:00:00 2001 From: Qing Lee Date: Tue, 19 Apr 2016 00:00:59 +0800 Subject: [PATCH 12/20] =?UTF-8?q?ctex-uptex:=20=E4=BF=AE=E6=AD=A3=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=EF=BC=8C=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AE=B0=E5=8F=B7=20#=20=E9=9C=80=E8=A6=81=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 0fbda61c..095a4472 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -9315,7 +9315,8 @@ This package consists of the file ctex.dtx, and the derived files % \footnote{\url{http://www.newsmth.net/bbscon.php?bid=460&id=312640}}。 % 华文细黑和华文仿宋的情况类似。 % 这确认为 \dvipdfmx{} 的 bug^^A -% \footnote{\url{https://github.com/clerkma/ptex-ng/blob/master/texk/libdpx/cidtype2.c#L597}}。 +% \begingroup\makeatletter\@makeother\#\@firstofone{\endgroup +% \footnote{\url{https://github.com/clerkma/ptex-ng/blob/master/texk/libdpx/cidtype2.c#L597}}}。 % \begin{macrocode} \sys_if_engine_pdftex:TF { \ctex_fontset_error:n { mac } } From 6e8bb5df665a43eefb02ac9d7b7f76e9411ca8eb Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 02:14:23 +0800 Subject: [PATCH 13/20] =?UTF-8?q?ctex:=20upTeX=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 66 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 095a4472..80c12c26 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -883,7 +883,7 @@ This package consists of the file ctex.dtx, and the derived files % 提供了汉字输出支持、标点压缩、字体字号命令、标题文字汉化、中文版式调整、数字 % 日期转换等支持功能,可适应论文、报告、书籍、幻灯片等不同类型的中文文档。 % -% \CTeX{} 宏集支持 \LaTeX{}、\pdfLaTeX{}、\XeLaTeX{} 和 \LuaLaTeX{} 等多种不同 +% \CTeX{} 宏集支持 \LaTeX、\pdfLaTeX、\XeLaTeX、\LuaLaTeX、\upLaTeX{} 等多种不同 % 的编译方式,并为它们提供了统一的界面。主要功能由宏包 \pkg{ctex} 和中文文档类 % \cls{ctexart}、\cls{ctexrep}、\cls{ctexbook} 和 \cls{ctexbeamer} 实现。 % \end{abstract} @@ -1051,7 +1051,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{document} % 中文文档类测试。你需要将所有源文件保存为 UTF-8 编码。 % -% 你可以使用 XeLaTeX 或 LuaLaTeX 编译,也可以使用 (pdf)LaTeX 编译。 +% 你可以使用 XeLaTeX、LuaLaTeX 或 upLaTeX 编译,也可以使用 (pdf)LaTeX 编译。 % 推荐使用 XeLaTeX 或 LuaLaTeX 编译。 % \end{document} % \end{ctexexam} @@ -1063,7 +1063,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{frame}{中文演示文档} % \begin{itemize} % \item 你需要将所有源文件保存为 UTF-8 编码 -% \item 你可以使用 XeLaTeX 或 LuaLaTeX 编译 +% \item 你可以使用 XeLaTeX、LuaLaTeX 或 upLaTeX 编译 % \item 也可以使用 (pdf)LaTeX 编译 % \item 推荐使用 XeLaTeX 或 LuaLaTeX 编译 % \end{itemize} @@ -1092,7 +1092,7 @@ This package consists of the file ctex.dtx, and the derived files % % \CTeX{} 宏集已经尽可能就中文的行文和版式习惯做了调整和配置,通常而言,这些配置 % 已经够用。因此,除非必要,我们不建议普通用户修改这些默认配置。如果你认为 \CTeX{} 宏集 -% 的默认配置还可以完善,可以在项目主页上 +% 的默认配置还可以完善,可以在项目主页上% % \href{https://github.com/CTeX-org/ctex-kit/issues}{提交 issue}, % 向我们反映,我们会酌情在后续版本中予以改进。 % @@ -1139,25 +1139,37 @@ This package consists of the file ctex.dtx, and the derived files % \subsection{编译方式} % \label{subs:compile} % -% \CTeX{} 宏集会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX 以及 -% \LuaLaTeX。},在底层选择不同的中文支持方式(见表 \ref{tab:chinese-support})。 +% \CTeX{} 宏集会根据用户使用的编译方式\footnote{\LaTeX、\pdfLaTeX、\XeLaTeX、 +% \LuaLaTeX{} 及 \upLaTeX。},在底层选择不同的中文支持方式(见 +% 表~\ref{tab:chinese-support})。 % % \begin{table}[htbp] % \centering +% \begin{threeparttable} % \caption{\CTeX{} 宏集的中文支持方式} -% \begin{tabular}{ccc} +% \label{tab:chinese-support} +% \begin{tabular}{ll} % \toprule -% (pdf)\LaTeX & \XeLaTeX & \LuaLaTeX \\ +% 编译方式 & 支持宏包 \\ % \midrule -% \pkg{CJK} & \pkg{xeCJK} & \pkg{LuaTeX-ja} \\ +% (pdf)\LaTeX & \pkg{CJK} \\ +% \XeLaTeX & \pkg{xeCJK} \\ +% \LuaLaTeX & \pkg{LuaTeX-ja} \\ +% \upLaTeX\tnote{*} & 原生 \\ % \bottomrule % \end{tabular} -% \label{tab:chinese-support} +% \smallskip +% \begin{tablenotes} +% \item[*] p\LaTeX-ng(或称 Ap\LaTeX)与 \upLaTeX{} 兼容。使用 p\LaTeX-ng 编译 +% 时,\pkg{ctex} 采用与 \upLaTeX{} 相同的设置。 +% \end{tablenotes} +% \end{threeparttable} % \end{table} % -% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 宏集的行为,比如宏包对编码的处理。 -% 在用户使用 \XeLaTeX{} 及 \LuaLaTeX{} 编译时,\CTeX{} 宏集使用(且仅能 -% 使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译 +% 不同的编译方式和中文支持方式会在一定程度上影响 \CTeX{} 宏集的行为,比如宏包对 +% 编码的处理。 +% 在用户使用 \XeLaTeX、\LuaLaTeX{} 及 \upLaTeX{} 编译时,\CTeX{} 宏集使用(且仅 +% 能使用)UTF-8 编码;而因为历史原因,在用户使用 \LaTeX{} 及 \pdfLaTeX{} 编译 % 时,宏包默认使用 GBK 编码。用户需要\emph{保证编译方式、 % 源文件编码、宏包编码选项三者一致}。 % 关于宏包编码选项,可以参考 \ref{subs:encoding}~节。 @@ -1171,10 +1183,10 @@ This package consists of the file ctex.dtx, and the derived files % \begin{function}[rEXP]{GBK, UTF8} % 指明编写文档时使用的编码格式。\CTeX{} 宏集无法检测用户编写文档时使用的编码格式,因此 % 需要用户自行指定编码。\emph{我们建议用户总是使用 UTF-8 编码,并显式指定 \opt{UTF8} -% 选项,并使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译。} +% 选项,并使用 \XeLaTeX、\LuaLaTeX{} 或 \upLaTeX{} 编译。} % -% 使用 \XeLaTeX{} 或 \LuaLaTeX{} 编译时,\CTeX{} 宏集强制使用 UTF-8 编码, -% 此时 \opt{GBK} 选项无效。 +% 使用 \XeLaTeX、\LuaLaTeX{} 或 \upLaTeX{} 编译时,\CTeX{} 宏集强制使用 UTF-8 +% 编码,此时 \opt{GBK} 选项无效。 % 使用 (pdf)\LaTeX{} 编译时,\CTeX{} 宏集默认启用 \opt{GBK} 选项;不过,用户也可以 % 显式声明 \opt{UTF8} 选项,使 \CTeX{} 宏集工作在 UTF-8 编码下。 % \end{function} @@ -1207,14 +1219,19 @@ This package consists of the file ctex.dtx, and the derived files % \makecell{\pkg{LuaTeX-ja}\\中易字库} & % \makecell{\pkg{LuaTeX-ja}\\Fandol 字库} \\ % \cmidrule(lr){1-5} -% \pdfLaTeX{} & 不可用 & +% \pdfLaTeX{} & 不可用\tnote{5} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} & -% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & 不可用 \\ +% \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & 不可用\tnote{5} \\ % \cmidrule(lr){1-5} -% \makecell{\LaTeX{} + \\\dvipdfmx{}} & 不可用 & +% \makecell{\LaTeX{} + \\\dvipdfmx{}} & 不可用\tnote{6} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库 + 微软雅黑} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\中易字库} & % \makecell{\pkg{CJK} + \pkg{zhmetrics}\\Fandol 字库} \\ +% \cmidrule(lr){1-5} +% \makecell{\upLaTeX{} + \\\dvipdfmx{}} & 不可用\tnote{6} & +% \makecell{\pkg{zhmetrics-uptex}\\中易字库 + 微软雅黑} & +% \makecell{\pkg{zhmetrics-uptex}\\中易字库} & +% \makecell{\pkg{zhmetrics-uptex}\\Fandol 字库} \\ % \bottomrule % \end{tabular} % \smallskip @@ -1225,6 +1242,8 @@ This package consists of the file ctex.dtx, and the derived files % 参见:\url{https://github.com/clerkma/fandol-fonts}。 % \item [4] \LuaLaTeX{} 编译时使用 \pkg{LuaTeX-ja} 宏包。对此, % 第 \ref{sec:lualatex-chinese}~节有特别说明。 +% \item [5] 受 \pdfTeX{} 的限制,无法嵌入 OpenType 字体。 +% \item [6] 目前受 \dvipdfmx{} 的限制,Mac OS X 系统上的黑体和仿宋无法读取。 % \end{tablenotes} % \end{threeparttable} % \end{table} @@ -1497,8 +1516,9 @@ This package consists of the file ctex.dtx, and the derived files % \end{ctexexam} % 则会得到“{\ctexset{space=auto}汉字 分词 技术 English}”。 % -% \emph{使用 \textup{\LuaLaTeX} 编译的时候,该选项无效:汉字间的空格以及汉字与西文字符 -% 之间的空格总是有效,不会被忽略,但可以自动忽略掉由换行产生的空格。} +% \emph{使用 \textup{\LuaLaTeX{} 及 \upLaTeX} 编译的时候,该选项无效:汉字间的 +% 空格以及汉字与西文字符之间的空格总是有效,不会被忽略,但可以自动忽略掉由换行 +% 产生的空格。} % % \begin{function}[rEXP,added=2014-04-23]{linespread} % \begin{syntax} @@ -3048,6 +3068,8 @@ This package consists of the file ctex.dtx, and the derived files % \item \pkg{luaotfload} 宏包,它还依赖 \pkg{luatexbase} 宏包。 % \end{itemize} % \item[\ding{229}] 以上是使用 \LuaLaTeX{} 编译时的依赖项。 +% \item \pkg{zhmetrics-uptex} 宏包。 +% \item[\ding{229}] 以上是使用 \upLaTeX{} 编译时的依赖项。 % \end{itemize} % % 出于一些原因,\pkg{zhmCJK} 尚未被收入 \TeXLive{} 和 \MiKTeX。因此,若 @@ -6314,7 +6336,7 @@ This package consists of the file ctex.dtx, and the derived files % 的特殊字体。在 \XeTeX{} 可以用 \tn{fontcharwd} 来改进。而在 \pdfTeX{} 下,若使用 % \pkg{zhmetrics} 技术,所有的汉字共享同一个 \file{.tfm},\tn{fontcharwd} 也就没有 % 意义。在 \LuaTeX{} 下,\pkg{LuaTeX-ja} 总是按照 JFM 中的设置输出汉字的宽度,可以 -% 直接用 \tn{zw} 作为汉字宽度。 +% 直接用 \tn{zw} 作为汉字宽度。\upTeX{} 可以直接使用原生的长度单位 |zw|。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_update_em_unit: % { \dim_set:Nn \ccwd { \f@size \p@ } } From 2e89b95a5b39148ebfae903548c50f04b9f1bc98 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 03:36:37 +0800 Subject: [PATCH 14/20] =?UTF-8?q?zhmetrics-uptex:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E3=80=81=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + zhmetrics-uptex/README.md | 53 +++++++++++++++++-- zhmetrics-uptex/build.lua | 65 +++++++++++++++++++++--- zhmetrics-uptex/upzhfandolfonts-test.tex | 22 +++++++- 4 files changed, 129 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index caeb74fe..983337b3 100644 --- a/.gitignore +++ b/.gitignore @@ -144,6 +144,8 @@ zhmetrics/zhmCJK-test.tex zhmetrics-uptex/*.tfm zhmetrics-uptex/*.vf zhmetrics-uptex/*.pdf +zhmetrics-uptex/tfm/* +zhmetrics-uptex/vf/* # zhnumber diff --git a/zhmetrics-uptex/README.md b/zhmetrics-uptex/README.md index 0fe64d19..c0eae7b8 100644 --- a/zhmetrics-uptex/README.md +++ b/zhmetrics-uptex/README.md @@ -2,14 +2,59 @@ ## Files -* `upzh*-{h,v}.tfm` are the JFM files used for upTeX. -* `upzh*-{h,v}.vf` are the virtual fonts used for output driver (dvipdfmx). -* `up*-{h,v}.tfm` are the PS TFM files used for output driver. +* `upzh*-{h,v}.tfm` are the JFM files used by upTeX. +* `upzh*-{h,v}.vf` are the virtual fonts used by the output driver (dvipdfmx). +* `up*-{h,v}.tfm` are the PS TFM files used by the output driver. * `upzhwinfonts.tex` contains the font mappings for Simplified Chinese version of Windows 8+. * `upzhwinfonts-test.tex` is a small LaTeX test file. +* `upzhm-{h,v}.pl` are the JPL source files used to produce JFM files. +* `build.lua` is the build script. ## Build Run: -`texlua build.lua` \ No newline at end of file +`texlua build.lua` + +## Contributing + +This font package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. + +Issues and pull requests are welcome. + +## Copyright and Licence + +Copyright (C) 2016 by Leo Liu + +This work 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. + +This work has the LPPL maintenance status `maintained'. + +The Current Maintainer of this work is Leo Liu. + +This work consists of the files + build.lua + upzhm-{h,v}.pl + upzhfandolfonts.tex + upzhfandolfongs-test.tex +and the derived files + upzhserif-{h,v}.tfm + upzhserifit-{h,v}.tfm + upzhserifb-{h,v}.tfm + upzhsans-{h,v}.tfm + upzhsnasb-{h,v}.tfm + upzhmono-{h,v}.tfm + upzhserif-{h,v}.vf + upzhserifit-{h,v}.vf + upzhserifb-{h,v}.vf + upzhsans-{h,v}.vf + upzhsnasb-{h,v}.vf + upzhmono-{h,v}.vf + upserif-{h,v}.tfm + upserifit-{h,v}.tfm + upserifb-{h,v}.tfm + upsans-{h,v}.tfm + upsnasb-{h,v}.tfm + upmono-{h,v}.tfm diff --git a/zhmetrics-uptex/build.lua b/zhmetrics-uptex/build.lua index b38881f3..a61868e6 100644 --- a/zhmetrics-uptex/build.lua +++ b/zhmetrics-uptex/build.lua @@ -1,16 +1,65 @@ #!/usr/bin/env texlua -dirs = {'h', 'v'} fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} pltopf = 'uppltotf -kanji=uptex' makejvf = 'makejvf -i -u gb' -for _, hv in pairs(dirs) do - for _, fnt in pairs(fonts) do - pl = string.format("upzhm-%s.pl", hv) - jfm = string.format('upzh%s-%s.tfm', fnt, hv) - pstfm = string.format('up%s-%s.tfm', fnt, hv) - os.execute(string.format("%s %s %s", pltopf, pl, jfm)) - os.execute(string.format("%s %s %s", makejvf, jfm, pstfm)) + +function unpack() + lfs.mkdir('tfm') + lfs.mkdir('vf') + for _, hv in pairs({'h', 'v'}) do + for _, fnt in pairs(fonts) do + pl = string.format("upzhm-%s.pl", hv) + jfm = string.format('upzh%s-%s.tfm', fnt, hv) + vf = string.format('upzh%s-%s.vf', fnt, hv) + pstfm = string.format('up%s-%s.tfm', fnt, hv) + os.execute(string.format("%s %s %s", pltopf, pl, jfm)) + os.execute(string.format("%s %s %s", makejvf, jfm, pstfm)) + os.rename(jfm, 'tfm/' .. jfm) + os.rename(vf, 'vf/' .. vf) + os.rename(pstfm, 'tfm/' .. pstfm) + end + end +end + +function tds() + tfmdir = 'fonts/tfm/zhmetrics-uptex' + vfdir = 'fonts/vf/zhmetrics-uptex' + texdir = 'tex/uptex/zhmetrics-uptex' + sourcedir = 'source/fonts/zhmetrics-uptex' + docdir = 'doc/fonts/zhmetrics-uptex' +-- TODO +-- lfs.mkdir(tfmdir) +-- lfs.mkdir(vfdir) +-- lfs.mkdir(texdir) +-- lfs.mkdir(sourcedir) +-- lfs.mkdir(docdir) +end + +function ctan() + zipname = 'zhmetric-uptex.zip' + os.execute('zip ' .. zipname .. ' README.md' .. + ' build.lua upzhm-h.pl upzhm-v.pl' .. + ' upzhfandolfonts.tex upzhfandolfonts-test.tex') + os.execute('zip -r ' .. zipname .. ' tfm/ vf/') +end + +function main(target) + if target == "unpack" then + unpack() + elseif target == "tds" then + tds() + elseif target == "ctan" then + unpack() + ctan() + else + print("Usage: " .. arg[0] .. " [unpack]") end end + +if arg[1] then + main(arg[1]) +else + main("ctan") +end diff --git a/zhmetrics-uptex/upzhfandolfonts-test.tex b/zhmetrics-uptex/upzhfandolfonts-test.tex index 92a36aba..b9568851 100644 --- a/zhmetrics-uptex/upzhfandolfonts-test.tex +++ b/zhmetrics-uptex/upzhfandolfonts-test.tex @@ -1,4 +1,10 @@ -\documentclass{article} +\documentclass{ujarticle} + +\usepackage[dvipdfm,a5paper,margin=1in]{geometry} +\newcommand\vertical{% + \clearpage + \newgeometry{width=\textheight,height=\textwidth,left=1in,top=1in}% + \tate} \font\rm=upzhserif-h \font\it=upzhserifit-h @@ -6,6 +12,12 @@ \font\sf=upzhsans-h \font\sfbf=upzhsansb-h \font\tt=upzhmono-h +\font\vrm=upzhserif-v +\font\vit=upzhserifit-v +\font\vbf=upzhserifb-v +\font\vsf=upzhsans-v +\font\vsfbf=upzhsansb-v +\font\vtt=upzhmono-v \AtBeginDvi{\input{upzhfandolfonts}} @@ -19,4 +31,12 @@ \par} } +\vertical + +\@for\fnt:=\vrm,\vit,\vbf,\vsf,\vsfbf,\vtt \do{% + {\fnt + 庄子曰:「吾生也有涯,而知也无涯。以有涯随无涯,殆已!已而为知者,殆而已矣! + 为善无近名,为恶无近刑,缘督以为经,可以保身,可以全生,可以养亲,可以尽年。」 + \par} +} \end{document} From 8c83d7d361f89100d57e71d8edc919919d07e5d0 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 14:59:38 +0800 Subject: [PATCH 15/20] =?UTF-8?q?zhmetrics-uptex:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=84=9A=E6=9C=AC=E5=8F=8A=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhmetrics-uptex/README.md | 30 ++++-- zhmetrics-uptex/build.lua | 131 +++++++++++++++++------ zhmetrics-uptex/upzhfandolfonts-test.tex | 2 +- zhmetrics-uptex/upzhfandolfonts.tex | 2 +- zhmetrics-uptex/upzhm-h.pl | 4 +- zhmetrics-uptex/upzhm-v.pl | 4 +- 6 files changed, 127 insertions(+), 46 deletions(-) diff --git a/zhmetrics-uptex/README.md b/zhmetrics-uptex/README.md index c0eae7b8..8aa1b4d6 100644 --- a/zhmetrics-uptex/README.md +++ b/zhmetrics-uptex/README.md @@ -1,28 +1,38 @@ -# zhmetrics-uptex: Chinese Font Metrics for upTeX +zhmetrics-uptex: Chinese Font Metrics for upTeX +=============================================== -## Files +Files +----- * `upzh*-{h,v}.tfm` are the JFM files used by upTeX. * `upzh*-{h,v}.vf` are the virtual fonts used by the output driver (dvipdfmx). * `up*-{h,v}.tfm` are the PS TFM files used by the output driver. -* `upzhwinfonts.tex` contains the font mappings for Simplified Chinese version of Windows 8+. -* `upzhwinfonts-test.tex` is a small LaTeX test file. +* `upzhfandolfonts.tex` contains the font mappings for Fandol fonts. +* `upzhfandolfonts-test.tex` is a small LaTeX test file. * `upzhm-{h,v}.pl` are the JPL source files used to produce JFM files. * `build.lua` is the build script. -## Build +Build +----- -Run: +* To create a TDS zip file, run: + ```shell + texlua build.lua tds + ``` +* To create a CTAN zip file, run: + ```shell + texlua build.lua ctan + ``` -`texlua build.lua` - -## Contributing +Contributing +------------ This font package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project. Issues and pull requests are welcome. -## Copyright and Licence +Copyright and Licence +--------------------- Copyright (C) 2016 by Leo Liu diff --git a/zhmetrics-uptex/build.lua b/zhmetrics-uptex/build.lua index a61868e6..c255c4eb 100644 --- a/zhmetrics-uptex/build.lua +++ b/zhmetrics-uptex/build.lua @@ -1,65 +1,136 @@ #!/usr/bin/env texlua -fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} -pltopf = 'uppltotf -kanji=uptex' -makejvf = 'makejvf -i -u gb' +-- zhmetrics-uptex v1.0 +-- Copyright (C) 2016 by Leo Liu +local fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} +local pltopf = 'uppltotf -kanji=uptex' +local makejvf = 'makejvf -i -u gb' + +function copyfile(path_src, path_dst) + local cp = 'cp -f' + if os.type == 'windows' then + cp = 'copy /y' + path_src = path_src:gsub('/', '\\') + path_dst = path_dst:gsub('/', '\\') + end + os.execute(cp .. ' ' .. path_src .. ' ' .. path_dst) +end + +function move(path_src, path_dst) + local mv = 'mv -f' + if os.type == 'windows' then + mv = 'move /y' + path_src = path_src:gsub('/', '\\') + path_dst = path_dst:gsub('/', '\\') + end + os.execute(mv .. ' ' .. path_src .. ' ' .. path_dst) +end + +function mkdir(dir) + if lfs.attributes(dir) ~= nil then + do return end + end + local md = 'mkdir -p' + if os.type == 'windows' then + md = 'mkdir' + dir = dir:gsub('/', '\\') + end + os.execute(md .. ' ' .. dir) +end + +function rmdir(dir) + if lfs.attributes(dir) == nil then + do return end + end + local rd = 'rm -r -f' + if os.type == windows then + rd = 'rmdir /s /q' + dir = dir:gsub('/', '\\') + end + os.execute(rd .. ' ' .. dir) +end function unpack() - lfs.mkdir('tfm') - lfs.mkdir('vf') + mkdir('tfm') + mkdir('vf') for _, hv in pairs({'h', 'v'}) do for _, fnt in pairs(fonts) do - pl = string.format("upzhm-%s.pl", hv) - jfm = string.format('upzh%s-%s.tfm', fnt, hv) - vf = string.format('upzh%s-%s.vf', fnt, hv) - pstfm = string.format('up%s-%s.tfm', fnt, hv) + local pl = string.format("upzhm-%s.pl", hv) + local jfm = string.format('upzh%s-%s.tfm', fnt, hv) + local vf = string.format('upzh%s-%s.vf', fnt, hv) + local pstfm = string.format('up%s-%s.tfm', fnt, hv) os.execute(string.format("%s %s %s", pltopf, pl, jfm)) os.execute(string.format("%s %s %s", makejvf, jfm, pstfm)) - os.rename(jfm, 'tfm/' .. jfm) - os.rename(vf, 'vf/' .. vf) - os.rename(pstfm, 'tfm/' .. pstfm) + move(jfm, 'tfm/' .. jfm) + move(vf, 'vf/' .. vf) + move(pstfm, 'tfm/' .. pstfm) end end end function tds() - tfmdir = 'fonts/tfm/zhmetrics-uptex' - vfdir = 'fonts/vf/zhmetrics-uptex' - texdir = 'tex/uptex/zhmetrics-uptex' - sourcedir = 'source/fonts/zhmetrics-uptex' - docdir = 'doc/fonts/zhmetrics-uptex' --- TODO --- lfs.mkdir(tfmdir) --- lfs.mkdir(vfdir) --- lfs.mkdir(texdir) --- lfs.mkdir(sourcedir) --- lfs.mkdir(docdir) + local tfmdir = 'tds/fonts/tfm/zhmetrics-uptex' + local vfdir = 'tds/fonts/vf/zhmetrics-uptex' + local texdir = 'tds/tex/uptex/zhmetrics-uptex' + local sourcedir = 'tds/source/fonts/zhmetrics-uptex' + local docdir = 'tds/doc/fonts/zhmetrics-uptex' + mkdir(tfmdir) + mkdir(vfdir) + mkdir(texdir) + mkdir(sourcedir) + mkdir(docdir) + for _, hv in pairs({'h', 'v'}) do + for _, fnt in pairs(fonts) do + local jfm = string.format('upzh%s-%s.tfm', fnt, hv) + local vf = string.format('upzh%s-%s.vf', fnt, hv) + local pstfm = string.format('up%s-%s.tfm', fnt, hv) + copyfile('tfm/' .. jfm, tfmdir .. '/' .. jfm) + copyfile('tfm/' .. pstfm, tfmdir .. '/' .. pstfm) + copyfile('vf/' .. vf, vfdir .. '/' .. vf) + end + local pl = string.format("upzhm-%s.pl", hv) + copyfile(pl, sourcedir .. '/' .. pl) + end + copyfile('build.lua', sourcedir .. '/build.lua') + copyfile('upzhfandolfonts.tex', texdir .. '/upzhfandolfonts.tex') + copyfile('README.md', docdir .. '/README.md') + copyfile('upzhfandolfonts-test.tex', docdir .. '/upzhfandolfonts-test.tex') + local tdszipname = 'zhmetrics-uptex.tds.zip' + lfs.chdir('tds') + os.execute('zip -r ' .. '../' .. tdszipname .. ' *') end function ctan() - zipname = 'zhmetric-uptex.zip' + local zipname = 'zhmetrics-uptex.zip' os.execute('zip ' .. zipname .. ' README.md' .. ' build.lua upzhm-h.pl upzhm-v.pl' .. ' upzhfandolfonts.tex upzhfandolfonts-test.tex') os.execute('zip -r ' .. zipname .. ' tfm/ vf/') end +function clean() + rmdir('tds') + rmdir('tfm') + rmdir('vf') + os.remove('zhmetrics-uptex.zip') + os.remove('zhmetrics-uptex.tds.zip') +end + function main(target) if target == "unpack" then unpack() elseif target == "tds" then + unpack() tds() elseif target == "ctan" then unpack() ctan() + elseif target == "clean" then + clean() else - print("Usage: " .. arg[0] .. " [unpack]") + print("Usage: " .. arg[0] .. " [unpack|tds|ctan|clean]") end end -if arg[1] then - main(arg[1]) -else - main("ctan") -end +main(arg[1]) diff --git a/zhmetrics-uptex/upzhfandolfonts-test.tex b/zhmetrics-uptex/upzhfandolfonts-test.tex index b9568851..d4cdd8b4 100644 --- a/zhmetrics-uptex/upzhfandolfonts-test.tex +++ b/zhmetrics-uptex/upzhfandolfonts-test.tex @@ -1,4 +1,4 @@ -\documentclass{ujarticle} +\documentclass{article} \usepackage[dvipdfm,a5paper,margin=1in]{geometry} \newcommand\vertical{% diff --git a/zhmetrics-uptex/upzhfandolfonts.tex b/zhmetrics-uptex/upzhfandolfonts.tex index 00eb699b..bee18645 100644 --- a/zhmetrics-uptex/upzhfandolfonts.tex +++ b/zhmetrics-uptex/upzhfandolfonts.tex @@ -1,4 +1,4 @@ -% Fandol 字体映射 +% Fandol font mapping for dvipdfmx \special{pdf:mapline upserif-h UniGB-UTF16-H FandolSong-Regular.otf} \special{pdf:mapline upserifit-h UniGB-UTF16-H FandolKai-Regular.otf} diff --git a/zhmetrics-uptex/upzhm-h.pl b/zhmetrics-uptex/upzhm-h.pl index bf6bfdbf..48f3f4f4 100644 --- a/zhmetrics-uptex/upzhm-h.pl +++ b/zhmetrics-uptex/upzhm-h.pl @@ -55,12 +55,12 @@ (CHARSINTYPE O 1 ‘ “ ( 〔 [ { 〈 《 「 『 【 - UFF5F U3018 U3016 U301D + UFF5F U3018 U3016 U301D ) (CHARSINTYPE O 2 、 , ’ ” ) 〕 ] } 〉 》 」 』 】 - UFF60 U3019 U3017 U301F + UFF60 U3019 U3017 U301F ) (CHARSINTYPE O 3 ・ : ; diff --git a/zhmetrics-uptex/upzhm-v.pl b/zhmetrics-uptex/upzhm-v.pl index d2c1efe6..53d04f3a 100644 --- a/zhmetrics-uptex/upzhm-v.pl +++ b/zhmetrics-uptex/upzhm-v.pl @@ -55,12 +55,12 @@ (CHARSINTYPE O 1 ‘ “ ( 〔 [ { 〈 《 「 『 【 - UFF5F U3018 U3016 U301D + UFF5F U3018 U3016 U301D ) (CHARSINTYPE O 2 、 , ’ ” ) 〕 ] } 〉 》 」 』 】 - UFF60 U3019 U3017 U301F + UFF60 U3019 U3017 U301F ) (CHARSINTYPE O 3 ・ : ; From 654087ee40232768df86dc04e04927af3393076b Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 16:31:02 +0800 Subject: [PATCH 16/20] =?UTF-8?q?zhmetrics-uptex:=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=84=9A=E6=9C=AC=E5=92=8C=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhmetrics-uptex/README.md | 28 ++++--- zhmetrics-uptex/build.lua | 110 +++++++++++++++------------- zhmetrics-uptex/makemetrics.lua | 19 +++++ zhmetrics-uptex/upzhfandolfonts.tex | 2 + 4 files changed, 96 insertions(+), 63 deletions(-) create mode 100644 zhmetrics-uptex/makemetrics.lua diff --git a/zhmetrics-uptex/README.md b/zhmetrics-uptex/README.md index 8aa1b4d6..e8d0637b 100644 --- a/zhmetrics-uptex/README.md +++ b/zhmetrics-uptex/README.md @@ -1,28 +1,31 @@ -zhmetrics-uptex: Chinese Font Metrics for upTeX +zhmetrics-uptex =============================================== +**2016/04/23 Ver 1.0** + +The `zhmetrics-uptex` package contains some Chinese font metrics (JFM, VF, etc) for upTeX engine, together with a simple DVIPDFMx font mapping of Fandol fonts for DVIPDFMx. + +The font mapping can be loaded in the TeX source file, or changed in the document to use other fonts. + Files ----- * `upzh*-{h,v}.tfm` are the JFM files used by upTeX. * `upzh*-{h,v}.vf` are the virtual fonts used by the output driver (dvipdfmx). * `up*-{h,v}.tfm` are the PS TFM files used by the output driver. -* `upzhfandolfonts.tex` contains the font mappings for Fandol fonts. +* `upzhfandolfonts.tex` contains the font mappings of Fandol fonts for DVIPDFMx. * `upzhfandolfonts-test.tex` is a small LaTeX test file. * `upzhm-{h,v}.pl` are the JPL source files used to produce JFM files. -* `build.lua` is the build script. +* `makemetrics.lua` is the build script. Build ----- -* To create a TDS zip file, run: - ```shell - texlua build.lua tds - ``` -* To create a CTAN zip file, run: - ```shell - texlua build.lua ctan - ``` +To create the metric files, just run: +```shell +texlua makemetrics.lua +``` +in the source directory. Contributing ------------ @@ -45,10 +48,11 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Leo Liu. This work consists of the files - build.lua + makemetrics.lua upzhm-{h,v}.pl upzhfandolfonts.tex upzhfandolfongs-test.tex + README.md and the derived files upzhserif-{h,v}.tfm upzhserifit-{h,v}.tfm diff --git a/zhmetrics-uptex/build.lua b/zhmetrics-uptex/build.lua index c255c4eb..62156b4f 100644 --- a/zhmetrics-uptex/build.lua +++ b/zhmetrics-uptex/build.lua @@ -4,8 +4,6 @@ -- Copyright (C) 2016 by Leo Liu local fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} -local pltopf = 'uppltotf -kanji=uptex' -local makejvf = 'makejvf -i -u gb' function copyfile(path_src, path_dst) local cp = 'cp -f' @@ -51,30 +49,7 @@ function rmdir(dir) os.execute(rd .. ' ' .. dir) end -function unpack() - mkdir('tfm') - mkdir('vf') - for _, hv in pairs({'h', 'v'}) do - for _, fnt in pairs(fonts) do - local pl = string.format("upzhm-%s.pl", hv) - local jfm = string.format('upzh%s-%s.tfm', fnt, hv) - local vf = string.format('upzh%s-%s.vf', fnt, hv) - local pstfm = string.format('up%s-%s.tfm', fnt, hv) - os.execute(string.format("%s %s %s", pltopf, pl, jfm)) - os.execute(string.format("%s %s %s", makejvf, jfm, pstfm)) - move(jfm, 'tfm/' .. jfm) - move(vf, 'vf/' .. vf) - move(pstfm, 'tfm/' .. pstfm) - end - end -end - -function tds() - local tfmdir = 'tds/fonts/tfm/zhmetrics-uptex' - local vfdir = 'tds/fonts/vf/zhmetrics-uptex' - local texdir = 'tds/tex/uptex/zhmetrics-uptex' - local sourcedir = 'tds/source/fonts/zhmetrics-uptex' - local docdir = 'tds/doc/fonts/zhmetrics-uptex' +function packfiles(zipname, workdir, tfmdir, vfdir, texdir, sourcedir, docdir) mkdir(tfmdir) mkdir(vfdir) mkdir(texdir) @@ -85,51 +60,84 @@ function tds() local jfm = string.format('upzh%s-%s.tfm', fnt, hv) local vf = string.format('upzh%s-%s.vf', fnt, hv) local pstfm = string.format('up%s-%s.tfm', fnt, hv) - copyfile('tfm/' .. jfm, tfmdir .. '/' .. jfm) - copyfile('tfm/' .. pstfm, tfmdir .. '/' .. pstfm) - copyfile('vf/' .. vf, vfdir .. '/' .. vf) + copyfile(jfm, tfmdir .. '/') + copyfile(pstfm, tfmdir .. '/') + copyfile(vf, vfdir .. '/') end - local pl = string.format("upzhm-%s.pl", hv) - copyfile(pl, sourcedir .. '/' .. pl) + local pl = string.format('upzhm-%s.pl', hv) + copyfile(pl, sourcedir .. '/') end - copyfile('build.lua', sourcedir .. '/build.lua') - copyfile('upzhfandolfonts.tex', texdir .. '/upzhfandolfonts.tex') - copyfile('README.md', docdir .. '/README.md') - copyfile('upzhfandolfonts-test.tex', docdir .. '/upzhfandolfonts-test.tex') + copyfile('makemetrics.lua', sourcedir .. '/') + copyfile('upzhfandolfonts.tex', texdir .. '/') + copyfile('README.md', docdir .. '/') + copyfile('upzhfandolfonts-test.tex', docdir .. '/') + copyfile('upzhfandolfonts-test.pdf', docdir .. '/') local tdszipname = 'zhmetrics-uptex.tds.zip' - lfs.chdir('tds') - os.execute('zip -r ' .. '../' .. tdszipname .. ' *') + if lfs.attributes(zipname) then + os.remove(zipname) + end + local curdir = lfs.currentdir() + lfs.chdir(workdir) + os.execute('zip -r ' .. curdir .. '/' .. zipname .. ' *') + lfs.chdir(curdir) +end + +function tds() + packfiles('zhmetrics-uptex.tds.zip', 'tds', + 'tds/fonts/tfm/zhmetrics-uptex', + 'tds/fonts/vf/zhmetrics-uptex', + 'tds/tex/uptex/zhmetrics-uptex', + 'tds/source/fonts/zhmetrics-uptex', + 'tds/doc/fonts/zhmetrics-uptex') end function ctan() - local zipname = 'zhmetrics-uptex.zip' - os.execute('zip ' .. zipname .. ' README.md' .. - ' build.lua upzhm-h.pl upzhm-v.pl' .. - ' upzhfandolfonts.tex upzhfandolfonts-test.tex') - os.execute('zip -r ' .. zipname .. ' tfm/ vf/') + packfiles('zhmetrics-uptex.zip', 'ctan', + 'ctan/tfm', + 'ctan/vf', + 'ctan/tex', + 'ctan/source', + 'ctan/doc') + copyfile('README.md', 'ctan/') + os.execute('zip zhmetrics-uptex.zip README.md') end function clean() + for _, hv in pairs({'h', 'v'}) do + for _, fnt in pairs(fonts) do + local jfm = string.format('upzh%s-%s.tfm', fnt, hv) + local vf = string.format('upzh%s-%s.vf', fnt, hv) + local pstfm = string.format('up%s-%s.tfm', fnt, hv) + os.remove(jfm) + os.remove(vf) + os.remove(pstfm) + end + end rmdir('tds') - rmdir('tfm') - rmdir('vf') - os.remove('zhmetrics-uptex.zip') - os.remove('zhmetrics-uptex.tds.zip') + rmdir('ctan') end function main(target) - if target == "unpack" then + local unpack = function() + dofile('makemetrics.lua') + os.execute('uplatex upzhfandolfonts-test') + os.execute('dvipdfmx upzhfandolfonts-test') + for _, suf in pairs({'.aux', '.log', '.dvi'}) do + os.remove('upzhfandolfonts-test' .. suf) + end + end + if target == 'unpack' then unpack() - elseif target == "tds" then + elseif target == 'tds' then unpack() tds() - elseif target == "ctan" then + elseif target == 'ctan' then unpack() ctan() - elseif target == "clean" then + elseif target == 'clean' then clean() else - print("Usage: " .. arg[0] .. " [unpack|tds|ctan|clean]") + print('Usage: ' .. arg[0] .. ' [unpack|tds|ctan|clean]') end end diff --git a/zhmetrics-uptex/makemetrics.lua b/zhmetrics-uptex/makemetrics.lua new file mode 100644 index 00000000..80cbf3f8 --- /dev/null +++ b/zhmetrics-uptex/makemetrics.lua @@ -0,0 +1,19 @@ +#!/usr/bin/env texlua + +-- zhmetrics-uptex v1.0 +-- Copyright (C) 2016 by Leo Liu + +local fonts = {'serif', 'serifit', 'serifb', 'sans', 'sansb', 'mono'} +local pltopf = 'uppltotf -kanji=uptex' +local makejvf = 'makejvf -i -u gb' + +for _, hv in pairs({'h', 'v'}) do + for _, fnt in pairs(fonts) do + local pl = string.format('upzhm-%s.pl', hv) + local jfm = string.format('upzh%s-%s.tfm', fnt, hv) + local vf = string.format('upzh%s-%s.vf', fnt, hv) + local pstfm = string.format('up%s-%s.tfm', fnt, hv) + os.execute(string.format('%s %s %s', pltopf, pl, jfm)) + os.execute(string.format('%s %s %s', makejvf, jfm, pstfm)) + end +end diff --git a/zhmetrics-uptex/upzhfandolfonts.tex b/zhmetrics-uptex/upzhfandolfonts.tex index bee18645..107014af 100644 --- a/zhmetrics-uptex/upzhfandolfonts.tex +++ b/zhmetrics-uptex/upzhfandolfonts.tex @@ -13,3 +13,5 @@ \special{pdf:mapline upsans-v UniGB-UTF16-V FandolHei-Regular.otf} \special{pdf:mapline upsansb-v UniGB-UTF16-V FandolHei-Bold.otf} \special{pdf:mapline upmono-v UniGB-UTF16-V FandolFang-Regular.otf} + +\endinput From cfabda452c987d8f02d3d4ad121a708dadeb052b Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 16:47:22 +0800 Subject: [PATCH 17/20] gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 983337b3..a8aa2300 100644 --- a/.gitignore +++ b/.gitignore @@ -144,8 +144,8 @@ zhmetrics/zhmCJK-test.tex zhmetrics-uptex/*.tfm zhmetrics-uptex/*.vf zhmetrics-uptex/*.pdf -zhmetrics-uptex/tfm/* -zhmetrics-uptex/vf/* +zhmetrics-uptex/ctan/* +zhmetrics-uptex/tds/* # zhnumber From 46430409b0e0f366f0c66234d6c8b86021d0afa3 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Sat, 23 Apr 2016 23:07:56 +0800 Subject: [PATCH 18/20] =?UTF-8?q?ctex:=20=E5=9C=A8=20upLaTeX=20=E4=B8=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20zhsong=20=E7=AD=89=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E6=97=8F=EF=BC=8C=E4=BB=A5=E6=AD=A3=E7=A1=AE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20\songti=20=E7=AD=89=E5=AD=97=E4=BD=93=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E3=80=82=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 62 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 80c12c26..53f4e424 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -559,8 +559,8 @@ This package consists of the file ctex.dtx, and the derived files %\ProvidesFile{ctexspa.def}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -% [2016/02/02 v2.3 Chinese font definition (CTEX)] -% [2016/02/02 v2.3 Space info for CJKpunct (CTEX)] +% [2016/04/23 v2.4 Chinese font definition (CTEX)] +% [2016/04/23 v2.4 Space info for CJKpunct (CTEX)] % [2016/02/20 v1.0 Chinese translation for theorem name (CTEX)] % %<*driver> @@ -853,7 +853,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5469} +% \CheckSum{5500} % % \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 @@ -5855,7 +5855,7 @@ This package consists of the file ctex.dtx, and the derived files %<*uptex> % \end{macrocode} % -% \changes{v2.?}{2016/02/28}{初步支持 \upLaTeX。} ^^A FIXME +% \changes{v2.4}{2016/02/28}{初步支持 \upLaTeX。} % % 按 \pkg{CJK} 的命名习惯模拟部分命令,并设置默认字体。 % \begin{macrocode} @@ -5909,6 +5909,28 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % +% \changes{v2.4}{2016/04/24}{正确设置 \upTeX{} 下字体命令。} +% \begin{macro}[int]{\ctex_set_upfamily:nnn} +% 将 NFSS 字体族 |#1| 设置为 JFM 字体名 |#2|,粗体形式字体名 |#3|。其中字体名 +% 形如 |upserif|,不包括表示方向的后缀 |-h| 与 |-v|。粗体字体名为空时不设置该 +% 字形。本命令不设置字体映射,需要复用已有的字体映射或另行设置。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upfamily:nnn #1 #2 #3 + { + \DeclareKanjiFamily{JY2}{#1}{} + \DeclareKanjiFamily{JT2}{#1}{} + \DeclareFontShape{JY2}{#1}{m}{n}{<->~ #2-h}{} + \DeclareFontShape{JT2}{#1}{m}{n}{<->~ #2-v}{} + \tl_if_empty:nF { #3 } + { + \DeclareFontShape{JY2}{#1}{bx}{n}{<->~ #3-h}{} + \DeclareFontShape{JT2}{#1}{bx}{n}{<->~ #3-v}{} + } + } +\@onlypreamble \ctex_set_upfamily:nnn +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\@EverySelectfont@Init} % \pkg{everysel} 宏包(2011/10/28)未考虑 \upLaTeX{} 对 \tn{selectfont} 的修 % 改,因此这里需要对其给出正确的定义。因为不会使用 \pkg{CJK},这里忽略有关 @@ -8880,7 +8902,7 @@ This package consists of the file ctex.dtx, and the derived files %\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne} % \end{macrocode} % -% \changes{v2.?}{2016/04/17}{提供 \upLaTeX{} 的 NFSS 字体定义。} ^^A FIXME +% \changes{v2.4}{2016/04/17}{提供 \upLaTeX{} 的 NFSS 字体定义。} % \upTeX{} 使用的字体族。\upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别 % 表示横排与直排的日文。 % \begin{macrocode} @@ -9077,6 +9099,11 @@ This package consists of the file ctex.dtx, and the derived files % {msyh\l_@@_msyh_suffix} {msyhbd\l_@@_msyh_suffix} % {simhei.ttf} {simhei.ttf} {simfang.ttf} + \ctex_set_upfamily:nnn { zhsong } { upserif } {} + \ctex_set_upfamily:nnn { zhhei } { upserifb } {} + \ctex_set_upfamily:nnn { zhfs } { upmono} {} + \ctex_set_upfamily:nnn { zhkai } { upserifit } {} +% \ctex_set_upfamily:nnn { zhyahei } { upsans } { upsansb } } { %<*windowsold> @@ -9165,6 +9192,10 @@ This package consists of the file ctex.dtx, and the derived files {AdobeSongStd-Light.otf} {AdobeKaitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} {AdobeFangsongStd-Regular.otf} + \ctex_set_upfamily:nnn { zhsong } { upserif } {} + \ctex_set_upfamily:nnn { zhhei } { upsans } {} + \ctex_set_upfamily:nnn { zhfs } { upmono} {} + \ctex_set_upfamily:nnn { zhkai } { upserifit } {} } { \setCJKmainfont @@ -9248,6 +9279,10 @@ This package consists of the file ctex.dtx, and the derived files {FandolSong-Regular.otf} {FandolKai-Regular.otf} {FandolSong-Bold.otf} {FandolHei-Regular.otf} {FandolHei-Bold.otf} {FandolFang-Regular.otf} + \ctex_set_upfamily:nnn { zhsong } { upserif } { upserifb } + \ctex_set_upfamily:nnn { zhhei } { upsans } { upsansb } + \ctex_set_upfamily:nnn { zhfs } { upmono} {} + \ctex_set_upfamily:nnn { zhkai } { upserifit } {} } { \setCJKmainfont @@ -9404,6 +9439,10 @@ This package consists of the file ctex.dtx, and the derived files { FZSSK.TTF } { FZKTK.TTF } { FZXBSK.TTF } { FZXH1K.TTF } { FZHTK.TTF } { FZFSK.TTF } + \ctex_set_upfamily:nnn { zhsong } { upserif } { upserifb } + \ctex_set_upfamily:nnn { zhhei } { upsans } { upsansb } + \ctex_set_upfamily:nnn { zhfs } { upmono} {} + \ctex_set_upfamily:nnn { zhkai } { upserifit } {} } { \setCJKmainfont @@ -9481,6 +9520,9 @@ This package consists of the file ctex.dtx, and the derived files { uming.ttc } { ukai.ttc } { wqy-zenhei.ttc } { wqy-zenhei.ttc } { wqy-zenhei.ttc } { uming.ttc } + \ctex_set_upfamily:nnn { zhsong } { upserif } {} + \ctex_set_upfamily:nnn { zhhei } { upsans } {} + \ctex_set_upfamily:nnn { zhkai } { upserifit } {} } { \setCJKmainfont @@ -9589,7 +9631,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*windows> \ProvidesFile{zhwindowsfonts.tex}% - [2016/02/02 v2.3 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhadobefonts.tex}% - [2016/02/02 v2.3 Adobe font map loader for DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Adobe font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9697,7 +9739,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*fandol> \ProvidesFile{zhfandolfonts.tex}% - [2016/02/02 v2.3 Fandol font map loader for DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Fandol font map loader for DVIPDFMx (CTEX)] \ifzhmappdf %% pdfTeX does not support OTF fonts @@ -9733,7 +9775,7 @@ This package consists of the file ctex.dtx, and the derived files % \begin{macrocode} %<*founder> \ProvidesFile{zhfounderfonts.tex}% - [2016/02/02 v2.3 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ \ProvidesFile{zhubuntufonts.tex}% - [2016/02/02 v2.3 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] + [2016/04/23 v2.4 Ubuntu font map loader for pdfTeX and DVIPDFMx (CTEX)] \ifzhmappdf \pdfmapline{=gbk@UGBK@ Date: Mon, 25 Apr 2016 11:54:49 +0800 Subject: [PATCH 19/20] =?UTF-8?q?ctex:=20jy2/jt2=20=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=88=90=20.fd=20=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=9C=A8=20uptex=20=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=AE=8C=E6=88=90=E3=80=82=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 80 ++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 56 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 53f4e424..42cf8a8d 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -94,12 +94,6 @@ This package consists of the file ctex.dtx, and the derived files c70rm.fd, c70sf.fd, c70tt.fd, - jy2rm.fd, - jy2sf.fd, - jy2tt.fd, - jt2rm.fd, - jt2sf.fd, - jt2tt.fd, ctex-fontset-windows.def, ctex-fontset-windowsnew.def, ctex-fontset-windowsold.def, @@ -245,12 +239,6 @@ This package consists of the file ctex.dtx, and the derived files c70rm.fd, c70sf.fd, c70tt.fd, - jy2rm.fd, - jy2sf.fd, - jy2tt.fd, - jt2rm.fd, - jt2sf.fd, - jt2tt.fd, ctex-fontset-windows.def, ctex-fontset-windowsnew.def, ctex-fontset-windowsold.def, @@ -321,12 +309,6 @@ This package consists of the file ctex.dtx, and the derived files \file{c70rm.fd} {\from{\jobname.dtx}{rm,c70}} \file{c70sf.fd} {\from{\jobname.dtx}{sf,c70}} \file{c70tt.fd} {\from{\jobname.dtx}{tt,c70}} - \file{jy2rm.fd} {\from{\jobname.dtx}{rm,jy2}} - \file{jy2sf.fd} {\from{\jobname.dtx}{sf,jy2}} - \file{jy2tt.fd} {\from{\jobname.dtx}{tt,jy2}} - \file{jt2rm.fd} {\from{\jobname.dtx}{rm,jt2}} - \file{jt2sf.fd} {\from{\jobname.dtx}{sf,jt2}} - \file{jt2tt.fd} {\from{\jobname.dtx}{tt,jt2}} \file{ctex-fontset-windows.def} {\from{\jobname.dtx}{fontset,windows}} \file{ctex-fontset-windowsnew.def} {\from{\jobname.dtx}{fontset,windowsnew}} \file{ctex-fontset-windowsold.def} {\from{\jobname.dtx}{fontset,windowsold}} @@ -407,12 +389,6 @@ This package consists of the file ctex.dtx, and the derived files \Msg{* c70rm.fd *} \Msg{* c70sf.fd *} \Msg{* c70tt.fd *} -\Msg{* jy2rm.fd *} -\Msg{* jy2sf.fd *} -\Msg{* jy2tt.fd *} -\Msg{* jt2rm.fd *} -\Msg{* jt2sf.fd *} -\Msg{* jt2tt.fd *} \Msg{* ctex-fontset-windows.def *} \Msg{* ctex-fontset-windowsnew.def *} \Msg{* ctex-fontset-windowsold.def *} @@ -445,12 +421,12 @@ This package consists of the file ctex.dtx, and the derived files \fi % %<*!(readme|install|zhmap|spa)> -%<*!(c19|c70|jy2|jt2|ctexspa|dict)> +%<*!(c19|c70|ctexspa|dict)> %<*driver|class|style|ctexcap|ctexhook|ctexpatch> \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} % -%<.!(readme|install|zhmap|spa|c19|c70|jy2|jt2|ctexspa)>\ctexPutVersion +%<.!(readme|install|zhmap|spa|c19|c70|ctexspa)>\ctexPutVersion %<*driver> \InputIfFileExists{ctex.ver}{}{ \def\ctexGetVersionInfo{\GetIdInfo$Id$}} @@ -543,23 +519,17 @@ This package consists of the file ctex.dtx, and the derived files % {Ubuntu fonts definition (CTEX)} %\ProvidesExplFile{ctex-fontset-ubuntu.def} {\ExplFileDate}{2.4}{\ExplFileDescription} -% +% %\ProvidesFile{c19rm.fd}% %\ProvidesFile{c19sf.fd}% %\ProvidesFile{c19tt.fd}% %\ProvidesFile{c70rm.fd}% %\ProvidesFile{c70sf.fd}% %\ProvidesFile{c70tt.fd}% -%\ProvidesFile{jy2rm.fd}% -%\ProvidesFile{jy2sf.fd}% -%\ProvidesFile{jy2tt.fd}% -%\ProvidesFile{jt2rm.fd}% -%\ProvidesFile{jt2sf.fd}% -%\ProvidesFile{jt2tt.fd}% %\ProvidesFile{ctexspa.def}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}% %\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}% -% [2016/04/23 v2.4 Chinese font definition (CTEX)] +% [2016/04/23 v2.4 Chinese font definition (CTEX)] % [2016/04/23 v2.4 Space info for CJKpunct (CTEX)] % [2016/02/20 v1.0 Chinese translation for theorem name (CTEX)] % @@ -8881,15 +8851,15 @@ This package consists of the file ctex.dtx, and the derived files % \subsubsection{传统定义方式} % % \begin{macrocode} -%<*c19|c70|jy2|jt2> +%<*c19|c70> %% %% Chinese characters %% %%% character set: GBK (extension of GB 2312) -%%% character set: Unicode +%%% character set: Unicode %% font encoding: Unicode %% -% +% % \end{macrocode} % % \pkg{CJK} 宏包使用的字体族。 @@ -8902,16 +8872,16 @@ This package consists of the file ctex.dtx, and the derived files %\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne} % \end{macrocode} % -% \changes{v2.4}{2016/04/17}{提供 \upLaTeX{} 的 NFSS 字体定义。} +% \changes{v2.4}{2016/04/25}{提供 \upLaTeX{} 的 NFSS 字体定义。} % \upTeX{} 使用的字体族。\upLaTeX 在 NFSS 下使用字体编码 |JY2| 和 |JT2| 来分别 % 表示横排与直排的日文。 % \begin{macrocode} -%\DeclareKanjiFamily{JY2}{rm}{} -%\DeclareKanjiFamily{JY2}{sf}{} -%\DeclareKanjiFamily{JY2}{tt}{} -%\DeclareKanjiFamily{JT2}{rm}{} -%\DeclareKanjiFamily{JT2}{sf}{} -%\DeclareKanjiFamily{JT2}{tt}{} +%\DeclareKanjiFamily{JY2}{rm}{} +%\DeclareKanjiFamily{JY2}{sf}{} +%\DeclareKanjiFamily{JY2}{tt}{} +%\DeclareKanjiFamily{JT2}{rm}{} +%\DeclareKanjiFamily{JT2}{sf}{} +%\DeclareKanjiFamily{JT2}{tt}{} % \end{macrocode} % % @@ -8939,17 +8909,15 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{rm}{b}{it}{<-> CJKb * unikai}{\CJKbold} \DeclareFontShape{C70}{rm}{bx}{it}{<-> CJKb * unikai}{\CJKbold} % -%<*jy2> +% +%<*uptex> \DeclareFontShape{JY2}{rm}{m}{n}{<-> upzhserif-h}{} \DeclareFontShape{JY2}{rm}{m}{it}{<-> upzhserifit-h}{} \DeclareFontShape{JY2}{rm}{bx}{n}{<-> upzhserifb-h}{} -% -%<*jt2> \DeclareFontShape{JT2}{rm}{m}{n}{<-> upzhserif-v}{} \DeclareFontShape{JT2}{rm}{m}{it}{<-> upzhserifit-v}{} \DeclareFontShape{JT2}{rm}{bx}{n}{<-> upzhserifb-v}{} -% -% +% % \end{macrocode} % % \begin{macrocode} @@ -8976,15 +8944,13 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{sf}{b}{it}{<-> CJKb * uniyou}{\CJKbold} \DeclareFontShape{C70}{sf}{bx}{it}{<-> CJKb * uniyou}{\CJKbold} % -%<*jy2> +% +%<*uptex> \DeclareFontShape{JY2}{sf}{m}{n}{<-> upzhsans-h}{} \DeclareFontShape{JY2}{sf}{bx}{n}{<-> upzhsansb-h}{} -% -%<*jt2> \DeclareFontShape{JT2}{sf}{m}{n}{<-> upzhsans-v}{} \DeclareFontShape{JT2}{sf}{bx}{n}{<-> upzhsansb-v}{} -% -% +% % \end{macrocode} % % \begin{macrocode} @@ -9011,9 +8977,11 @@ This package consists of the file ctex.dtx, and the derived files \DeclareFontShape{C70}{tt}{b}{it}{<-> CJKb * unifs}{\CJKbold} \DeclareFontShape{C70}{tt}{bx}{it}{<-> CJKb * unifs}{\CJKbold} % -%\DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} -%\DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} % +%<*uptex> +\DeclareFontShape{JY2}{tt}{m}{n}{<-> upzhmono-h}{} +\DeclareFontShape{JT2}{tt}{m}{n}{<-> upzhmono-v}{} +% % \end{macrocode} % % \begin{macrocode} From ee0818da15d0ffebe0bfa6844eff627f4a5142f4 Mon Sep 17 00:00:00 2001 From: Liu Haiyang Date: Mon, 25 Apr 2016 12:08:14 +0800 Subject: [PATCH 20/20] =?UTF-8?q?ctex:=20=E5=80=9F=E7=94=A8=20upschrm=20?= =?UTF-8?q?=E5=92=8C=20upschgt=20=E5=AE=9E=E7=8E=B0=20upTeX=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=9A=B6=E4=B9=A6=E5=92=8C=E5=B9=BC=E5=9C=86=E4=BD=93?= =?UTF-8?q?=E3=80=82=E4=BF=AE=E6=AD=A3=20zhsong=20=E7=AD=89=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E6=97=8F=E6=A0=87=E7=82=B9=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctex/ctex.dtx | 135 ++++++++++++++++++++++++++++---------------------- 1 file changed, 77 insertions(+), 58 deletions(-) diff --git a/ctex/ctex.dtx b/ctex/ctex.dtx index 42cf8a8d..7af15380 100644 --- a/ctex/ctex.dtx +++ b/ctex/ctex.dtx @@ -823,7 +823,7 @@ This package consists of the file ctex.dtx, and the derived files % \changes{v2.4}{2015/02/19}{加强 \pkg{beamer} 宏包支持。} % % -% \CheckSum{5500} +% \CheckSum{5509} % % \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 @@ -5853,36 +5853,10 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\ctex_set_upmap:nnnnnn} -% 设置 \upTeX{} 字体映射,按 \pkg{zhmetrics-uptex} 的定义,依次设置衬线体正、 -% 斜、粗,无衬线体正、粗,等宽体正——共 6 种字体,并分横排及直排。 -% \begin{macrocode} -\cs_new_protected_nopar:Npn \ctex_set_upmap:nnnnnn #1 #2 #3 #4 #5 #6 - { - \ctex_set_zhmap:n - { - \special{ pdf:mapline~ upserif-h~ UniGB-UTF16-H~ #1 } - \special{ pdf:mapline~ upserif-v~ UniGB-UTF16-V~ #1 } - \special{ pdf:mapline~ upserifit-h~ UniGB-UTF16-H~ #2 } - \special{ pdf:mapline~ upserifit-v~ UniGB-UTF16-V~ #2 } - \special{ pdf:mapline~ upserifb-h~ UniGB-UTF16-H~ #3 } - \special{ pdf:mapline~ upserifb-v~ UniGB-UTF16-V~ #3 } - \special{ pdf:mapline~ upsans-h~ UniGB-UTF16-H~ #4 } - \special{ pdf:mapline~ upsans-v~ UniGB-UTF16-V~ #4 } - \special{ pdf:mapline~ upsansb-h~ UniGB-UTF16-H~ #5 } - \special{ pdf:mapline~ upsansb-v~ UniGB-UTF16-V~ #5 } - \special{ pdf:mapline~ upmono-h~ UniGB-UTF16-H~ #6 } - \special{ pdf:mapline~ upmono-v~ UniGB-UTF16-V~ #6 } - } - } -\@onlypreamble \ctex_set_upmap:nnnnnn -% \end{macrocode} -% \end{macro} -% % \changes{v2.4}{2016/04/24}{正确设置 \upTeX{} 下字体命令。} % \begin{macro}[int]{\ctex_set_upfamily:nnn} % 将 NFSS 字体族 |#1| 设置为 JFM 字体名 |#2|,粗体形式字体名 |#3|。其中字体名 -% 形如 |upserif|,不包括表示方向的后缀 |-h| 与 |-v|。粗体字体名为空时不设置该 +% 形如 |upzhserif|,不包括表示方向的后缀 |-h| 与 |-v|。粗体字体名为空时不设置该 % 字形。本命令不设置字体映射,需要复用已有的字体映射或另行设置。 % \begin{macrocode} \cs_new_protected_nopar:Npn \ctex_set_upfamily:nnn #1 #2 #3 @@ -5901,6 +5875,43 @@ This package consists of the file ctex.dtx, and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}[int]{\ctex_set_upmap:nnn} +% 设置 \upTeX{} 字体映射。|#1| 是形如 |upserif| 的 PS TFM 字体名,不带表示粗体 +% 的后缀 |b| 与表示排版方向的后缀 |-h| 与 |-v|。|#2| 与 |#3| 是普通与粗体的实际 +% 字体名。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upmap:nnn #1 #2 #3 + { + \ctex_set_zhmap:n + { + \special{ pdf:mapline~ #1-h~ UniGB-UTF16-H~ #2 } + \special{ pdf:mapline~ #1-v~ UniGB-UTF16-V~ #2 } + \tl_if_empty:nF { #3 } + { + \special{ pdf:mapline~ #1b-h~ UniGB-UTF16-H~ #3 } + \special{ pdf:mapline~ #1b-v~ UniGB-UTF16-V~ #3 } + } + } + } +\@onlypreamble \ctex_set_upmap:nnn +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[int]{\ctex_set_upfonts:nnnnnn} +% 设置 \upTeX{} 基本字体映射,按 \pkg{zhmetrics-uptex} 的定义,依次设置衬线体 +% 正、粗、意大利,无衬线体正、粗,等宽体正——共 6 种字体,并分横排及直排。 +% \begin{macrocode} +\cs_new_protected_nopar:Npn \ctex_set_upfonts:nnnnnn #1 #2 #3 #4 #5 #6 + { + \ctex_set_upmap:nnn { upserif } { #1 } { #2 } + \ctex_set_upmap:nnn { upserifit } { #3 } {} + \ctex_set_upmap:nnn { upsans } { #4 } { #5 } + \ctex_set_upmap:nnn { upmono } { #6 } {} + } +\@onlypreamble \ctex_set_upfonts:nnnnnn +% \end{macrocode} +% \end{macro} +% % \begin{macro}[int]{\@EverySelectfont@Init} % \pkg{everysel} 宏包(2011/10/28)未考虑 \upLaTeX{} 对 \tn{selectfont} 的修 % 改,因此这里需要对其给出正确的定义。因为不会使用 \pkg{CJK},这里忽略有关 @@ -9062,16 +9073,20 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_upmap:nnnnnn - {simsun.ttc} {simkai.ttf} {simhei.ttf} + \ctex_set_upfonts:nnnnnn + {simsun.ttc} {simhei.ttf} {simkai.ttf} % {msyh\l_@@_msyh_suffix} {msyhbd\l_@@_msyh_suffix} % {simhei.ttf} {simhei.ttf} {simfang.ttf} - \ctex_set_upfamily:nnn { zhsong } { upserif } {} - \ctex_set_upfamily:nnn { zhhei } { upserifb } {} - \ctex_set_upfamily:nnn { zhfs } { upmono} {} - \ctex_set_upfamily:nnn { zhkai } { upserifit } {} -% \ctex_set_upfamily:nnn { zhyahei } { upsans } { upsansb } + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhserifb } {} + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} +% \ctex_set_upfamily:nnn { zhyahei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhli } { upschrm } {} + \ctex_set_upmap:nnn { upstsl } { simli.ttf } {} + \ctex_set_upfamily:nnn { zhyou } { upschgt } {} + \ctex_set_upmap:nnn { upstht } { simyou.ttf } {} } { %<*windowsold> @@ -9156,14 +9171,14 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_upmap:nnnnnn - {AdobeSongStd-Light.otf} {AdobeKaitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} + \ctex_set_upfonts:nnnnnn + {AdobeSongStd-Light.otf} {AdobeHeitiStd-Regular.otf} {AdobeKaitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} {AdobeHeitiStd-Regular.otf} {AdobeFangsongStd-Regular.otf} - \ctex_set_upfamily:nnn { zhsong } { upserif } {} - \ctex_set_upfamily:nnn { zhhei } { upsans } {} - \ctex_set_upfamily:nnn { zhfs } { upmono} {} - \ctex_set_upfamily:nnn { zhkai } { upserifit } {} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhsans } {} + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} } { \setCJKmainfont @@ -9243,14 +9258,14 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_upmap:nnnnnn - {FandolSong-Regular.otf} {FandolKai-Regular.otf} {FandolSong-Bold.otf} + \ctex_set_upfonts:nnnnnn + {FandolSong-Regular.otf} {FandolSong-Bold.otf} {FandolKai-Regular.otf} {FandolHei-Regular.otf} {FandolHei-Bold.otf} {FandolFang-Regular.otf} - \ctex_set_upfamily:nnn { zhsong } { upserif } { upserifb } - \ctex_set_upfamily:nnn { zhhei } { upsans } { upsansb } - \ctex_set_upfamily:nnn { zhfs } { upmono} {} - \ctex_set_upfamily:nnn { zhkai } { upserifit } {} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } { upzhserifb } + \ctex_set_upfamily:nnn { zhhei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} } { \setCJKmainfont @@ -9403,14 +9418,18 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_upmap:nnnnnn - { FZSSK.TTF } { FZKTK.TTF } { FZXBSK.TTF } + \ctex_set_upfonts:nnnnnn + { FZSSK.TTF } { FZXBSK.TTF } { FZKTK.TTF } { FZXH1K.TTF } { FZHTK.TTF } { FZFSK.TTF } - \ctex_set_upfamily:nnn { zhsong } { upserif } { upserifb } - \ctex_set_upfamily:nnn { zhhei } { upsans } { upsansb } - \ctex_set_upfamily:nnn { zhfs } { upmono} {} - \ctex_set_upfamily:nnn { zhkai } { upserifit } {} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } { upzhserifb } + \ctex_set_upfamily:nnn { zhhei } { upzhsans } { upzhsansb } + \ctex_set_upfamily:nnn { zhfs } { upzhmono} {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} + \ctex_set_upfamily:nnn { zhli } { upschrm } {} + \ctex_set_upmap:nnn { upstsl } { FZLSK.TTF } {} + \ctex_set_upfamily:nnn { zhyou } { upschgt } {} + \ctex_set_upmap:nnn { upstht } { FZY1K.TTF } {} } { \setCJKmainfont @@ -9484,13 +9503,13 @@ This package consists of the file ctex.dtx, and the derived files { \sys_if_engine_uptex:TF { - \ctex_set_upmap:nnnnnn - { uming.ttc } { ukai.ttc } { wqy-zenhei.ttc } + \ctex_set_upfonts:nnnnnn + { uming.ttc } { wqy-zenhei.ttc } { ukai.ttc } { wqy-zenhei.ttc } { wqy-zenhei.ttc } { uming.ttc } - \ctex_set_upfamily:nnn { zhsong } { upserif } {} - \ctex_set_upfamily:nnn { zhhei } { upsans } {} - \ctex_set_upfamily:nnn { zhkai } { upserifit } {} + \ctex_set_upfamily:nnn { zhsong } { upzhserif } {} + \ctex_set_upfamily:nnn { zhhei } { upzhsans } {} + \ctex_set_upfamily:nnn { zhkai } { upzhserifit } {} } { \setCJKmainfont