4 /* Copyright (C) 2002, 2003, 2004
5 Free Software Foundation, Inc.
6 Written by Werner Lemberg <wl@gnu.org>
8 This file is part of groff.
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING. If not, write to the Free Software
22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
25 #include "stringclass.h"
30 struct unicode_to_glyph
{
34 declare_ptable(unicode_to_glyph
)
35 implement_ptable(unicode_to_glyph
)
37 PTABLE(unicode_to_glyph
) unicode_to_glyph_table
;
42 } unicode_to_glyph_list
[] = {
77 { "003D_0338", "!=" },
83 { "0041_0300", "`A" },
84 { "0041_0301", "'A" },
85 { "0041_0302", "^A" },
86 { "0041_0303", "~A" },
87 { "0041_0308", ":A" },
88 { "0041_030A", "oA" },
91 { "0043_0301", "'C" },
92 { "0043_0327", ",C" },
95 { "0045_0300", "`E" },
96 { "0045_0301", "'E" },
97 { "0045_0302", "^E" },
98 { "0045_0308", ":E" },
103 { "0049_0300", "`I" },
104 { "0049_0301", "'I" },
105 { "0049_0302", "^I" },
106 { "0049_0308", ":I" },
112 { "004E_0303", "~N" },
114 { "004F_0300", "`O" },
115 { "004F_0301", "'O" },
116 { "004F_0302", "^O" },
117 { "004F_0303", "~O" },
118 { "004F_0308", ":O" },
123 { "0053_030C", "vS" },
126 { "0055_0300", "`U" },
127 { "0055_0301", "'U" },
128 { "0055_0302", "^U" },
129 { "0055_0308", ":U" },
134 { "0059_0301", "'Y" },
135 { "0059_0308", ":Y" },
137 { "005A_030C", "vZ" },
153 { "0061_0300", "`a" },
154 { "0061_0301", "'a" },
155 { "0061_0302", "^a" },
156 { "0061_0303", "~a" },
157 { "0061_0308", ":a" },
158 { "0061_030A", "oa" },
161 { "0063_0301", "'c" },
162 { "0063_0327", ",c" },
165 { "0065_0300", "`e" },
166 { "0065_0301", "'e" },
167 { "0065_0302", "^e" },
168 { "0065_0308", ":e" },
170 { "0066_0066", "ff" },
171 { "0066_0066_0069", "Fi" },
172 { "0066_0066_006C", "Fl" },
173 { "0066_0069", "fi" },
174 { "0066_006C", "fl" },
178 { "0069_0300", "`i" },
179 { "0069_0301", "'i" },
180 { "0069_0302", "^i" },
181 { "0069_0308", ":i" },
187 { "006E_0303", "~n" },
189 { "006F_0300", "`o" },
190 { "006F_0301", "'o" },
191 { "006F_0302", "^o" },
192 { "006F_0303", "~o" },
193 { "006F_0308", ":o" },
198 { "0073_030C", "vs" },
201 { "0075_0300", "`u" },
202 { "0075_0301", "'u" },
203 { "0075_0302", "^u" },
204 { "0075_0308", ":u" },
209 { "0079_0301", "'y" },
210 { "0079_0308", ":y" },
212 { "007A_030C", "vz" },
362 //{ "210F", "hbar" },
391 { "2208_0338", "nm" },
393 { "220F", "product" },
394 { "2210", "coproduct" },
409 //{ "222B", "integral" },
418 { "2261_0338", "ne" },
424 { "2282_0338", "nb" },
426 { "2283_0338", "nc" },
437 { "239B", "parenlefttp" },
438 { "239C", "parenleftex" },
439 { "239D", "parenleftbt" },
440 { "239E", "parenrighttp" },
441 { "239F", "parenrightex" },
442 { "23A0", "parenrightbt" },
443 //{ "23A1", "bracketlefttp" },
444 { "23A2", "bracketleftex" },
445 //{ "23A3", "bracketleftbt" },
446 //{ "23A4", "bracketrighttp" },
447 { "23A5", "bracketrightex" },
448 //{ "23A6", "bracketrightbt" },
450 //{ "23A7", "bracelefttp" },
452 //{ "23A8", "braceleftmid" },
454 //{ "23A9", "braceleftbt" },
456 //{ "23AA", "braceex" },
457 //{ "23AA", "braceleftex" },
458 //{ "23AA", "bracerightex" },
460 //{ "23AB", "bracerighttp" },
462 //{ "23AC", "bracerightmid" },
464 //{ "23AD", "bracerightbt" },
487 // global constructor
488 static struct unicode_to_glyph_init
{
489 unicode_to_glyph_init();
490 } _unicode_to_glyph_init
;
492 unicode_to_glyph_init::unicode_to_glyph_init() {
493 for (unsigned int i
= 0;
494 i
< sizeof(unicode_to_glyph_list
)/sizeof(unicode_to_glyph_list
[0]);
496 unicode_to_glyph
*utg
= new unicode_to_glyph
[1];
497 utg
->value
= (char *)unicode_to_glyph_list
[i
].value
;
498 unicode_to_glyph_table
.define(unicode_to_glyph_list
[i
].key
, utg
);
502 const char *unicode_to_glyph_name(const char *s
)
504 unicode_to_glyph
*result
= unicode_to_glyph_table
.lookup(s
);
505 return result
? result
->value
: 0;