Skip to content

Commit

Permalink
Merge pull request #676 from AlexaraWu/ctex-fontset-hanyi
Browse files Browse the repository at this point in the history
ctex: `fontset` 新增汉仪字库
  • Loading branch information
Liam0205 authored Nov 27, 2024
2 parents d513ce7 + bab8b0f commit 1ee66c6
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 3 deletions.
135 changes: 132 additions & 3 deletions ctex/ctex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Copyright and Licence
ctex-fontset-adobe.def,
ctex-fontset-fandol.def,
ctex-fontset-founder.def,
ctex-fontset-hanyi.def,
ctex-fontset-mac.def,
ctex-fontset-macnew.def,
ctex-fontset-macold.def,
Expand All @@ -142,6 +143,7 @@ Copyright and Licence
ctex-zhmap-adobe.tex,
ctex-zhmap-fandol.tex,
ctex-zhmap-founder.tex,
ctex-zhmap-hanyi.tex,
ctex-zhmap-mac.tex,
ctex-zhmap-ubuntu.tex,
ctex-zhmap-windows.tex,
Expand Down Expand Up @@ -242,6 +244,7 @@ Copyright and Licence
ctex-fontset-adobe.def,
ctex-fontset-fandol.def,
ctex-fontset-founder.def,
ctex-fontset-hanyi.def,
ctex-fontset-mac.def,
ctex-fontset-macnew.def,
ctex-fontset-macold.def,
Expand All @@ -254,6 +257,7 @@ Copyright and Licence
ctex-zhmap-adobe.tex,
ctex-zhmap-fandol.tex,
ctex-zhmap-founder.tex,
ctex-zhmap-hanyi.tex,
ctex-zhmap-mac.tex,
ctex-zhmap-ubuntu.tex,
ctex-zhmap-windows.tex,
Expand Down Expand Up @@ -318,6 +322,7 @@ Copyright and Licence
\file{ctex-fontset-adobe.def} {\from{\jobname.dtx}{fontset,adobe}}
\file{ctex-fontset-fandol.def} {\from{\jobname.dtx}{fontset,fandol}}
\file{ctex-fontset-founder.def} {\from{\jobname.dtx}{fontset,founder}}
\file{ctex-fontset-hanyi.def} {\from{\jobname.dtx}{fontset,hanyi}}
\file{ctex-fontset-mac.def} {\from{\jobname.dtx}{fontset,mac}}
\file{ctex-fontset-macnew.def} {\from{\jobname.dtx}{fontset,macnew}}
\file{ctex-fontset-macold.def} {\from{\jobname.dtx}{fontset,macold}}
Expand All @@ -335,6 +340,7 @@ Copyright and Licence
\file{ctex-zhmap-adobe.tex} {\from{\jobname.dtx}{zhmap,adobe}}
\file{ctex-zhmap-fandol.tex} {\from{\jobname.dtx}{zhmap,fandol}}
\file{ctex-zhmap-founder.tex} {\from{\jobname.dtx}{zhmap,founder}}
\file{ctex-zhmap-hanyi.tex} {\from{\jobname.dtx}{zhmap,hanyi}}
\file{ctex-zhmap-mac.tex} {\from{\jobname.dtx}{zhmap,mac}}
\file{ctex-zhmap-ubuntu.tex} {\from{\jobname.dtx}{zhmap,ubuntu}}
\file{ctex-zhmap-windows.tex} {\from{\jobname.dtx}{zhmap,windows}}
Expand Down Expand Up @@ -409,6 +415,7 @@ Copyright and Licence
\Msg{* ctex-fontset-adobe.def *}
\Msg{* ctex-fontset-fandol.def *}
\Msg{* ctex-fontset-founder.def *}
\Msg{* ctex-fontset-hanyi.def *}
\Msg{* ctex-fontset-mac.def *}
\Msg{* ctex-fontset-macnew.def *}
\Msg{* ctex-fontset-macold.def *}
Expand All @@ -420,6 +427,7 @@ Copyright and Licence
\Msg{* ctex-zhmap-adobe.tex *}
\Msg{* ctex-zhmap-fandol.tex *}
\Msg{* ctex-zhmap-founder.tex *}
\Msg{* ctex-zhmap-hanyi.tex *}
\Msg{* ctex-zhmap-mac.tex *}
\Msg{* ctex-zhmap-ubuntu.tex *}
\Msg{* ctex-zhmap-windows.tex *}
Expand Down Expand Up @@ -528,6 +536,8 @@ Copyright and Licence
%<macold>\ProvidesExplFile{ctex-fontset-macold.def}
%<founder> {Founder fonts definition (CTEX)}
%<founder>\ProvidesExplFile{ctex-fontset-founder.def}
%<hanyi> {Hanyi fonts definition (CTEX)}
%<hanyi>\ProvidesExplFile{ctex-fontset-hanyi.def}
%<ubuntu> {Ubuntu fonts definition (CTEX)}
%<ubuntu>\ProvidesExplFile{ctex-fontset-ubuntu.def}
%<!driver> {\ExplFileDate}{2.5.10}{\ExplFileDescription}
Expand Down Expand Up @@ -575,7 +585,7 @@ Copyright and Licence
% \changes{v2.4.15}{2019/03/23}{同步 \LaTeXiii{} 2019/03/05。}
% \changes{v2.5.1}{2020/05/02}{\pkg{zhconv} 更名为 \pkg{ctex-zhconv}。}
%
% \CheckSum{6630}
% \CheckSum{6713}
%
% \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
Expand Down Expand Up @@ -1008,20 +1018,21 @@ Copyright and Licence
%
% \begin{function}[added=2014-03-08]{fontset}
% \begin{syntax}
% fontset = <adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none|...>
% fontset = <adobe|fandol|founder|hanyi|mac|macnew|macold|ubuntu|windows|none|...>
% \end{syntax}
% 指定 \CTeX{} 宏集加载的字库。
%
% 如果没有指定 \opt{fontset} 的值,\CTeX{} 宏集将自动检测用户使用的操作系统,配置
% 相应的字体(参见表~\ref{tab:default-font-select})。
% \end{function}
%
% \CTeX{} 预定义了以下六种中文字库
% \CTeX{} 预定义了以下七种中文字库
%
% \begin{optdesc}
% \item[adobe] 使用 Adobe 公司的四款中文字体,\emph{不支持 \pdfLaTeX}。
% \item[fandol] 使用 Fandol 中文字体,\emph{不支持 \pdfLaTeX}。
% \item[founder] 使用方正公司的中文字体。
% \item[hanyi] 使用汉仪字库的中文字体。
% \item[mac] 使用 macOS 系统下的字体,\emph{不支持 \pdfLaTeX},根据版本分为
% |macnew| 和 |macold| 两种。
% \item[macnew] 使用 El Capitan 或之后的多字重华文字体和苹方字体。
Expand Down Expand Up @@ -10797,6 +10808,69 @@ Copyright and Licence
%</founder>
% \end{macrocode}
%
% \paragraph{\opt{hanyi}}
%
% \begin{macrocode}
%<*hanyi>
\ctex_fontset_case:nnn
{
\ctex_zhmap_case:nnn
{
\setCJKmainfont { HYShuSongErS.ttf }
[ BoldFont = HYZhongSongS.ttf, ItalicFont = HYKaiTiS.ttf ]
\setCJKsansfont { HYZhongHeiS.ttf } [ BoldFont = HYDaHeiS.ttf ]
\setCJKmonofont { HYFangSongS.ttf }
\setCJKfamilyfont { zhsong } { HYShuSongErS.ttf }
[ BoldFont = HYZhongSongS.ttf ]
\setCJKfamilyfont { zhhei } { HYZhongHeiS.ttf }
[ BoldFont = HYDaHeiS.ttf ]
\setCJKfamilyfont { zhkai } { HYKaiTiS.ttf }
\setCJKfamilyfont { zhfs } { HYFangSongS.ttf }
\ctex_punct_set:n { hanyi }
\ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
\ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
\ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
\ctex_punct_map_bfseries:nn { \CJKrmdefault, zhsong } { zhsongb }
\ctex_punct_map_bfseries:nn { \CJKsfdefault, zhhei } { zhheib }
\ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
}
{
\ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { hanyi }
\ctex_punct_set:n { hanyi }
\ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
\ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
\ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
}
{ \ctex_fontset_error:n { hanyi } }
}
{
\ctex_set_upfonts:nnnnnn
{ HYShuSongErS.ttf }
{ HYZhongSongS.ttf }
{ HYKaiTiS.ttf }
{ HYZhongHeiS.ttf }
{ HYDaHeiS.ttf }
{ HYFangSongS.ttf }
\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 { HYShuSongEr~S }
[ BoldFont = HYZhongSong~S, ItalicFont = HYKaiTi~S ]
\setCJKsansfont { HYZhongHei~S } [ BoldFont = HYDaHei~S ]
\setCJKmonofont { HYFangSong~S }
\setCJKfamilyfont { zhsong } { HYShuSongEr~S }
[ BoldFont = HYZhongSong~S ]
\setCJKfamilyfont { zhhei } { HYZhongHei~S }
[ BoldFont = HYDaHei~S ]
\setCJKfamilyfont { zhkai } { HYKaiTi~S }
\setCJKfamilyfont { zhfs } { HYFangSong~S }
}
%</hanyi>
% \end{macrocode}
%
% \changes{v2.5.2}{2020/05/06}
% {修正 \opt{macnew} 和 \opt{ubuntu} 字库的 \pkg{CJKpunct} 标点信息。}
%
Expand Down Expand Up @@ -11196,6 +11270,8 @@ Copyright and Licence
%<fandol> [2022/07/14 v2.5.10 Fandol font map loader for DVIPDFMx (CTEX)]
%<founder>\ProvidesFile{ctex-zhmap-founder.tex}%
%<founder> [2022/07/14 v2.5.10 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
%<hanyi>\ProvidesFile{ctex-zhmap-hanyi.tex}%
%<hanyi> [2022/07/14 v2.5.10 Hanyi font map loader for pdfTeX and DVIPDFMx (CTEX)]
%<mac>\ProvidesFile{ctex-zhmap-mac.tex}%
%<mac> [2022/07/14 v2.5.10 Mac font map loader for DVIPDFMx (CTEX)]
%<ubuntu>\ProvidesFile{ctex-zhmap-ubuntu.tex}%
Expand Down Expand Up @@ -11324,6 +11400,52 @@ Copyright and Licence
%</founder>
% \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-hanyi.tex}}
%
% \begin{macrocode}
%<*hanyi>
\ifzhmappdf
\pdfmapline{=gbk@UGBK@ <HYShuSongErS.ttf}
\pdfmapline{=gbksong@UGBK@ <HYShuSongErS.ttf}
\pdfmapline{=gbkkai@UGBK@ <HYKaiTiS.ttf}
\pdfmapline{=gbkhei@UGBK@ <HYZhongHeiS.ttf}
\pdfmapline{=gbkfs@UGBK@ <HYFangSongS.ttf}
\pdfmapline{=cyberb@Unicode@ <HYShuSongErS.ttf}
\pdfmapline{=unisong@Unicode@ <HYShuSongErS.ttf}
\pdfmapline{=unikai@Unicode@ <HYKaiTiS.ttf}
\pdfmapline{=unihei@Unicode@ <HYZhongHeiS.ttf}
\pdfmapline{=unifs@Unicode@ <HYFangSongS.ttf}
\pdfmapline{=gbksongsl@UGBK@ <HYShuSongErS.ttf}
\pdfmapline{=gbkkaisl@UGBK@ <HYKaiTiS.ttf}
\pdfmapline{=gbkheisl@UGBK@ <HYZhongHeiS.ttf}
\pdfmapline{=gbkfssl@UGBK@ <HYFangSongS.ttf}
\pdfmapline{=unisongsl@Unicode@ <HYShuSongErS.ttf}
\pdfmapline{=unikaisl@Unicode@ <HYKaiTiS.ttf}
\pdfmapline{=uniheisl@Unicode@ <HYZhongHeiS.ttf}
\pdfmapline{=unifssl@Unicode@ <HYFangSongS.ttf}
\else
\special{pdf:mapline gbk@UGBK@ unicode HYShuSongErS.ttf}
\special{pdf:mapline gbksong@UGBK@ unicode HYShuSongErS.ttf}
\special{pdf:mapline gbkkai@UGBK@ unicode HYKaiTiS.ttf}
\special{pdf:mapline gbkhei@UGBK@ unicode HYZhongHeiS.ttf}
\special{pdf:mapline gbkfs@UGBK@ unicode HYFangSongS.ttf}
\special{pdf:mapline cyberb@Unicode@ unicode HYShuSongErS.ttf}
\special{pdf:mapline unisong@Unicode@ unicode HYShuSongErS.ttf}
\special{pdf:mapline unikai@Unicode@ unicode HYKaiTiS.ttf}
\special{pdf:mapline unihei@Unicode@ unicode HYZhongHeiS.ttf}
\special{pdf:mapline unifs@Unicode@ unicode HYFangSongS.ttf}
\special{pdf:mapline gbksongsl@UGBK@ unicode HYShuSongErS.ttf -s .167}
\special{pdf:mapline gbkkaisl@UGBK@ unicode HYKaiTiS.ttf -s .167}
\special{pdf:mapline gbkheisl@UGBK@ unicode HYZhongHeiS.ttf -s .167}
\special{pdf:mapline gbkfssl@UGBK@ unicode HYFangSongS.ttf -s .167}
\special{pdf:mapline unisongsl@Unicode@ unicode HYShuSongErS.ttf -s .167}
\special{pdf:mapline unikaisl@Unicode@ unicode HYKaiTiS.ttf -s .167}
\special{pdf:mapline uniheisl@Unicode@ unicode HYZhongHeiS.ttf -s .167}
\special{pdf:mapline unifssl@Unicode@ unicode HYFangSongS.ttf -s .167}
\fi
%</hanyi>
% \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-mac.tex}}
%
% \changes{v2.5}{2020/01/15}{增加字体映射文件 \file{zhmacfonts.tex}。}
Expand Down Expand Up @@ -11587,6 +11709,13 @@ Copyright and Licence
{founderzhli} {FZLiShu-S01} ,
{founderzhyou} {FZXiYuan-M01} ,
{founderzhyoub} {FZZhunYuan-M02} ,
%
{hanyizhsong} {HYShuSongEr S} ,
{hanyizhsongb} {HYZhongSong S} ,
{hanyizhhei} {HYZhongHei S} ,
{hanyizhheib} {HYDaHei S} ,
{hanyizhkai} {HYKaiTi S} ,
{hanyizhfs} {HYFangSong S} ,
%
{maczhsong} {Songti SC Light} ,
{maczhsongb} {Songti SC Bold} ,
Expand Down
6 changes: 6 additions & 0 deletions ctex/ctexpunct.spa
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
\ctexspadef{founderzhli}{69,19,58,9,48,21,45,27,48,25,47,32,48,27,48,39,48,21,43,17,47,33,47,33,0,0,11,11,11,61,13,63,17,66,7,80,20,70,19,68,20,70,3,54,9,9,25,48,32,47,27,48,40,48,21,48,17,43,33,47,33,47,19,69,9,58,21,48,27,45,,,}
\ctexspadef{founderzhyou}{67,16,61,11,48,11,45,14,48,20,48,17,48,16,48,39,48,12,42,16,48,30,48,30,0,0,12,11,11,61,9,59,17,67,11,83,20,70,18,69,21,70,4,54,12,12,20,48,17,48,16,48,39,48,12,48,16,41,30,48,29,48,16,67,11,61,11,48,14,45,,,}
\ctexspadef{founderzhyoub}{69,18,60,10,46,13,43,16,46,17,45,20,46,18,46,31,45,13,38,14,44,29,46,30,-3,0,10,9,9,61,9,59,19,69,7,82,18,68,18,67,20,69,2,52,17,17,17,46,20,45,18,46,32,46,13,45,14,38,29,44,30,46,19,69,10,60,14,46,17,43,,,}
\ctexspadef{hanyizhsong}{69,17,59,9,59,9,60,9,62,9,65,12,69,12,64,16,63,9,54,5,59,5,59,6,0,0,13,12,12,68,12,64,17,68,17,69,18,68,18,67,17,70,7,58,10,10,10,61,14,64,11,70,16,64,10,63,6,54,5,59,5,60,17,69,8,60,8,60,9,61,,,}
\ctexspadef{hanyizhsongb}{74,13,60,13,58,10,54,10,62,10,65,13,74,4,63,10,57,10,42,10,56,7,60,7,-1,-6,15,10,15,64,14,66,10,77,10,78,10,78,10,77,13,74,8,53,14,9,10,62,13,65,9,69,10,63,10,57,10,42,7,55,7,59,13,74,13,60,10,58,10,54,,,}
\ctexspadef{hanyizhhei}{8,8,59,10,63,10,50,9,66,12,64,14,66,13,59,10,60,12,43,12,51,8,59,10,2,2,10,10,10,59,10,60,18,67,18,68,17,68,18,67,17,68,8,48,12,6,12,66,14,64,13,66,10,59,12,60,12,43,8,51,10,59,8,8,10,59,10,64,9,50,,,}
\ctexspadef{hanyizhheib}{67,18,57,8,64,13,64,8,58,11,63,15,64,15,62,15,58,10,48,5,52,3,56,5,0,0,10,11,13,63,12,62,18,67,17,68,17,69,17,69,18,69,4,54,9,9,11,58,14,64,15,65,14,63,11,58,5,48,4,51,5,57,18,67,8,56,13,64,9,63,,,}
\ctexspadef{hanyizhkai}{69,18,60,9,69,5,65,5,70,5,68,10,70,10,65,14,61,11,52,6,60,5,60,5,0,0,13,12,11,69,13,66,17,68,18,71,18,71,18,69,19,71,7,59,10,12,5,70,11,67,10,70,14,64,12,61,5,52,5,60,5,60,17,70,9,61,5,69,5,65,,,}
\ctexspadef{hanyizhfs}{70,20,64,13,59,9,60,9,62,9,65,12,70,11,64,16,63,9,54,5,59,5,59,6,0,0,13,12,13,66,14,65,19,72,20,72,20,72,20,71,20,72,9,58,5,4,10,61,14,64,10,70,16,64,10,63,6,54,5,59,5,60,20,71,12,64,8,60,9,61,,,}
\ctexspadef{maczhsong}{4,4,4,4,63,14,59,7,63,13,64,13,70,12,59,13,61,12,47,7,56,7,58,8,0,0,11,11,10,68,13,63,17,68,20,70,20,70,18,68,20,70,12,59,18,18,14,62,10,66,12,69,9,64,12,61,7,47,7,56,8,58,4,4,4,4,14,63,7,59,,,}
\ctexspadef{maczhsongb}{4,4,4,4,62,13,49,13,62,10,65,10,59,13,62,14,61,12,43,9,56,4,56,14,0,0,11,10,7,67,13,62,15,66,18,67,18,69,16,66,18,69,10,60,14,10,10,62,10,64,12,60,14,62,12,61,9,43,4,56,14,56,4,4,4,4,12,62,12,50,,,}
\ctexspadef{maczhhei}{68,15,58,4,62,13,56,6,61,11,65,12,66,16,63,12,59,14,51,5,55,5,60,10,0,0,8,11,13,60,13,62,20,70,20,70,20,70,20,70,20,70,3,54,9,10,10,62,12,65,16,65,9,66,14,60,7,48,5,55,10,60,14,68,4,58,13,62,6,56,,,}
Expand Down

0 comments on commit 1ee66c6

Please sign in to comment.