-
Notifications
You must be signed in to change notification settings - Fork 10
/
t-zhfonts.mkiv
36 lines (31 loc) · 1.03 KB
/
t-zhfonts.mkiv
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
%D \module
%D [ file=t-zhfonts,
%D version=2023.02.28,
%D title=\CONTEXT\ User Module,
%D subtitle=zhfonts,
%D author=Li Yanrui,
%D date=\currentdate,
%D copyright=Li Yanrui,
%D email=liyanrui.m2@gmail.com,
%D license=Public Domain]
\writestatus{loading}{ConTeXt User Module / zhfonts}
\startmodule[zhfonts]
\unprotect
\setupmodule[family=rm,size=11pt]
\ctxloadluafile{t-zhfonts}
\edef\@@@@??family{\currentmoduleparameter{family}}
\edef\@@@@??size{\currentmoduleparameter{size}}
\def\setupzhfonts{\dodoubleempty\dosetupzhfonts}
\def\dosetupzhfonts[#1][#2]{%
\ctxlua{moduledata.zhfonts.setup ('#1', '#2')}
}
\def\zhfonts[#1]{\ctxlua{moduledata.zhfonts.main ('#1')}}
\def\showzhfonts{\typebuffer[zhfonts:typescript][option=TeX]}
% 使得 zhfonts 默认字体设置生效
\prependtoks\zhfonts[\@@@@??family,\@@@@??size]\to\everystarttext
\protect
% 顺便启用中文界面(章节、图、表标签)
\mainlanguage[cn]
\setuplabeltext[cn][chapter={{第 },{ 章}}]
\stopmodule
\endinput