font-imp-checks.lmt /size: 1148 b    last modification: 2024-01-16 10:22
1if not modules then modules = { } end modules ['font-imp-checks'] = {
2    version   = 1.001,
3    comment   = "companion to font-ini.mkiv",
4    author    = "Hans Hagen, PRAGMA ADE",
5    copyright = "ConTeXt Development Team",
6    license   = "see context related readme files"
7}
8
9if not context then return end
10
11local function initialize(tfmdata,value)
12    if value then
13        local characters = tfmdata.characters
14        if not characters[0x2012] then
15            local data = characters[0x2013]
16            local zero = characters[0x0030]
17            if data and zero then
18                local copy  = table.copy(data)
19                local width = zero.width or 0
20                if width > 0 then
21                    characters[0x2012] = copy
22                    copy.effect = {
23                        extend = width/copy.width
24                    }
25                    copy.width = width
26                end
27            end
28        end
29   end
30end
31
32fonts.handlers.otf.features.register {
33    name        = "checkmissing",
34    description = "checkmissing",
35    manipulators = {
36        base = initialize,
37        node = initialize,
38    }
39}
40
41