From 13017cc20240974e54e5d8b49f4f5e94768ab636 Mon Sep 17 00:00:00 2001
From: atxy <181850195@smail.nju.edu.cn>
Date: Fri, 10 Sep 2021 01:46:04 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E6=89=8B=E5=8A=A8?=
 =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=AD=97=E4=BD=93=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 njuthesis.cls    |  3 ++-
 njuthesis.tex    |  6 +++---
 profile/font.sty | 27 +++++++++++++++++----------
 3 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/njuthesis.cls b/njuthesis.cls
index f3c2d97..1b0c306 100644
--- a/njuthesis.cls
+++ b/njuthesis.cls
@@ -24,7 +24,8 @@
 \DeclareStringOption[UG]{Degree}
 \DeclareStringOption[thesis]{Type}
 \DeclareBoolOption[true]{UseSysFont}
-\DeclareStringOption[windows]{CustomZhFont}\DeclareStringOption[windows]{CustomEnFont}
+\DeclareStringOption[windows]{CustomEnFont}
+\DeclareStringOption[windows]{CustomZhFont}
 
 \ProcessKeyvalOptions*\relax
 
diff --git a/njuthesis.tex b/njuthesis.tex
index cc5ce60..abdf1cf 100644
--- a/njuthesis.tex
+++ b/njuthesis.tex
@@ -19,9 +19,9 @@
     TitleLength=2,% 閫夋嫨鏍囬琛屾暟锛岃寖鍥存槸1~3
     Degree=UG,% UG: 鏈
     Type=thesis,% thesis: 姣曚笟璁烘枃锛宒esign: 姣曚笟璁捐
-    UseSysFont=false,% 鑷畾涔夊瓧浣撹鍙嶆敞閲婃椤�
-    CustomZhFont=windows,% 璁剧疆涓枃瀛楃闆�
-    CustomEnFont=windows,% 璁剧疆鑻辨枃瀛楃闆�
+    % UseSysFont=false,% 鑷畾涔夊瓧浣撹鍙嶆敞閲婃椤�
+    % CustomEnFont=windows,% 璁剧疆鑻辨枃瀛楃闆�
+    % CustomZhFont=windows,% 璁剧疆涓枃瀛楃闆�
     ]{njuthesis}
 
 % 杈撳叆涓汉淇℃伅
diff --git a/profile/font.sty b/profile/font.sty
index ed70369..a88c073 100644
--- a/profile/font.sty
+++ b/profile/font.sty
@@ -173,19 +173,26 @@
   }
 }
 \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}
-  {macos}{\set_latin_fontset_macos}
-  {gyre}{\set_latin_fontset_gyre}
+  \usingwindows{\set_latin_fontset_windows}
+  \usingmacos{\set_latin_fontset_macos}
+  \usinggyre{\set_latin_fontset_gyre}
 }
-\str_case:nn {\CustomZhFont}
+\tl_case:Nn {\CustomZhFont}
 {
-  {windows}{\set_chinese_fontset_windows}
-  {macos}{\set_chinese_fontset_macos}
-  {fandol}{\set_chinese_fontset_fandol}
-  {founder}{\set_chinese_fontset_founder}% 浣跨敤鏂规瀛椾綋
-  {noto}{\set_chinese_fontset_noto}% 浣跨敤鎬濇簮瀹嬩綋+鎬濇簮榛戜綋
+  \usingwindows{\set_chinese_fontset_windows}
+  \usingmacos{\set_chinese_fontset_macos}
+  \usingfandol{\set_chinese_fontset_fandol}
+  \usingfounder{\set_chinese_fontset_founder}% 浣跨敤鏂规瀛椾綋
+  \usingnoto{\set_chinese_fontset_noto}% 浣跨敤鎬濇簮瀹嬩綋+鎬濇簮榛戜綋
 }
 \fi
 % 鎴戞槸 Linux 鐢ㄦ埛锛屼絾鎴戠敤 Windows 瀛椾綋锛堣鎮ㄨ刀蹇潗鍒颁富甯彴涓婃潵锛�
-- 
GitLab