Skip to content

Commit

Permalink
fix: Temporary fix for font issues on Overleaf.
Browse files Browse the repository at this point in the history
With the fix, this project can now be compiled over Overleaf.
  • Loading branch information
NotoOotori committed Apr 16, 2023
1 parent 4384632 commit 1a244be
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 36 deletions.
Binary file modified tjuthesis-example.pdf
Binary file not shown.
112 changes: 76 additions & 36 deletions tjuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
% -------------------- Identification --------------------

\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesClass{tjuthesis}[2022/11/03 0.1.2 Tongji University Thesis Template]
\ProvidesClass{tjuthesis}[2023/04/16 0.1.3 Tongji University Thesis Template]

% -------------------- Preliminary Declarations --------------------

Expand All @@ -45,7 +45,7 @@
\fi


\newcommand\version{0.1.2}
\newcommand\version{0.1.3}
\newcommand\DocumentClass{article}


Expand Down Expand Up @@ -436,8 +436,9 @@
ItalicFont = \tju@font@name@it,
BoldItalicFont = \tju@font@name@bfit,
]
\setsansfont{Arial}%
\setmonofont{Courier New}[Scale = MatchLowercase]%
%\setsansfont{Helvetica}%
%\setsansfont{texgyreheros-regular.otf}[Scale=MatchLowercase]
%\setmonofont{Courier New}[Scale = MatchLowercase]%
}
\tju@load@font
\tju@option@hook{font}{%
Expand Down Expand Up @@ -513,38 +514,77 @@
\newcommand\tju@cjk@embolden@factor{4}
\newcommand\tju@load@cjk@font@windows{%
\xeCJKsetup{EmboldenFactor = \tju@cjk@embolden@factor}
\setCJKmainfont{SimSun}[
BoldFont = SimHei,
ItalicFont = KaiTi,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = KaiTi,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\setCJKsansfont{SimHei}[AutoFakeBold]%
\setCJKmonofont{FangSong}[
AutoFakeBold = true,
ItalicFont = KaiTi,
]%
\newCJKfontfamily\zhsong{SimSun}[
AutoFakeBold = true,
ItalicFont = KaiTi,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = KaiTi,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newfontfamily\songti{SimSun}[
AutoFakeBold = true,
ItalicFont = SimSun,
]
\newCJKfontfamily\zhhei{SimHei}[
BoldFont = SimHei,
BoldFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newCJKfontfamily\zhkai{KaiTi}[AutoFakeBold]%
\newCJKfontfamily\zhfs{FangSong}[
AutoFakeBold = true,
ItalicFont = KaiTi,
]%
\IfFontExistsTF{SimSun}{%
\setCJKmainfont{SimSun}[
BoldFont = SimHei,
ItalicFont = KaiTi,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = KaiTi,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\setCJKsansfont{SimHei}[AutoFakeBold]%
\setCJKmonofont{FangSong}[
AutoFakeBold = true,
ItalicFont = KaiTi,
]%
\newCJKfontfamily\zhsong{SimSun}[
AutoFakeBold = true,
ItalicFont = KaiTi,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = KaiTi,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newfontfamily\songti{SimSun}[
AutoFakeBold = true,
ItalicFont = SimSun,
]
\newCJKfontfamily\zhhei{SimHei}[
BoldFont = SimHei,
BoldFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newCJKfontfamily\zhkai{KaiTi}[AutoFakeBold]%
\newCJKfontfamily\zhfs{FangSong}[
AutoFakeBold = true,
ItalicFont = KaiTi,
]%
}{%
\setCJKmainfont{FandolSong-Regular}[
Extension = .otf,
BoldFont = FandolSong-Bold,
ItalicFont = FandolKai-Regular,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = FandolKai-Regular,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\setCJKsansfont{FandolHei-Regular.otf}[AutoFakeBold]%
\setCJKmonofont{FandolFang-Regular.otf}[
AutoFakeBold = true,
ItalicFont = FandolKai-Regular.otf,
]%
\newCJKfontfamily\zhsong{FandolSong-Regular}[
Extension = .otf,
AutoFakeBold = true,
ItalicFont = FandolKai-Regular,
% ItalicFeatures = { AutoFakeBold = true },
BoldItalicFont = FandolKai-Regular,
BoldItalicFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newfontfamily\songti{FandolSong-Regular}[
Extension = .otf,
AutoFakeBold = true,
ItalicFont = FandolKai-Regular,
]
\newCJKfontfamily\zhhei{FandolHei-Regular}[
Extension = .otf,
BoldFont = FandolHei-Regular,
BoldFeatures = { FakeBold = \tju@cjk@embolden@factor },
]%
\newCJKfontfamily\zhkai{FandolKai-Regular.otf}[AutoFakeBold]%
\newCJKfontfamily\zhfs{FandolFang-Regular.otf}[
AutoFakeBold = true,
ItalicFont = FandolKai-Regular.otf,
]%
}%
}
\newcommand\tju@load@cjk@font{%
\@nameuse{tju@load@cjk@font@\tju@cjk@font}%
Expand Down

0 comments on commit 1a244be

Please sign in to comment.