summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-mis.lua
blob: 02a5b60dbb3a13b2ac76fbe1f53eec21458f6f94 (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
if not modules then modules = { } end modules ['luatex-font-mis'] = {
    version   = 1.001,
    comment   = "companion to luatex-*.tex",
    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
}

if context then
    texio.write_nl("fatal error: this module is not for context")
    os.exit()
end

local currentfont  = font.current

local hashes       = fonts.hashes
local identifiers  = hashes.identifiers or { }
local marks        = hashes.marks       or { }

hashes.identifiers = identifiers
hashes.marks       = marks

table.setmetatableindex(marks,function(t,k)
    if k == true then
        return marks[currentfont()]
    else
        local resources = identifiers[k].resources or { }
        local marks = resources.marks or { }
        t[k] = marks
        return marks
    end
end)