summaryrefslogtreecommitdiff
path: root/tex/context/fonts/demo.lfg
blob: c76a58d25b0b8b6b8db9c310edc575a73fba6012 (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
50
51
52
53
54
55
56
57
58
59
60
local yes = "yes"

local default = {
    analyze  = yes,
    mode     = "node",
    language = "dflt",
    script   = "dflt",
}

local smallcaps = {
    smcp = yes,
}

local report_statistics = logs.reporter("fonts","statistics")

local function statistics(tfmdata)
    for k, v in table.sortedpairs(tfmdata) do
        if type(v) == "table" then
            report_statistics("%s: <table>",k)
        else
            report_statistics("%s: %s",k,tostring(v))
        end
    end
end

local function squeeze(tfmdata)
    for k, v in next, tfmdata.characters do
        v.height = 0.75 * (v.height or 0)
        v.depth  = 0.75 * (v.depth  or 0)
    end
end

return {
    name = "demo",
    version = "1.00",
    comment = "An example of goodies.",
    author = "Hans Hagen",
    featuresets = {
        default = {
            default,
        },
        smallcaps = {
            default, smallcaps,
        },
    },
    colorschemes = {
        default = {
            [1] = {
                "one", "three", "five", "seven", "nine",
            },
            [2] = {
                "two", "four", "six", "eight", "ten",
            },
        }
    },
    postprocessors = {
        statistics = statistics,
        squeeze    = squeeze,
    },
}