color-latin.lfg /size: 1372 b    last modification: 2024-01-16 09:03
1-- If needed we can add names glyphs (maybe some wildcard mapping) ... not that fast
2-- but for a specific font one can always make a dedicated file.
3
4local type = type
5local imerged = table.imerged
6
7local shapes  = { }
8local default = { }
9local upper   = { }
10local lower   = { }
11local accents = { }
12
13for k, v in next, characters.data do
14    local sh = v.shcode
15    if sh and type(sh) == "number" then
16        local tsh = shapes[sh]
17        if tsh then
18            tsh[#tsh+1] = k
19        else
20            shapes[sh] = { sh, k }
21        end
22    end
23--     if v.category == ".." then
24--         accents[1][k] = ..
25--     end
26end
27
28for i=1,26 do
29    local l = shapes[65 + i - 1] or { }
30    local u = shapes[97 + i - 1] or { }
31    upper[i] = u
32    lower[i] = l
33    default[i] = imerged(l, u)
34end
35
36-- default = {
37--     [1] = { codepoint, ..., glyph_name, ... },
38--     [2] = { codepoint, ..., glyph_name, ... },
39--     ...
40-- }
41
42local accents = { -- todo
43    [1] = {
44        "0x0300:0x0311",
45    },
46}
47
48return {
49    name         = "color-latin",
50    version      = "1.00",
51    comment      = "Side effect of mails from Marcus Vinicius Mesquita to the list.",
52    author       = "Hans Hagen",
53    copyright    = "ConTeXt development team",
54    colorschemes = {
55         default = default,
56         upper   = upper,
57         lower   = lower,
58         accents = accents,
59     }
60}
61