lib

unicodetable.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2006 Alfredo Beaumont Sainz <alfredo.beaumont@gmail.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20KFORMULA_NAMESPACE_BEGIN
21
22struct UnicodeNameTable { short unicode; const char* name; };
23
24static UnicodeNameTable greekTable[] = {
25 { 0x03B1, "alpha" },
26 { 0x03B2, "beta" },
27 { 0x03B3, "gamma" },
28 { 0x03B4, "delta" },
29 { 0x03B5, "epsilon" },
30 { 0x03F5, "varepsilon" },
31 { 0x03B6, "zeta" },
32 { 0x03B7, "eta" },
33 { 0x03B8, "theta" },
34 { 0x03D1, "vartheta" },
35 { 0x03B9, "iota" },
36 { 0x03BA, "kappa" },
37 { 0x03F0, "varkappa" },
38 { 0x03BB, "lambda" },
39 { 0x03BC, "mu" },
40 { 0x03BD, "nu" },
41 { 0x03BE, "xi" },
42 { 0x03C0, "pi" },
43 { 0x03D6, "varpi" },
44 { 0x03C1, "rho" },
45 { 0x03F1, "varrho" },
46 { 0x03C3, "sigma" },
47 { 0x03C2, "varsigma" },
48 { 0x03C4, "tau" },
49 { 0x03C5, "upsilon" },
50 { 0x03D5, "phi" },
51 { 0x03C6, "varphi" },
52 { 0x03C7, "chi" },
53 { 0x03C8, "psi" },
54 { 0x03C9, "omega" },
55 { 0x0393, "Gamma" },
56 { 0x0394, "Delta" },
57 { 0x0398, "Theta" },
58 { 0x039B, "Lambda" },
59 { 0x039E, "Xi" },
60 { 0x03A0, "Pi" },
61 { 0x03A3, "Sigma" },
62 { 0x03D2, "Upsilon" },
63 { 0x03A6, "Phi" },
64 { 0x03A8, "Psi" },
65 { 0x03A9, "Omega" },
66 { 0, 0 }
67};
68
69static UnicodeNameTable arrowTable[] = {
70 { 0x2190, "leftarrow" },
71 { 0x2191, "uparrow" },
72 { 0x2192, "rightarrow" },
73 { 0x2193, "downarrow" },
74 { 0x2194, "leftrightarrow" },
75 { 0x2195, "updownarrow" },
76 { 0x2196, "nwarrow" },
77 { 0x2197, "nearrow" },
78 { 0x2198, "searrow" },
79 { 0x2199, "swarrow" },
80 { 0x219A, "nleftarrow" },
81 { 0x219B, "nrightarrow" },
82 { 0x219C, "" },
83 { 0x219D, "rightsquigarrow" },
84 { 0x219E, "twoheadleftarrow" },
85 { 0x219F, "" },
86 { 0x21A0, "twoheadrightarrow" },
87 { 0x21A1, "" },
88 { 0x21A2, "leftarrowtail" },
89 { 0x21A3, "rightarrowtail" },
90 { 0x21A4, "" },
91 { 0x21A5, "" },
92 { 0x21A6, "mapsto" },
93 { 0x21A7, "" },
94 { 0x21A8, "" },
95 { 0x21A9, "hookleftarrow" },
96 { 0x21AA, "hookrightarrow" },
97 { 0x21AB, "looparrowleft" },
98 { 0x21AC, "looparrowright" },
99 { 0x21AD, "leftrightsquigarrow" },
100 { 0x21AE, "nleftrightarrow" },
101 { 0x21AF, "" },
102 { 0x21B0, "Lsh" },
103 { 0x21B1, "Rsh" },
104 { 0x21B2, "" },
105 { 0x21B3, "" },
106 { 0x21B4, "" },
107 { 0x21B5, "carriagereturn" },
108 { 0x21B6, "curvearrowleft" },
109 { 0x21B7, "curvearrowright" },
110 { 0x21B8, "" },
111 { 0x21B9, "" },
112 { 0x21BA, "acwopencirclearrow" },
113 { 0x21BB, "cwopencirclearrow" },
114 { 0x21BC, "leftharpoonup" },
115 { 0x21BD, "leftharpoondown" },
116 { 0x21BE, "upharpoonright" },
117 { 0x21BF, "upharpoonleft" },
118 { 0x21C0, "rightharpoonup" },
119 { 0x21C1, "rightharpoondown" },
120 { 0x21C2, "downharpoonright" },
121 { 0x21C3, "downharpoonleft" },
122 { 0x21C4, "rightleftarrows" },
123 { 0x21C5, "" },
124 { 0x21C6, "leftrightarrows" },
125 { 0x21C7, "leftleftarrows" },
126 { 0x21C8, "upuparrows" },
127 { 0x21C9, "rightrightarrows" },
128 { 0x21CA, "downdownarrows" },
129 { 0x21CB, "leftrightharpoons" },
130 { 0x21CC, "rightleftharpoons" },
131 { 0x21CD, "nLeftarrow" },
132 { 0x21CE, "nLeftrightarrow" },
133 { 0x21CF, "nRightarrow" },
134 { 0x21D0, "Leftarrow" },
135 { 0x21D1, "Uparrow" },
136 { 0x21D2, "Rightarrow" },
137 { 0x21D3, "Downarrow" },
138 { 0x21D4, "Leftrightarrow" },
139 { 0x21D5, "Updownarrow" },
140 { 0x21D6, "" },
141 { 0x21D7, "" },
142 { 0x21D8, "" },
143 { 0x21D9, "" },
144 { 0x21DA, "Lleftarrow" },
145 { 0x21DB, "Rrightarrow" },
146 { 0x21DC, "" },
147 { 0x21DD, "rightzigzagarrow" },
148 { 0x21DE, "" },
149 { 0x21DF, "" },
150 { 0x21E0, "" },
151 { 0x21E1, "" },
152 { 0x21E2, "" },
153 { 0x21E3, "" },
154 { 0x21E4, "" },
155 { 0x21E5, "" },
156 { 0x21E6, "" },
157 { 0x21E7, "" },
158 { 0x21E8, "" },
159 { 0x21E9, "" },
160 { 0x21EA, "" },
161 { 0x21EB, "" },
162 { 0x21EC, "" },
163 { 0x21ED, "" },
164 { 0x21EE, "" },
165 { 0x21EF, "" },
166 { 0x21F0, "" },
167 { 0x21F1, "" },
168 { 0x21F2, "" },
169 { 0x21F3, "" },
170 { 0x21F4, "" },
171 { 0x21F5, "" },
172 { 0x21F6, "" },
173 { 0x21F7, "" },
174 { 0x21F8, "" },
175 { 0x21F9, "" },
176 { 0x21FA, "" },
177 { 0x21FB, "" },
178 { 0x21FC, "" },
179 { 0x21FD, "" },
180 { 0x21FE, "" },
181 { 0x21FF, "" },
182 { 0, 0 }
183};
184
185/*
186 { 0x003A, "colon" },
187 { 0x003A, "colon" },
188 { 0x003C, "less" },
189 { 0x003C, "less" },
190 { 0x003E, "greater" },
191 { 0x003E, "greater" },
192 { 0x005C, "backslash" },
193 { 0x005E, "textasciicircum" },
194 { 0x007B, "lbrace" },
195 { 0x007C, "vert" },
196 { 0x007D, "rbrace" },
197 { 0x007E, "textasciitilde" },
198 { 0x00A1, "textexclamdown" },
199 { 0x00A7, "S" },
200 { 0x00AC, "neg" },
201 { 0x00B0, "degree" },
202 { 0x00B1, "pm" },
203 { 0x00B6, "P" },
204 { 0x00BF, "textquestiondown" },
205 { 0x00D7, "times" },
206 { 0x00D8, "O" },
207 { 0x00F7, "div" },
208 { 0x00F8, "o" },
209 { 0x019B, "lambdabar" },
210 { 0x0300, "grave" },
211 { 0x0301, "acute" },
212 { 0x0302, "hat" },
213 { 0x0304, "bar" },
214 { 0x030A, "ocirc" },
215 { 0x0338, "not" },
216 { 0x2013, "endash" },
217 { 0x2014, "emdash" },
218 { 0x2022, "bullet" },
219 { 0x2026, "ldots" },
220 { 0x2032, "prime" },
221 { 0x2035, "backprime" },
222 { 0x20D0, "leftharpoonaccent" },
223 { 0x20D1, "rightharpoonaccent" },
224 { 0x20D6, "overleftarrow" },
225 { 0x20D7, "vec" },
226 { 0x20E1, "overleftrightarrow" },
227 { 0x2111, "Im" },
228 { 0x2118, "wp" },
229 { 0x211C, "Re" },
230 { 0x2127, "mho" },
231 { 0x2309, "rceil" },
232 { 0x2329, "langle" },
233 { 0x232A, "rangle" },
234 { 0x24C8, "circledS" },
235 { 0x25B3, "bigtriangleup" },
236 { 0x25B4, "blacktriangle" },
237 { 0x25B5, "vartriangle" },
238 { 0x25B6, "blacktriangleright" },
239 { 0x25BD, "bigtriangledown" },
240 { 0x25BE, "blacktriangledown" },
241 { 0x25C0, "blacktriangleleft" },
242 { 0x25CB, "bigcirc" },
243 { 0x2605, "bigstar" },
244 { 0x2660, "spadesuit" },
245 { 0x2661, "heartsuit" },
246 { 0x2662, "diamondsuit" },
247 { 0x2663, "clubsuit" },
248 { 0x2666, "diamondsuit" },
249 { 0x266D, "flat" },
250 { 0x266E, "natural" },
251 { 0x266F, "sharp" },
252 { 0x2713, "checkmark" },
253 { 0x2720, "maltese" },
254 { 0xE201, "longleftarrow" },
255 { 0xE205, "longrightarrow" },
256 { 0xE29F, "gnapprox" },
257 { 0xE2A0, "gneq" },
258 { 0xE2A3, "lneq" },
259 { 0xE2A6, "ngeqslant" },
260 { 0xE2A7, "nleqslant" },
261 { 0xE2A8, "nleqq" },
262 { 0xE2B0, "nsupseteqq" },
263 { 0xE2B2, "precnapprox" },
264 { 0xE2B4, "succnapprox" },
265 { 0xE2B6, "subsetneqq" },
266 { 0xE2B7, "supsetneqq" },
267 { 0xE2B8, "varsubsetneqq" },
268 { 0xE2B9, "varsubsetneq" },
269 { 0xE2BA, "varsupsetneq" },
270 { 0xE2BB, "varsupsetneqq" },
271 { 0xE2F4, "gtrapprox" },
272 { 0xE2F5, "gtreqqless" },
273 { 0xE2F6, "geqslant" },
274 { 0xE2F8, "lessapprox" },
275 { 0xE2F9, "lesseqqgtr" },
276 { 0xE2FA, "leqslant" },
277 { 0xE2FD, "precapprox" },
278 { 0xE2FE, "preceq" },
279 { 0xE2FF, "succapprox" },
280 { 0xE300, "succeq" },
281 { 0xE304, "subseteqq" },
282 { 0xE305, "supseteqq" },
283 { 0xE5CF, "eqslantless" },
284 { 0xE5DC, "npreceq" },
285 { 0xE5F1, "nsucceq" },
286 { 0xE663, "Upsilon" },
287*/
288
289static UnicodeNameTable operatorTable[] = {
290 { 0x2200, "forall" },
291 { 0x2201, "complement" },
292 { 0x2202, "partial" },
293 { 0x2203, "exists" },
294 { 0x2204, "nexists" },
295 { 0x2205, "oslash" },
296 { 0x2206, "triangle" },
297 { 0x2207, "nabla" },
298 { 0x2208, "in" },
299 { 0x2209, "notin" },
300 { 0x220A, "in" },
301 { 0x220B, "ni" },
302 { 0x220C, "" },
303 { 0x220D, "ni" },
304 { 0x220E, "blacksquare" },
305 { 0x220F, "prod" },
306 { 0x2210, "coprod" },
307 { 0x2211, "sum" },
308 { 0x2212, "minus" },
309 { 0x2213, "mp" },
310 { 0x2214, "dotplus" },
311 { 0x2215, "slash" },
312 { 0x2216, "setminus" },
313 { 0x2217, "ast" },
314 { 0x2218, "circ" },
315 { 0x2219, "bullet" },
316 { 0x221A, "surd" },
317 { 0x221B, "" },
318 { 0x221C, "" },
319 { 0x221D, "propto" },
320 { 0x221E, "infty" },
321 { 0x221F, "" },
322 { 0x2220, "angle" },
323 { 0x2221, "measuredangle" },
324 { 0x2222, "" },
325 { 0x2223, "mid" },
326 { 0x2224, "nmid" },
327 { 0x2225, "parallel" },
328 { 0x2226, "nparallel" },
329 { 0x2227, "wedge" },
330 { 0x2228, "vee" },
331 { 0x2229, "cap" },
332 { 0x222A, "cup" },
333 { 0x222B, "int" },
334 { 0x222C, "" },
335 { 0x222D, "" },
336 { 0x222E, "oint" },
337 { 0x222F, "" },
338 { 0x2230, "" },
339 { 0x2231, "" },
340 { 0x2232, "" },
341 { 0x2233, "" },
342 { 0x2234, "therefore" },
343 { 0x2235, "because" },
344 { 0x2236, "" },
345 { 0x2237, "" },
346 { 0x2238, "" },
347 { 0x2239, "" },
348 { 0x223A, "" },
349 { 0x223B, "" },
350 { 0x223C, "sim" },
351 { 0x223D, "backsim" },
352 { 0x223E, "" },
353 { 0x223F, "" },
354 { 0x2240, "wr" },
355 { 0x2241, "" },
356 { 0x2242, "eqsim" },
357 { 0x2243, "simeq" },
358 { 0x2244, "nsime" },
359 { 0x2245, "cong" },
360 { 0x2246, "" },
361 { 0x2247, "ncong" },
362 { 0x2248, "approx" },
363 { 0x2249, "" },
364 { 0x224A, "approxeq" },
365 { 0x224B, "" },
366 { 0x224C, "" },
367 { 0x224D, "asymp" },
368 { 0x224E, "Bumpeq" },
369 { 0x224F, "bumpeq" },
370 { 0x2250, "doteq" },
371 { 0x2251, "Doteq" },
372 { 0x2252, "fallingdotseq" },
373 { 0x2253, "risingdotseq" },
374 { 0x2254, "" },
375 { 0x2255, "" },
376 { 0x2256, "eqcirc" },
377 { 0x2257, "circeq" },
378 { 0x2258, "" },
379 { 0x2259, "wedgeq" },
380 { 0x225A, "" },
381 { 0x225B, "" },
382 { 0x225C, "triangleq" },
383 { 0x225D, "" },
384 { 0x225E, "" },
385 { 0x225F, "" },
386 { 0x2260, "neq" },
387 { 0x2261, "equiv" },
388 { 0x2262, "" },
389 { 0x2263, "" },
390 { 0x2264, "leq" },
391 { 0x2265, "geq" },
392 { 0x2266, "leqq" },
393 { 0x2267, "geqq" },
394 { 0x2268, "" },
395 { 0x2269, "" },
396 { 0x226A, "ll" },
397 { 0x226B, "gg" },
398 { 0x226C, "between" },
399 { 0x226D, "" },
400 { 0x226E, "nless" },
401 { 0x226F, "ngtr" },
402 { 0x2270, "nleq" },
403 { 0x2271, "ngeq" },
404 { 0x2272, "lesssim" },
405 { 0x2273, "gtrsim" },
406 { 0x2274, "" },
407 { 0x2275, "" },
408 { 0x2276, "lessgtr" },
409 { 0x2277, "gtrless" },
410 { 0x2278, "" },
411 { 0x2279, "" },
412 { 0x227A, "prec" },
413 { 0x227B, "succ" },
414 { 0x227C, "preccurlyeq" },
415 { 0x227D, "succcurlyeq" },
416 { 0x227E, "precsim" },
417 { 0x227F, "succsim" },
418 { 0x2280, "nprec" },
419 { 0x2281, "nsucc" },
420 { 0x2282, "subset" },
421 { 0x2283, "supset" },
422 { 0x2284, "nsubset" },
423 { 0x2286, "subseteq" },
424 { 0x2287, "supseteq" },
425 { 0x2288, "nsubseteq" },
426 { 0x2289, "nsupseteq" },
427 { 0x228A, "subsetneq" },
428 { 0x228B, "supsetneq" },
429 { 0x228C, "" },
430 { 0x228D, "" },
431 { 0x228E, "uplus" },
432 { 0x228F, "sqsubset" },
433 { 0x2290, "sqsupset" },
434 { 0x2291, "sqsubseteq" },
435 { 0x2292, "sqsupseteq" },
436 { 0x2293, "sqcap" },
437 { 0x2294, "sqcup" },
438 { 0x2295, "oplus" },
439 { 0x2296, "ominus" },
440 { 0x2297, "otimes" },
441 { 0x2298, "oslash" },
442 { 0x2299, "odot" },
443 { 0x229A, "circledcirc" },
444 { 0x229B, "circledast" },
445 { 0x229C, "" },
446 { 0x229D, "circleddash" },
447 { 0x229E, "boxplus" },
448 { 0x229F, "boxminus" },
449 { 0x22A0, "boxtimes" },
450 { 0x22A1, "boxdot" },
451 { 0x22A2, "" },
452 { 0x22A3, "dashv" },
453 { 0x22A4, "top" },
454 { 0x22A5, "" },
455 { 0x22A6, "" },
456 { 0x22A7, "" },
457 { 0x22A8, "vDash" },
458 { 0x22A9, "Vdash" },
459 { 0x22AA, "Vvdash" },
460 { 0x22AB, "" },
461 { 0x22AC, "nvdash" },
462 { 0x22AD, "nvDash" },
463 { 0x22AE, "nVdash" },
464 { 0x22AF, "nVDash" },
465 { 0x22B1, "" },
466 { 0x22B2, "vartriangleleft" },
467 { 0x22B3, "vartriangleright" },
468 { 0x22B4, "trianglelefteq" },
469 { 0x22B5, "trianglerighteq" },
470 { 0x22B6, "" },
471 { 0x22B7, "" },
472 { 0x22B8, "multimap" },
473 { 0x22B9, "" },
474 { 0x22BA, "intercal" },
475 { 0x22BB, "veebar" },
476 { 0x22BC, "barwedge" },
477 { 0x22BD, "" },
478 { 0x22BE, "" },
479 { 0x22BF, "" },
480 { 0x22C1, "" },
481 { 0x22C2, "" },
482 { 0x22C3, "" },
483 { 0x22C4, "diamond" },
484 { 0x22C5, "cdot" },
485 { 0x22C6, "star" },
486 { 0x22C7, "divideontimes" },
487 { 0x22C8, "" },
488 { 0x22C9, "ltimes" },
489 { 0x22CA, "rtimes" },
490 { 0x22CB, "leftthreetimes" },
491 { 0x22CC, "rightthreetimes" },
492 { 0x22CD, "backsimeq" },
493 { 0x22CE, "curlyvee" },
494 { 0x22CF, "curlywedge" },
495 { 0x22D0, "Subset" },
496 { 0x22D1, "Supset" },
497 { 0x22D2, "Cap" },
498 { 0x22D3, "Cup" },
499 { 0x22D4, "pitchfork" },
500 { 0x22D5, "" },
501 { 0x22D6, "lessdot" },
502 { 0x22D7, "gtrdot" },
503 { 0x22D8, "lll" },
504 { 0x22D9, "ggg" },
505 { 0x22DA, "lesseqgtr" },
506 { 0x22DB, "gtreqless" },
507 { 0x22DC, "eqless" },
508 { 0x22DD, "eqgtr" },
509 { 0x22DE, "curlyeqprec" },
510 { 0x22DF, "curlyeqsucc" },
511 { 0x22E0, "" },
512 { 0x22E1, "" },
513 { 0x22E2, "" },
514 { 0x22E3, "" },
515 { 0x22E4, "" },
516 { 0x22E5, "" },
517 { 0x22E6, "lnsim" },
518 { 0x22E7, "gnsim" },
519 { 0x22E8, "precnsim" },
520 { 0x22E9, "succnsim" },
521 { 0x22EA, "ntriangleleft" },
522 { 0x22EB, "ntriangleright" },
523 { 0x22EC, "ntrianglelefteq" },
524 { 0x22ED, "ntrianglerighteq" },
525 { 0x22EE, "vdots" },
526 { 0x22EF, "cdots" },
527 { 0x22F0, "adots" },
528 { 0x22F1, "ddots" },
529 { 0x22F2, "" },
530 { 0x22F3, "" },
531 { 0x22F4, "" },
532 { 0x22F5, "" },
533 { 0x22F6, "" },
534 { 0x22F7, "" },
535 { 0x22F8, "" },
536 { 0x22F9, "" },
537 { 0x22FA, "" },
538 { 0x22FB, "" },
539 { 0x22FC, "" },
540 { 0x22FD, "" },
541 { 0x22FE, "" },
542 { 0x22FF, "" },
543 { 0, 0 }
544};
545
546KFORMULA_NAMESPACE_END