Skip to content
Snippets Groups Projects
Commit 13017cc2 authored by Yu Xiong's avatar Yu Xiong :confounded:
Browse files

feat: 完成手动指定字体功能

parent adf63bc0
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
\DeclareStringOption[UG]{Degree} \DeclareStringOption[UG]{Degree}
\DeclareStringOption[thesis]{Type} \DeclareStringOption[thesis]{Type}
\DeclareBoolOption[true]{UseSysFont} \DeclareBoolOption[true]{UseSysFont}
\DeclareStringOption[windows]{CustomZhFont}\DeclareStringOption[windows]{CustomEnFont} \DeclareStringOption[windows]{CustomEnFont}
\DeclareStringOption[windows]{CustomZhFont}
\ProcessKeyvalOptions*\relax \ProcessKeyvalOptions*\relax
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
TitleLength=2,% 选择标题行数,范围是1~3 TitleLength=2,% 选择标题行数,范围是1~3
Degree=UG,% UG: 本科 Degree=UG,% UG: 本科
Type=thesis,% thesis: 毕业论文,design: 毕业设计 Type=thesis,% thesis: 毕业论文,design: 毕业设计
UseSysFont=false,% 自定义字体请反注释此项 % UseSysFont=false,% 自定义字体请反注释此项
CustomZhFont=windows,% 设置文字符集 % CustomEnFont=windows,% 设置文字符集
CustomEnFont=windows,% 设置文字符集 % CustomZhFont=windows,% 设置文字符集
]{njuthesis} ]{njuthesis}
% 输入个人信息 % 输入个人信息
......
...@@ -173,19 +173,26 @@ ...@@ -173,19 +173,26 @@
} }
} }
\else% 如果用户需要自定义 \else% 如果用户需要自定义
\str_case:nn {\CustomEnFont} % tl_case:Nn 只能实现宏和宏之间的比较,不能直接实现字符串和宏的比较,无奈出此下策,希望之后能找到更优雅的写法
\tl_const:Nn \usingwindows {windows}
\tl_const:Nn \usingmacos {macos}
\tl_const:Nn \usingfandol {fandol}
\tl_const:Nn \usinggyre {gyre}
\tl_const:Nn \usingfounder {founder}
\tl_const:Nn \usingnoto {noto}
\tl_case:Nn {\CustomEnFont}
{ {
{windows}{\set_latin_fontset_windows} \usingwindows{\set_latin_fontset_windows}
{macos}{\set_latin_fontset_macos} \usingmacos{\set_latin_fontset_macos}
{gyre}{\set_latin_fontset_gyre} \usinggyre{\set_latin_fontset_gyre}
} }
\str_case:nn {\CustomZhFont} \tl_case:Nn {\CustomZhFont}
{ {
{windows}{\set_chinese_fontset_windows} \usingwindows{\set_chinese_fontset_windows}
{macos}{\set_chinese_fontset_macos} \usingmacos{\set_chinese_fontset_macos}
{fandol}{\set_chinese_fontset_fandol} \usingfandol{\set_chinese_fontset_fandol}
{founder}{\set_chinese_fontset_founder}% 使用方正字体 \usingfounder{\set_chinese_fontset_founder}% 使用方正字体
{noto}{\set_chinese_fontset_noto}% 使用思源宋体+思源黑体 \usingnoto{\set_chinese_fontset_noto}% 使用思源宋体+思源黑体
} }
\fi \fi
% 我是 Linux 用户,但我用 Windows 字体(请您赶快坐到主席台上来) % 我是 Linux 用户,但我用 Windows 字体(请您赶快坐到主席台上来)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment