1
2
3
4
5
6
7
8
9
10
11
12
13
14\startmodule[fontsfeatures]
15
16\registerctxluafile{sfontsfeatures}{}
17
18\installmodulecommandluasingle \showusedfeatures {moduledata.fonts.features.showused}
19\installmodulecommandluasingle \showallkerns {moduledata.fonts.features.showallkerns}
20\installmodulecommandluasingle \showbasekerns {moduledata.fonts.features.showbasekerns}
21\installmodulecommandluasingle \showallligatures {moduledata.fonts.features.showallligatures}
22\installmodulecommandluasingle \showfeatureset {moduledata.fonts.features.showfeatureset}
23
24\def\kernpairheight{.8\strutht}
25\def\kernpairdepth {.8\strutdp}
26\def\kernpairwidth {\onepoint}
27
28\unexpanded\def\showkernpair#1#2#3
29 {\dontleavehmode
30 \hbox \bgroup
31 \scratchdimen#2\scaledpoint
32 \kern\fontcharwd\font#1\relax
33 \ifdim\scratchdimen>\zeropoint
34 \bgroup
35 \darkgreen
36 \vrule width \scratchdimen height \kernpairheight depth \kernpairdepth
37 \egroup
38 \kern\scratchdimen
39 \else\ifdim\scratchdimen<\zeropoint
40 \kern\scratchdimen
41 \bgroup
42 \darkred
43 \vrule width \scratchdimen height \kernpairheight depth \kernpairdepth
44 \egroup
45 \else
46 \kern.5\dimexpr\kernpairwidth\relax
47 \bgroup
48 \darkblue
49 \vrule width \kernpairwidth height \kernpairheight depth \kernpairdepth
50 \egroup
51 \kern.5\dimexpr\kernpairwidth\relax
52 \fi\fi
53 \kern\fontcharwd\font#1\relax
54 \char#1\relax
55 \char#3\relax
56 \egroup
57 \space}
58
59\stopmodule
60
61\continueifinputfile{sfontsfeatures.mkiv}
62
63\usemodule
64 [art01]
65
66\starttext
67
68 \showusedfeatures \page
69
70 \definefontfeature[defaultbase][default][mode=base]
71
72 \start
73 \definedfont[Serif*defaultbase]
74 \showbasekerns
75 \page
76 \stop
77
78 \start
79 \bf
80 \showallkerns
81 \page
82 \stop
83
84\stoptext
85 |