-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathctex-fontset-sourcesans.def
121 lines (117 loc) · 5.28 KB
/
ctex-fontset-sourcesans.def
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
%%
%% This is file `ctex-fontset-sourcesans.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ctex.dtx (with options: `fontset,sourcesans')
%%
%% Copyright (C) 2003--2019
%% CTEX.ORG and any individual authors listed in the documentation.
%% ------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%% http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainers of this work are sd44 <[email protected]>.
%% 本字体配置文件根据原ctex的字体配置文件修改,使用思源宋体、思源黑体、方正新楷体、方正粗楷、Fandol仿宋字体。
%% 请确保以上字体已安装。其中的方正粗楷作为方正新楷体的粗体实现(楷体默认没有粗体)。
%% 思源宋体和思源黑体我采用的是多语言OTF版本中的CN子集,也就是SourceHanSerifCN和SourceHanSansCN。
%% 以上字体均可以酌情更换。Linux系统下请注意字体文件名的大小写。
%% 注意:方正新楷体和方正粗楷可以在方正官网以普通个人用户身份以3元价格获得,
%% 或以设计师身份免费获得GB2312字符集版本。但两种方式均为个人非商业使用。
%% ------------------------------------------------------------------------------
%%
\GetIdInfo$Id: ctex.dtx 6471e87 2018-05-21 18:15:18 +0800 sd44 <[email protected] $
{Sourcesans fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-sourcesans.def}
{\ExplFileDate}{2.4.7}{\ExplFileDescription}
\sys_if_engine_pdftex:TF
{
\sys_if_output_pdf:TF
{ \ctex_fontset_error:n { sourcesans } }
{
\ctex_zhmap_case:nnn
{
\setCJKmainfont
[
BoldFont = SourceHanSerifCN-Bold.otf ,
ItalicFont = FZXKTK.otf
] { SourceHanSerifCN-Regular.otf }
\setCJKsansfont
[
BoldFont = SourceHanSansSC-Bold.otf
] { SourceHanSansSC-Regular.otf }
\setCJKmonofont [ cmap = UniGB-UTF16-H ] { FandolFang-Regular.otf }
\setCJKfamilyfont { zhsong }
[
BoldFont = SourceHanSerifCN-Bold.otf
] { SourceHanSerifCN-Regular.otf }
\setCJKfamilyfont { zhhei }
[
BoldFont = SourceHanSansSC-Bold.otf
] { SourceHanSansSC-Regular.otf }
\setCJKfamilyfont { zhfs }
[ cmap = UniGB-UTF16-H ] { FandolFang-Regular.otf }
\setCJKfamilyfont { zhkai }
[
cmap = UniGB-UTF16-H,
BoldFont = FZCKJ.otf
] { FZXKTK.otf }
\ctex_punct_set:n { sourcesans }
\ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
\ctex_punct_map_family:nn { \CJKsfdefault } { zhhei }
\ctex_punct_map_family:nn { \CJKttdefault } { zhfs }
\ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
\ctex_punct_map_bfseries:nn { \CJKrmdefault , zhsong } { zhsongb }
\ctex_punct_map_bfseries:nn { \CJKsfdefault , zhhei } { zhheib }
}
{
\ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { zhfandolfonts }
\ctex_punct_set:n { sourcesans }
\ctex_punct_map_family:nn { \CJKrmdefault } { zhsong }
\ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei }
\ctex_punct_map_itshape:nn { \CJKrmdefault } { zhkai }
}
{ \ctex_fontset_error:n { sourcesans } }
}
}
{
\sys_if_engine_uptex:TF
{
\ctex_set_upfonts:nnnnnnn
{SourceHanSerifCN-Regular.otf} {SourceHanSerifCN-Bold.otf}
{FZXKTK.otf} {FZCKJ.otf}
{SourceHanSansSC-Regular.otf} {SourceHanSansSC-Bold.otf}
{FandolFang-Regular.otf}
\ctex_set_upfamily:nnn { zhsong } { upzhserif } { upzhserifb }
\ctex_set_upfamily:nnn { zhhei } { upzhsans } { upzhsansb }
\ctex_set_upfamily:nnn { zhfs } { upzhmono} {}
\ctex_set_upfamily:nnn { zhkai } { upzhserifit } {}
}
{
\setCJKmainfont [ItalicFont = FZNewKai-Z03]{ Source~Han~Serif~CN }
\setCJKsansfont { Source~Han~Sans~SC }
\setCJKmonofont [ Extension = .otf ] { FandolFang-Regular }
\setCJKfamilyfont { zhsong }{ Source~Han~Serif~CN }
\setCJKfamilyfont { zhhei } { Source~Han~Sans~SC }
\setCJKfamilyfont { zhfs } [ Extension = .otf ] { FandolFang-Regular }
\setCJKfamilyfont { zhkai } [BoldFont=FZCuKaiS-R-GB]{ FZNewKai-Z03 }
}
}
\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
%%
%%
%% End of file `ctex-fontset-sourcesans.def'.