context-2017-features-spacetest.tex /size: 962 b    last modification: 2024-01-16 09:02
1\setupbodyfont[dejavu]
2
3\startluacode
4
5    -- we could populate this one mostly automatic if needed
6    -- but also expect a font to have such kerns
7
8    local kern = -50
9    local pair = { [32] = kern }
10
11    fonts.handlers.otf.addfeature {
12        name    = "kern", -- spacekerns assume kern (for now)
13        type    = "kern",
14        data    = {
15            D = pair,
16            E = pair,
17            F = pair,
18            [32] = {
19                D = kern,
20                E = kern,
21                F = kern,
22            },
23        }
24    }
25
26\stopluacode
27
28\starttext
29
30\enabledirectives[fonts.injections.usespacefontkerns]
31
32\definecolor[tgray][s=.5,t=.5,a=1] \showfontkerns \showfontitalics \showglyphs
33
34\definefontfeature[kern] [mode=node,kern=yes,spacekerns=yes]
35
36\definedfont[file:dejavu-serif.ttf*kern @ 48pt]
37\definedfont[file:dejavu-serif.ttf*default @ 48pt]
38
39\startTEXpage[offset=10pt,foregroundcolor=tgray]
40    A B C D E F G H
41\stopTEXpage
42
43\stoptext
44