font-ini.lua /size: 1770 b    last modification: 2023-12-21 09:44
1if not modules then modules = { } end modules ['font-ini'] = {
2    version   = 1.001,
3    comment   = "companion to font-ini.mkiv",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files"
7}
8
9-- Not much is happening here.
10
11local allocate    = utilities.storage.allocate
12local sortedhash  = table.sortedhash
13
14fonts             = fonts or { }
15local fonts       = fonts
16
17local identifiers = allocate()
18
19fonts.hashes      = fonts.hashes     or { identifiers = identifiers }
20fonts.tables      = fonts.tables     or { }
21fonts.helpers     = fonts.helpers    or { }
22fonts.tracers     = fonts.tracers    or { } -- for the moment till we have move to moduledata
23fonts.specifiers  = fonts.specifiers or { } -- in format !
24
25fonts.analyzers   = { } -- not needed here
26fonts.readers     = { }
27fonts.definers    = { methods = { } }
28fonts.loggers     = { register = function() end }
29
30if context then
31
32    font.originaleach = font.each
33
34    function font.each()
35        return sortedhash(identifiers)
36    end
37
38    fontloader = nil
39
40end
41
42-- Outside context one can bump textbase to some higher value but only the
43-- textbase given here is officially supported (read: bug testing etc will
44-- use the values below).
45
46fonts.privateoffsets = {
47    textbase      = 0xF0000, -- used for hidden (opentype features)
48    textextrabase = 0xFD000, -- used for visible by name
49    mathextrabase = 0xFE000, -- used for visible by code
50    mathbase      = 0xFF000, -- used for hidden (virtual math)
51    keepnames     = false,   -- when set to true names are always kept (not for context)
52}
53
54if node and not tex.getfontoffamily then
55    tex.getfontoffamily = node.family_font -- we moved this
56end
57