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

fix: 只针对Windows应用思源字体

parent 2d2b0a34
No related branches found
No related tags found
No related merge requests found
%\ProvidesExplPackage{profile/font}{-9-4}{0.1}{SomethingsIwrote} %\ProvidesExplPackage{profile/font}{-9-4}{0.1}{SomethingsIwrote}
% 覆盖 ctex 字体设置
\RequireXeTeX \RequireXeTeX
% 设置西文字体
\setmainfont{Times~New~Roman}
\setsansfont{Arial}
\setmonofont{Courier~New}[Scale=MatchLowercase]
% 思源宋体 https://www.google.com/get/noto/#serif-hans % 覆盖 ctex 字体设置
\setCJKmainfont[ \newcommand\use_fontset_windows{
% 设置西文字体
\setmainfont{Times~New~Roman}
\setsansfont{Arial}
\setmonofont{Courier~New}[Scale=MatchLowercase]
% 设置中文字体
% 思源宋体 https://www.google.com/get/noto/#serif-hans
\setCJKmainfont[
UprightFont=NotoSerifCJKsc-Regular, UprightFont=NotoSerifCJKsc-Regular,
BoldFont=NotoSerifCJKsc-Bold, BoldFont=NotoSerifCJKsc-Bold,
ItalicFont=NotoSerifCJKsc-Regular, ItalicFont=NotoSerifCJKsc-Regular,
...@@ -16,8 +19,8 @@ ...@@ -16,8 +19,8 @@
ItalicFeatures=FakeSlant, ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{Noto~Serif~CJK~SC} BoldItalicFeatures=FakeSlant]{Noto~Serif~CJK~SC}
% 思源黑体 https://www.google.com/get/noto/#sans-hans % 思源黑体 https://www.google.com/get/noto/#sans-hans
\setCJKsansfont[ \setCJKsansfont[
UprightFont=NotoSansCJKsc-Regular, UprightFont=NotoSansCJKsc-Regular,
BoldFont=NotoSansCJKsc-Bold, BoldFont=NotoSansCJKsc-Bold,
ItalicFont=NotoSansCJKsc-Regular, ItalicFont=NotoSansCJKsc-Regular,
...@@ -25,7 +28,8 @@ ...@@ -25,7 +28,8 @@
ItalicFeatures=FakeSlant, ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{Noto~Sans~CJK~SC} BoldItalicFeatures=FakeSlant]{Noto~Sans~CJK~SC}
\setCJKmonofont[ % 包含于上述思源黑体
\setCJKmonofont[
UprightFont=NotoSansMonoCJKsc-Regular, UprightFont=NotoSansMonoCJKsc-Regular,
BoldFont=NotoSansMonoCJKsc-Bold, BoldFont=NotoSansMonoCJKsc-Bold,
ItalicFont=NotoSansMonoCJKsc-Regular, ItalicFont=NotoSansMonoCJKsc-Regular,
...@@ -33,99 +37,80 @@ ...@@ -33,99 +37,80 @@
ItalicFeatures=FakeSlant, ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{Noto~Sans~Mono~SC} BoldItalicFeatures=FakeSlant]{Noto~Sans~Mono~SC}
\setCJKfamilyfont{zhsong}{Noto~Serif~CJK~SC} \setCJKfamilyfont{zhsong}{Noto~Serif~CJK~SC}
\setCJKfamilyfont{zhhei}{Noto~Sans~CJK~SC} \setCJKfamilyfont{zhhei}{Noto~Sans~CJK~SC}
% \setCJKfamilyfont{zhfs}{FangSong} \setCJKfamilyfont{zhfs}{FangSong}
\setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf] % 楷体使用方正楷体简体,为免费商用字体,且支持CJK字符集
\setCJKfamilyfont{zhkai}{FandolKai-Regular}[Extension=.otf]} % http://www.foundertype.com/index.php/FontInfo/index/id/137.html
% 楷体使用方正楷体简体,为免费商用字体,且支持CJK字符集 \setCJKfamilyfont{zhkai}{FZKTJW--GB1-0}[AutoFakeBold=2.17]
% http://www.foundertype.com/index.php/FontInfo/index/id/137.html \setCJKfamilyfont{zhnewhei}{Microsoft~YaHei}[BoldFont=Microsoft~YaHei~Bold]
% \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{ \newcommand\use_fontset_macos{
% % 设置西文字体 % 设置西文字体
% \setmainfont{Times~New~Roman} \setmainfont{Times~New~Roman}
% \setsansfont{Arial} \setsansfont{Arial}
% \setmonofont{Menlo}[Scale=MatchLowercase] \setmonofont{Menlo}[Scale=MatchLowercase]
% % 设置中文字体 % 设置中文字体
% \setCJKmainfont{Songti~SC~Light}[BoldFont=Songti~SC~Bold, ItalicFont=Kaiti~SC, BoldItalicFont=Kaiti~SC~Bold] \setCJKmainfont{Songti~SC~Light}[BoldFont=Songti~SC~Bold, ItalicFont=Kaiti~SC, BoldItalicFont=Kaiti~SC~Bold]
% \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium] \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
% \setCJKmonofont{STFangsong} \setCJKmonofont{STFangsong}
% \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold] \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
% \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium] \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
% \setCJKfamilyfont{zhfs}{STFangsong} \setCJKfamilyfont{zhfs}{STFangsong}
% \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold] \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
% \setCJKfamilyfont{zhnewhei}{PingFang~SC} \setCJKfamilyfont{zhnewhei}{PingFang~SC}
% } }
% \newcommand\use_fontset_linux{ \newcommand\use_fontset_linux{
% % 移除 does not contain script "CJK" 警告 % 移除 does not contain script "CJK" 警告
% \msg_redirect_name:nnn {fontspec} {no-script} {info} \msg_redirect_name:nnn {fontspec} {no-script} {info}
% % 设置西文字体 % 设置西文字体
% \setmainfont{texgyretermes}[ \setmainfont{texgyretermes}[
% Extension=.otf, Extension=.otf,
% UprightFont=*-regular, UprightFont=*-regular,
% BoldFont=*-bold, BoldFont=*-bold,
% ItalicFont=*-italic, ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic] BoldItalicFont=*-bolditalic]
% \setsansfont{texgyreheros}[ \setsansfont{texgyreheros}[
% Extension=.otf, Extension=.otf,
% UprightFont=*-regular, UprightFont=*-regular,
% BoldFont=*-bold, BoldFont=*-bold,
% ItalicFont=*-italic, ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic] BoldItalicFont=*-bolditalic]
% \setmonofont{texgyrecursor}[ \setmonofont{texgyrecursor}[
% Extension=.otf, Extension=.otf,
% UprightFont=*-regular, UprightFont=*-regular,
% BoldFont=*-bold, BoldFont=*-bold,
% ItalicFont=*-italic, ItalicFont=*-italic,
% BoldItalicFont=*-bolditalic, BoldItalicFont=*-bolditalic,
% Scale=MatchLowercase, Scale=MatchLowercase,
% Ligatures=CommonOff] Ligatures=CommonOff]
% % 设置中文字体 % 设置中文字体
% \setCJKmainfont{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold,ItalicFont=FandolKai-Regular] \setCJKmainfont{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold,ItalicFont=FandolKai-Regular]
% \setCJKsansfont{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold] \setCJKsansfont{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold]
% \setCJKmonofont{FandolFang-Regular}[Extension=.otf] \setCJKmonofont{FandolFang-Regular}[Extension=.otf]
% \setCJKfamilyfont{zhsong}{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold] \setCJKfamilyfont{zhsong}{FandolSong-Regular}[Extension=.otf,BoldFont=FandolSong-Bold]
% \setCJKfamilyfont{zhhei}{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold] \setCJKfamilyfont{zhhei}{FandolHei-Regular}[Extension=.otf,BoldFont=FandolHei-Bold]
% \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf] \setCJKfamilyfont{zhfs}{FandolFang-Regular}[Extension=.otf]
% \setCJKfamilyfont{zhkai}{FandolKai-Regular}[Extension=.otf]} \setCJKfamilyfont{zhkai}{FandolKai-Regular}[Extension=.otf]}
% % 检测是否是 Windows % 检测是否是 Windows
% \sys_if_platform_windows:TF \sys_if_platform_windows:TF
% { {
% \use_fontset_windows \use_fontset_windows
% } }
% { {
% % 检测是否是 MacOS % 检测是否是 MacOS
% \ctex_if_platform_macos:TF \ctex_if_platform_macos:TF
% { {
% \use_fontset_macos \use_fontset_macos
% } }
% % 其余系统一律识别为 Linux % 其余系统一律识别为 Linux
% { {
% \use_fontset_linux \use_fontset_linux
% } }
% } }
\NewDocumentCommand\songti{}{\CJKfamily{zhsong}} \NewDocumentCommand\songti{}{\CJKfamily{zhsong}}
\NewDocumentCommand\heiti{}{\CJKfamily{zhhei}} \NewDocumentCommand\heiti{}{\CJKfamily{zhhei}}
......
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