diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/char-enc.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/char-enc.lua | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/char-enc.lua b/Master/texmf-dist/tex/context/base/char-enc.lua index 45f404ee985..ef6805e54f3 100644 --- a/Master/texmf-dist/tex/context/base/char-enc.lua +++ b/Master/texmf-dist/tex/context/base/char-enc.lua @@ -6,11 +6,14 @@ if not modules then modules = { } end modules ['char-syn'] = { license = "see context related readme files" } --- thanks to tex4ht for these mappings +-- Thanks to tex4ht for these mappings. -characters = characters or { } +local allocate, setinitializer = utilities.storage.allocate, utilities.storage.setinitializer -characters.synonyms = { +characters = characters or { } +local characters = characters + +characters.synonyms = allocate { -- afm mess angle = 0x2220, anticlockwise = 0x21BA, arrowaxisleft = 0x2190, @@ -141,23 +144,42 @@ characters.synonyms = { Yen = 0x00A5, } -if not characters.enccodes then +--~ if not characters.enccodes then +--~ +--~ local enccodes = { } characters.enccodes = enccodes +--~ +--~ for unicode, data in next, characters.data do +--~ local encname = data.adobename or data.contextname +--~ if encname then +--~ enccodes[encname] = unicode +--~ end +--~ end +--~ +--~ for name, unicode in next, characters.synonyms do +--~ if not enccodes[name] then enccodes[name] = unicode end +--~ end +--~ +--~ +--~ end +--~ +--~ storage.register("characters.enccodes", characters.enccodes, "characters.enccodes") + +-- As this table is seldom used, we can delay its definition. Beware, this means +-- that table.print would not work on this file unless it is accessed once. This +-- why the serializer does a dummy access. - local enccodes = { } +local enccodes = allocate() characters.enccodes = enccodes +local function initialize() for unicode, data in next, characters.data do local encname = data.adobename or data.contextname if encname then enccodes[encname] = unicode end end - for name, unicode in next, characters.synonyms do if not enccodes[name] then enccodes[name] = unicode end end - - characters.enccodes = enccodes - end -storage.register("characters.enccodes", characters.enccodes, "characters.enccodes") +setinitializer(enccodes,initialize) |