summaryrefslogtreecommitdiff
path: root/doc/context/presentations/context/2017/context-2017-features-chaintest.tex
blob: 58d1040f2a759a04720992e3658571ade5b87e55 (plain)
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
\setupbodyfont[dejavu]

\startluacode
    fonts.handlers.otf.addfeature {
        name    = "chaintest",
        type    = "chainposition",
        lookups = {
            {
                type = "pair",
                data = {
                    A = { B = { { -30, 0, -50, 0 } } },
                    B = { C = { { -30, 0, -50, 0 } } },
                },
            },
            {
                type = "pair",
                data = {
                    D = { E = { { -30, 0, -50, 0 } } },
                },
            },
        },
        data = {
            rules = {
                {
                    current = { { "A"}, { "B"}, { "C" }, { "D" }, { "E" }, { "F" } },
                    lookups = { false, false, false, 2 },
                },
                {
                    current = { { "A" }, { "B" }, { "C" } },
                    lookups = { 1, 1 },
                },
            },
        }
    }
\stopluacode

\starttext

\definecolor[tgray][s=.5,t=.5,a=1] \showfontkerns \showglyphs

\definefontfeature[chaintest] [mode=node,chaintest=yes]

\definedfont[file:dejavu-serif.ttf*chaintest @ 48pt]

\startTEXpage[offset=10pt,foregroundcolor=tgray]
    ABCDEF
\stopTEXpage

\stoptext