Skip to content

Commit

Permalink
Add support for noto cjk fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
skinaze committed Jun 6, 2018
1 parent f76a28a commit 7c714e0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
29 changes: 28 additions & 1 deletion Example/HustGraduPaper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
\RequirePackage{xstring}%使用条件语句
%字体组
\def\HGP@fontset{}
\def\HGP@noto{}
\DeclareOption{autofont}{}%自动设置字体
\DeclareOption{adobefont} {
\def\HGP@fontset{,fontset=adobe}
Expand All @@ -49,6 +50,31 @@
\DeclareOption{winoldfont} {
\def\HGP@fontset{,fontset=windowsold}
}%使用简体中文Windows XP或之前系统下的中易字体
\DeclareOption{notofont} {
\def\HGP@noto{
\setCJKmainfont{NotoSerifCJKsc-Regular.otf}[
BoldFont = NotoSerifCJKsc-Bold.otf,
AutoFakeBold = false
]
\setCJKsansfont{NotoSansCJKsc-Regular.otf}[
BoldFont = NotoSansCJKsc-Bold.otf,
AutoFakeBold = false
]
\setCJKmonofont{NotoSansMonoCJKsc-Regular.otf}[
BoldFont = NotoSansMonoCJKsc-Bold.otf,
AutoFakeBold = false
]
\setCJKfamilyfont{zhsong}{NotoSerifCJKsc-Regular.otf}[
BoldFont = NotoSerifCJKsc-Bold.otf,
AutoFakeBold = false
]
\setCJKfamilyfont{zhhei}{NotoSansCJKsc-Regular.otf}[
BoldFont = NotoSansCJKsc-Bold.otf,
AutoFakeBold = false
]
}
\def\HGP@fontset{}
}%使用思源宋体和思源黑体
\DeclareOption{nofont} {
\def\HGP@fontset{,fontset=none}
}%不配置中文字体,需要用户自己配置
Expand Down Expand Up @@ -101,7 +127,8 @@
BoldFont={STZhongsong},
BoldFeatures={FakeBold=4}
]

%思源字体定义与使用
\HGP@noto

%
% --- 定义页眉页脚
Expand Down
Binary file modified Example/example.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions Instruction/HGP.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
% \par\noindent\DescribeMacro{winfont} 使用简体中文Windows系统下的中文字体,自动判断Windows系统版本,采用winnewfont或winoldfont 的设置。\cite[\S 4.3]{ctexdoc}
% \par\noindent\DescribeMacro{winnewfont}使用简体中文Windows Vista或之后系统下的中易字体和微软雅黑字体。
% \par\noindent\DescribeMacro{winoldfont}使用简体中文Windows XP或之前系统下的中易字体。\cite[\S 4.3]{ctexdoc}
% \par\noindent\DescribeMacro{notofont}宋体和黑体使用Google和Adobe共同开发的思源字体,其他字体采用\CTeX 默认设置。\footnote{思源字体可以前往\href{https://ctan.org/pkg/notocjksc}{CTAN下载}(该宏包的支持还没有完成,目前只有字体)}
% \par\noindent\DescribeMacro{nofont}不配置中文字体,需要用户自己配置|\songti|和|\heiti|命令。\cite[\S 4.3]{ctexdoc}
%
% \subsection{页脚样式设置}
Expand Down
Binary file modified Instruction/HGP.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@
## 未发布的更新内容
* 在文档中添加常见问题的解决方案;
* 修改浮动体与正文之间的距离,使“在顶部”和“在底部”的浮动体与文字间有一定距离;
* 修复对于清华参考文献格式的支持;
* 修复对于清华参考文献格式的支持;
* 添加对于思源字体的支持;

0 comments on commit 7c714e0

Please sign in to comment.