-
Notifications
You must be signed in to change notification settings - Fork 339
/
cjkfonts.sty
153 lines (120 loc) · 4.47 KB
/
cjkfonts.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
% cjkfonts.sty
%
% A XeLaTeX package for typesetting CJK documents.
%
% Options:
% default: boolean option, cjkfonts is set as the default font family and as the sans serif family for CJK text.
% Identification
% ==============
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cjkfonts}[2015/12/12 A simple XeLaTeX package to set CJK fonts]
% Required Packages
% =================
\RequirePackage{ifthen}
\RequirePackage{xeCJK}
% Set key-value options
\RequirePackage{kvoptions}
\DeclareBoolOption[false]{default}
\ProcessKeyvalOptions*
%% Configuration for parindent
%% ===========================
\def\elegant@CJKChar@size{\hskip \f@size \p@}
\newdimen\elegant@CJKChar@size@dimen
\settowidth\elegant@CJKChar@size@dimen{\elegant@CJKChar@size\CJKglue}
\setlength{\parindent}{2\elegant@CJKChar@size@dimen}
%% Configuration for fonts
%% =======================
\newCJKfontfamily[NotoSansSC]\NotoSansSC[
UprightFont=NotoSansCJKsc-Light,
BoldFont=NotoSansCJKsc-Bold,
ItalicFont=NotoSansCJKsc-Light,
BoldItalicFont=NotoSansCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSansSC}
\newCJKfontfamily[NotoSansMonoSC]\NotoSansMonoSC[
UprightFont=NotoSansMonoCJKsc-Regular,
BoldFont=NotoSansMonoCJKsc-Bold,
ItalicFont=NotoSansMonoCJKsc-Regular,
BoldItalicFont=NotoSansMonoCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSansMonoSC}
\newCJKfontfamily[NotoSansSCThin]\NotoSansSCThin[
UprightFont=NotoSansCJKsc-Thin,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCLight]\NotoSansSCLight[
UprightFont=NotoSansCJKsc-Light,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCDemiLight]\NotoSansSCDemiLight[
UprightFont=NotoSansCJKsc-DemiLight,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCRegular]\NotoSansSCRegular[
UprightFont=NotoSansCJKsc-Regular,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCMedium]\NotoSansSCMedium[
UprightFont=NotoSansCJKsc-Medium,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCBold]\NotoSansSCBold[
UprightFont=NotoSansCJKsc-Bold,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansSCBlack]\NotoSansSCBlack[
UprightFont=NotoSansCJKsc-Black,
AutoFakeSlant=true]{NotoSansSC}
\newCJKfontfamily[NotoSansMonoSCRegular]\NotoSansMonoSCRegular[
UprightFont=NotoSansMonoCJKsc-Regular,
AutoFakeSlant=true]{NotoSansMonoSCRegular}
\newCJKfontfamily[NotoSansMonoSCBold]\NotoSansMonoSCBold[
UprightFont=NotoSansMonoCJKsc-Bold,
AutoFakeSlant=true]{NotoSansMonoSCBold}
\newCJKfontfamily[NotoSerifSC]\NotoSerifSC[
UprightFont=NotoSerifCJKsc-Light,
BoldFont=NotoSerifCJKsc-Bold,
ItalicFont=NotoSerifCJKsc-Light,
BoldItalicFont=NotoSerifCJKsc-Bold,
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCThin]\NotoSerifSCThin[
UprightFont=NotoSerifCJKsc-Thin,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCLight]\NotoSerifSCLight[
UprightFont=NotoSerifCJKsc-Light,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCDemiLight]\NotoSerifSCDemiLight[
UprightFont=NotoSerifCJKsc-DemiLight,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCRegular]\NotoSerifSCRegular[
UprightFont=NotoSerifCJKsc-Regular,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCMedium]\NotoSerifSCMedium[
UprightFont=NotoSerifCJKsc-Medium,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCBold]\NotoSerifSCBold[
UprightFont=NotoSerifCJKsc-Bold,
AutoFakeSlant=true]{NotoSerifSC}
\newCJKfontfamily[NotoSerifSCBlack]\NotoSerifSCBlack[
UprightFont=NotoSerifCJKsc-Black,
AutoFakeSlant=true]{NotoSerifSC}
\ifthenelse{\boolean{cjkfonts@default}}{
\setCJKmainfont[
UprightFont={NotoSerifCJKsc-Light},
BoldFont={NotoSerifCJKsc-Bold},
ItalicFont={NotoSerifCJKsc-Light},
BoldItalicFont={NotoSerifCJKsc-Bold},
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSerifSC}
\setCJKsansfont[
UprightFont={NotoSansCJKsc-Light},
BoldFont={NotoSansCJKsc-Bold},
ItalicFont={NotoSansCJKsc-Light},
BoldItalicFont={NotoSansCJKsc-Bold},
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSansSC}
\setCJKmonofont[
UprightFont={NotoSansCJKsc-Light},
BoldFont={NotoSansCJKsc-Bold},
ItalicFont={NotoSansCJKsc-Light},
BoldItalicFont={NotoSansCJKsc-Bold},
ItalicFeatures=FakeSlant,
BoldItalicFeatures=FakeSlant]{NotoSansMonoSC}
}{}
%% This must be the last command
\endinput