summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/char-enc.lua
blob: c2061891ad4a407cc2baf0caa62c930492fad08e (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
if not modules then modules = { } end modules ['char-enc'] = {
    version   = 1.001,
    comment   = "companion to char-ini.mkiv",
    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
 -- dataonly  = true,
}

-- Thanks to tex4ht for these mappings.

local next = next

local allocate, setinitializer = utilities.storage.allocate, utilities.storage.setinitializer

characters       = characters or { }
local characters = characters

characters.synonyms = allocate { -- afm mess
    angle              = 0x2220,
    anticlockwise      = 0x21BA,
    arrowaxisleft      = 0x2190,
    arrowaxisright     = 0x2192,
    arrowparrleftright = 0x21C6,
    arrowparrrightleft = 0x21C4,
    arrowtailleft      = 0x21A2,
    arrowtailright     = 0x21A3,
    arrowtripleleft    = 0x21DA,
    arrowtripleright   = 0x21DB,
    axisshort          = 0x2212,
    because            = 0x2235,
    between            = 0x226C,
    check              = 0x2713,
    circleasteris      = 0x229B,
    circleequal        = 0x2257,
    circleminus        = 0x229D,
    circleR            = 0x24C7,
    circlering         = 0x229A,
    circleS            = 0x24C8,
    clockwise          = 0x21BB,
    complement         = 0x2201,
    curlyleft          = 0x21AB,
    curlyright         = 0x21AC,
    dblarrowdwn        = 0x21CA,
    dblarrowheadleft   = 0x219E,
    dblarrowheadright  = 0x21A0,
    dblarrowleft       = 0x21C7,
    dblarrowright      = 0x21C9,
    dblarrowup         = 0x21C8,
    defines            = 0x225C,
    diamond            = 0x2662,
    diamondsolid       = 0x2666,
    difference         = 0x224F,
    dotplus            = 0x2214,
    downfall           = 0x22CE,
    equaldotleftright  = 0x2252,
    equaldotrightleft  = 0x2253,
    equalorfollows     = 0x22DF,
    equalorgreater     = 0x22DD,
    equalorless        = 0x22DC,
    equalorprecedes    = 0x22DE,
    equalsdots         = 0x2251,
    followsorcurly     = 0x227D,
    followsorequal     = 0x227F,
    forces             = 0x22A9,
    forcesbar          = 0x22AA,
    fork               = 0x22D4,
    frown              = 0x2322,
    geomequivalent     = 0x224E,
    greaterdbleqlless  = 0x22Da,
    greaterdblequal    = 0x2267,
    greaterlessequal   = 0x22DA,
    greaterorapproxeql = 0x227F,
    greaterorequalslant= 0x2265,
    greaterorless      = 0x2277,
    greaterorsimilar   = 0x2273,
    harpoondownleft    = 0x21C3,
    harpoondownright   = 0x21C2,
    harpoonleftright   = 0x21CC,
    harpoonrightleft   = 0x21CB,
    harpoonupleft      = 0x21BF,
    harpoonupright     = 0x21BE,
    intercal           = 0x22BA,
    intersectiondbl    = 0x22D2,
    lessdbleqlgreater  = 0x22DB,
    lessdblequal       = 0x2266,
    lessequalgreater   = 0x22DB,
    lessorapproxeql    = 0x227E,
    lessorequalslant   = 0x2264,
    lessorgreater      = 0x2276,
    lessorsimilar      = 0x2272,
    maltesecross       = 0xFFFD,
    measuredangle      = 0x2221,
    muchgreater        = 0x22D9,
    muchless           = 0x22D8,
    multimap           = 0x22B8,
    multiopenleft      = 0x22CB,
    multiopenright     = 0x22CC,
    nand               = 0x22BC,
    orunderscore       = 0x22BB,
    perpcorrespond     = 0x2259,
    precedesorcurly    = 0x227C,
    precedesorequal    = 0x227E,
    primereverse       = 0x2035,
    proportional       = 0x221D,
    revasymptequal     = 0x2243,
    revsimilar         = 0x223D,
    rightanglene       = 0x231D,
    rightanglenw       = 0x231C,
    rightanglese       = 0x231F,
    rightanglesw       = 0x231E,
    ringinequal        = 0x2256,
    satisfies          = 0x22A8,
    shiftleft          = 0x21B0,
    shiftright         = 0x21B1,
    smile              = 0x2323,
    sphericalangle     = 0x2222,
    square             = 0x25A1,
    squaredot          = 0x22A1,
    squareimage        = 0x228F,
    squareminus        = 0x229F,
    squaremultiply     = 0x22A0,
    squareoriginal     = 0x2290,
    squareplus         = 0x229E,
    squaresmallsolid   = 0x25AA,
    squaresolid        = 0x25A0,
    squiggleleftright  = 0x21AD,
    squiggleright      = 0x21DD,
    star               = 0x22C6,
    subsetdbl          = 0x22D0,
    subsetdblequal     = 0x2286,
    supersetdbl        = 0x22D1,
    supersetdblequa    = 0x2287,
    therefore          = 0x2234,
    triangle           = 0x25B5,
    triangledownsld    = 0x25BE,
    triangleinv        = 0x25BF,
    triangleleft       = 0x25C3,
    triangleleftequal  = 0x22B4,
    triangleleftsld    = 0x25C2,
    triangleright      = 0x25B9,
    trianglerightequal = 0x22B5,
    trianglerightsld   = 0x25B8,
    trianglesolid      = 0x25B4,
    uniondbl           = 0x22D3,
    uprise             = 0x22CF,
    Yen                = 0x00A5,
}

-- 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      = allocate()
characters.enccodes = enccodes

 -- maybe omit context name -> then same as encodings.make_unicode_vector

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
end

setinitializer(enccodes,initialize)