Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NJUThesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Danson Liao
NJUThesis
Commits
2d2b0a34
Commit
2d2b0a34
authored
3 years ago
by
Yu Xiong
Browse files
Options
Downloads
Patches
Plain Diff
add: 尝试将字体改为思源宋体与思源黑体
parent
d9236043
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
profile/font.sty
+122
-78
122 additions, 78 deletions
profile/font.sty
with
122 additions
and
78 deletions
profile/font.sty
+
122
−
78
View file @
2d2b0a34
%\ProvidesExplPackage{profile/font}{-9-4}{0.1}{SomethingsIwrote}
% 覆盖 ctex 字体设置
\newcommand\use
_
fontset
_
windows
{
% 设置西文字体
\setmainfont
{
Times~New~Roman
}
\setsansfont
{
Arial
}
\setmonofont
{
Courier~New
}
[Scale=MatchLowercase]
% 设置中文字体
\setCJKmainfont
{
SimSun
}
[AutoFakeBold=true, ItalicFont=KaiTi]
\setCJKsansfont
{
SimHei
}
\setCJKmonofont
{
FangSong
}
\setCJKfamilyfont
{
zhsong
}{
SimSun
}
[AutoFakeBold=2.17]
\setCJKfamilyfont
{
zhhei
}{
SimHei
}
\setCJKfamilyfont
{
zhfs
}{
FangSong
}
\setCJKfamilyfont
{
zhkai
}{
KaiTi
}
[AutoFakeBold=2.17]
\setCJKfamilyfont
{
zhnewhei
}{
Microsoft~YaHei
}
[BoldFont=Microsoft~YaHei~Bold]
}
\RequireXeTeX
% 设置西文字体
\setmainfont
{
Times~New~Roman
}
\setsansfont
{
Arial
}
\setmonofont
{
Courier~New
}
[Scale=MatchLowercase]
\newcommand\use
_
fontset
_
macos
{
% 设置西文字体
\setmainfont
{
Times~New~Roman
}
\setsansfont
{
Arial
}
\setmonofont
{
Menlo
}
[Scale=MatchLowercase]
% 设置中文字体
\setCJKmainfont
{
Songti~SC~Light
}
[BoldFont=Songti~SC~Bold, ItalicFont=Kaiti~SC, BoldItalicFont=Kaiti~SC~Bold]
\setCJKsansfont
{
Heiti~SC~Light
}
[BoldFont=Heiti~SC~Medium]
\setCJKmonofont
{
STFangsong
}
\setCJKfamilyfont
{
zhsong
}{
Songti~SC~Light
}
[BoldFont=Songti~SC~Bold]
\setCJKfamilyfont
{
zhhei
}{
Heiti~SC~Light
}
[BoldFont=Heiti~SC~Medium]
\setCJKfamilyfont
{
zhfs
}{
STFangsong
}
\setCJKfamilyfont
{
zhkai
}{
Kaiti~SC
}
[BoldFont=Kaiti~SC~Bold]
\setCJKfamilyfont
{
zhnewhei
}{
PingFang~SC
}
}
% 思源宋体 https://www.google.com/get/noto/#serif-hans
\setCJKmainfont
[
UprightFont=NotoSerifCJKsc-Regular,
BoldFont=NotoSerifCJKsc-Bold,
ItalicFont=NotoSerifCJKsc-Regular,
BoldItalicFont=NotoSerifCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]
{
Noto~Serif~CJK~SC
}
\newcommand\use
_
fontset
_
linux
{
% 移除 does not contain script "CJK" 警告
\msg
_
redirect
_
name:nnn
{
fontspec
}
{
no-script
}
{
info
}
% 设置西文字体
\setmainfont
{
texgyretermes
}
[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]
\setsansfont
{
texgyreheros
}
[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]
\setmonofont
{
texgyrecursor
}
[
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic,
Scale=MatchLowercase,
Ligatures=CommonOff]
% 设置中文字体
\setCJKmainfont
{
FandolSong-Regular
}
[Extension=.otf,BoldFont=FandolSong-Bold,ItalicFont=FandolKai-Regular]
\setCJKsansfont
{
FandolHei-Regular
}
[Extension=.otf,BoldFont=FandolHei-Bold]
\setCJKmonofont
{
FandolFang-Regular
}
[Extension=.otf]
\setCJKfamilyfont
{
zhsong
}{
FandolSong-Regular
}
[Extension=.otf,BoldFont=FandolSong-Bold]
\setCJKfamilyfont
{
zhhei
}{
FandolHei-Regular
}
[Extension=.otf,BoldFont=FandolHei-Bold]
\setCJKfamilyfont
{
zhfs
}{
FandolFang-Regular
}
[Extension=.otf]
\setCJKfamilyfont
{
zhkai
}{
FandolKai-Regular
}
[Extension=.otf]
}
% 思源黑体 https://www.google.com/get/noto/#sans-hans
\setCJKsansfont
[
UprightFont=NotoSansCJKsc-Regular,
BoldFont=NotoSansCJKsc-Bold,
ItalicFont=NotoSansCJKsc-Regular,
BoldItalicFont=NotoSansCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]
{
Noto~Sans~CJK~SC
}
\setCJKmonofont
[
UprightFont=NotoSansMonoCJKsc-Regular,
BoldFont=NotoSansMonoCJKsc-Bold,
ItalicFont=NotoSansMonoCJKsc-Regular,
BoldItalicFont=NotoSansMonoCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]
{
Noto~Sans~Mono~SC
}
% 检测是否是 Windows
\sys
_
if
_
platform
_
windows:TF
{
\use
_
fontset
_
windows
}
{
% 检测是否是 MacOS
\ctex
_
if
_
platform
_
macos:TF
{
\use
_
fontset
_
macos
}
% 其余系统一律识别为 Linux
{
\use
_
fontset
_
linux
}
}
\setCJKfamilyfont
{
zhsong
}{
Noto~Serif~CJK~SC
}
\setCJKfamilyfont
{
zhhei
}{
Noto~Sans~CJK~SC
}
% \setCJKfamilyfont{zhfs}{FangSong}
\setCJKfamilyfont
{
zhfs
}{
FandolFang-Regular
}
[Extension=.otf]
\setCJKfamilyfont
{
zhkai
}{
FandolKai-Regular
}
[Extension=.otf]
}
% 楷体使用方正楷体简体,为免费商用字体,且支持CJK字符集
% http://www.foundertype.com/index.php/FontInfo/index/id/137.html
% \setCJKfamilyfont{zhkai}{FZKTJW--GB1-0}[AutoFakeBold=2.17]
% \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[BoldFont=Microsoft~YaHei~Bold]
% \newcommand\use_fontset_windows{
% % 设置西文字体
% \setmainfont{Times~New~Roman}
% \setsansfont{Arial}
% \setmonofont{Courier~New}[Scale=MatchLowercase]
% % 设置中文字体
% \setCJKmainfont{SimSun}[AutoFakeBold=true, ItalicFont=KaiTi]
% \setCJKsansfont{SimHei}
% \setCJKmonofont{FangSong}
% \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold=2.17]
% \setCJKfamilyfont{zhhei}{SimHei}
% \setCJKfamilyfont{zhfs}{FangSong}
% \setCJKfamilyfont{zhkai}{KaiTi}[AutoFakeBold=2.17]
% \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[BoldFont=Microsoft~YaHei~Bold]
% }
% \newcommand\use_fontset_macos{
% % 设置西文字体
% \setmainfont{Times~New~Roman}
% \setsansfont{Arial}
% \setmonofont{Menlo}[Scale=MatchLowercase]
% % 设置中文字体
% \setCJKmainfont{Songti~SC~Light}[BoldFont=Songti~SC~Bold, ItalicFont=Kaiti~SC, BoldItalicFont=Kaiti~SC~Bold]
% \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
% \setCJKmonofont{STFangsong}
% \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
% \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
% \setCJKfamilyfont{zhfs}{STFangsong}
% \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
% \setCJKfamilyfont{zhnewhei}{PingFang~SC}
% }
% \newcommand\use_fontset_linux{
% % 移除 does not contain script "CJK" 警告
% \msg_redirect_name:nnn {fontspec} {no-script} {info}
% % 设置西文字体
% \setmainfont{texgyretermes}[
% Extension=.otf,
% UprightFont=*-regular,
% BoldFont=*-bold,
% ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic]
% \setsansfont{texgyreheros}[
% Extension=.otf,
% UprightFont=*-regular,
% BoldFont=*-bold,
% ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic]
% \setmonofont{texgyrecursor}[
% Extension=.otf,
% UprightFont=*-regular,
% BoldFont=*-bold,
% ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic,
% Scale=MatchLowercase,
% Ligatures=CommonOff]
% % 设置中文字体
% \setCJKmainfont{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold,ItalicFont=FandolKai-Regular]
% \setCJKsansfont{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold]
% \setCJKmonofont{FandolFang-Regular}[Extension=.otf]
% \setCJKfamilyfont{zhsong}{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold]
% \setCJKfamilyfont{zhhei}{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold]
% \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
% \setCJKfamilyfont{zhkai}{FandolKai-Regular}[Extension=.otf]}
% % 检测是否是 Windows
% \sys_if_platform_windows:TF
% {
% \use_fontset_windows
% }
% {
% % 检测是否是 MacOS
% \ctex_if_platform_macos:TF
% {
% \use_fontset_macos
% }
% % 其余系统一律识别为 Linux
% {
% \use_fontset_linux
% }
% }
\NewDocumentCommand\songti
{}{
\CJKfamily
{
zhsong
}}
\NewDocumentCommand\heiti
{}{
\CJKfamily
{
zhhei
}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment