1 /* $Vendor-Id: chars.in,v 1.35 2010/09/15 13:10:30 kristaps Exp $ */
3 * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 * The ASCII translation tables. STRING corresponds to predefined
20 * strings (cf. mdoc_samples.7 and tmac/mdoc/doc-nroff). CHAR
21 * corresponds to special characters (cf. groff_char.7). BOTH contains
22 * sequences that are equivalent in both STRING and CHAR.
24 * Either way, the left-hand side corresponds to the input sequence (\x,
25 * \(xx, \*(xx and so on) whose length is listed second element. The
26 * right-hand side is what's produced by the front-end, with the fourth
27 * element being its length.
29 * XXX - C-escape strings!
30 * XXX - update LINES_MAX if adding more!
33 /* Non-breaking, non-collapsing space uses unit separator. */
34 static const char ascii_nbrsp[2] = { ASCII_NBRSP, '\0' };
41 CHAR(" ", ascii_nbrsp, 160)
42 CHAR("~", ascii_nbrsp, 160)
50 CHAR("a\"", "\"", 779)
69 CHAR("Bq", ",,", 8222)
71 BOTH("lq", "``", 8220)
72 BOTH("rq", "\'\'", 8221)
74 CHAR("cq", "\'", 8217)
90 CHAR("braceex", "|", 9130)
91 CHAR("bracketlefttp", "|", 9121)
92 CHAR("bracketleftbp", "|", 9123)
93 CHAR("bracketleftex", "|", 9122)
94 CHAR("bracketrighttp", "|", 9124)
95 CHAR("bracketrightbp", "|", 9126)
96 CHAR("bracketrightex", "|", 9125)
97 CHAR("lt", ",-", 9127)
98 CHAR("bracelefttp", ",-", 9127)
100 CHAR("braceleftmid", "{", 9128)
101 CHAR("lb", ",-", 9129)
102 CHAR("braceleftbp", "`-", 9129)
103 CHAR("braceleftex", "|", 9130)
104 CHAR("rt", "-.", 9131)
105 CHAR("bracerighttp", "-.", 9131)
106 CHAR("rk", "}", 9132)
107 CHAR("bracerightmid", "}", 9132)
108 CHAR("rb", "-\'", 9133)
109 CHAR("bracerightbp", "-\'", 9133)
110 CHAR("bracerightex", "|", 9130)
111 CHAR("parenlefttp", "/", 9115)
112 CHAR("parenleftbp", "\\", 9117)
113 CHAR("parenleftex", "|", 9116)
114 CHAR("parenrighttp", "\\", 9118)
115 CHAR("parenrightbp", "/", 9120)
116 CHAR("parenrightex", "|", 9119)
118 /* Greek characters. */
122 CHAR("*D", "/\\", 916)
129 CHAR("*L", "/\\", 923)
134 CHAR("*P", "TT", 928)
139 CHAR("*F", "O_", 934)
153 CHAR("*l", "\\", 955)
170 CHAR("+e", "e", 1013)
173 /* Accented letters. */
193 CHAR("\'A", "A", 193)
194 CHAR("\'E", "E", 201)
195 CHAR("\'I", "I", 205)
196 CHAR("\'O", "O", 211)
197 CHAR("\'U", "U", 218)
198 CHAR("\'a", "a", 225)
199 CHAR("\'e", "e", 233)
200 CHAR("\'i", "i", 237)
201 CHAR("\'o", "o", 243)
202 CHAR("\'u", "u", 250)
230 /* Arrows and lines. */
231 CHAR("<-", "<-", 8592)
232 CHAR("->", "->", 8594)
233 CHAR("<>", "<>", 8596)
234 CHAR("da", "v", 8595)
235 BOTH("ua", "^", 8593)
236 BOTH("va", "^v", 8597)
237 CHAR("lA", "<=", 8656)
238 CHAR("rA", "=>", 8658)
239 CHAR("hA", "<=>", 8660)
240 CHAR("dA", "v", 8659)
241 CHAR("uA", "^", 8657)
242 CHAR("vA", "^=v", 8661)
245 CHAR("AN", "^", 8743)
246 CHAR("OR", "v", 8744)
248 CHAR("tno", "~", 172)
249 CHAR("te", "3", 8707)
250 CHAR("fa", "V", 8704)
251 CHAR("st", "-)", 8715)
252 CHAR("tf", ".:.", 8756)
253 CHAR("3d", ".:.", 8756)
258 CHAR("mi", "-", 8722)
260 CHAR("-+", "-+", 8723)
261 CHAR("+-", "+-", 177)
262 CHAR("t+-", "+-", 177)
264 CHAR("md", ".", 8901)
266 CHAR("tmu", "x", 215)
267 CHAR("c*", "x", 8855)
268 CHAR("c+", "+", 8853)
269 CHAR("di", "-:-", 247)
270 CHAR("tdi", "-:-", 247)
271 CHAR("f/", "/", 8260)
272 CHAR("**", "*", 8727)
273 BOTH("<=", "<=", 8804)
274 BOTH(">=", ">=", 8805)
275 CHAR("<<", "<<", 8810)
276 CHAR(">>", ">>", 8811)
278 CHAR("!=", "!=", 8800)
279 CHAR("==", "==", 8801)
280 CHAR("ne", "!==", 8802)
281 CHAR("=~", "=~", 8773)
282 CHAR("-~", "-~", 8771)
283 CHAR("ap", "~", 8764)
284 CHAR("~~", "~~", 8776)
285 CHAR("~=", "~=", 8780)
286 CHAR("pt", "oc", 8733)
287 CHAR("es", "{}", 8709)
288 CHAR("mo", "E", 8712)
289 CHAR("nm", "!E", 8713)
290 CHAR("sb", "(=", 8834)
291 CHAR("nb", "(!=", 8836)
292 CHAR("sp", "=)", 8835)
293 CHAR("nc", "!=)", 8837)
294 CHAR("ib", "(=", 8838)
295 CHAR("ip", "=)", 8839)
296 CHAR("ca", "(^)", 8745)
297 CHAR("cu", "U", 8746)
298 CHAR("/_", "/_", 8736)
299 CHAR("pp", "_|_", 8869)
300 CHAR("is", "I", 8747)
301 CHAR("integral", "I", 8747)
302 CHAR("sum", "E", 8721)
303 CHAR("product", "TT", 8719)
304 CHAR("coproduct", "U", 8720)
305 CHAR("gr", "V", 8711)
306 CHAR("sr", "\\/", 8730)
307 CHAR("sqrt", "\\/", 8730)
308 CHAR("lc", "|~", 8968)
309 CHAR("rc", "~|", 8969)
310 CHAR("lf", "|_", 8970)
311 CHAR("rf", "_|", 8971)
312 CHAR("if", "oo", 8734)
313 CHAR("Ah", "N", 8501)
314 CHAR("Im", "I", 8465)
315 CHAR("Re", "R", 8476)
316 CHAR("pd", "a", 8706)
317 CHAR("-h", "/h", 8463)
320 CHAR("ff", "ff", 64256)
321 CHAR("fi", "fi", 64257)
322 CHAR("fl", "fl", 64258)
323 CHAR("Fi", "ffi", 64259)
324 CHAR("Fl", "ffl", 64260)
325 CHAR("AE", "AE", 198)
326 CHAR("ae", "ae", 230)
327 CHAR("OE", "OE", 338)
328 CHAR("oe", "oe", 339)
329 CHAR("ss", "ss", 223)
330 CHAR("IJ", "IJ", 306)
331 CHAR("ij", "ij", 307)
333 /* Special letters. */
344 CHAR("Eu", "EUR", 8364)
345 CHAR("eu", "EUR", 8364)
352 STRING("Am", "&", 38)
353 STRING("Ba", "|", 124)
354 STRING("Ge", ">=", 8805)
355 STRING("Gt", ">", 62)
356 STRING("If", "infinity", 0)
357 STRING("Le", "<=", 8804)
358 STRING("Lq", "``", 8220)
359 STRING("Lt", "<", 60)
360 STRING("Na", "NaN", 0)
361 STRING("Ne", "!=", 8800)
362 STRING("Pi", "pi", 960)
363 STRING("Pm", "+-", 177)
364 STRING("Rq", "\'\'", 8221)
365 STRING("left-bracket", "[", 91)
366 STRING("left-parenthesis", "(", 40)
367 STRING("left-singlequote", "`", 8216)
368 STRING("lp", "(", 40)
369 STRING("q", "\"", 34)
370 STRING("quote-left", "`", 8216)
371 STRING("quote-right", "\'", 8217)
372 STRING("R", "(R)", 174)
373 STRING("right-bracket", "]", 93)
374 STRING("right-parenthesis", ")", 41)
375 STRING("right-singlequote", "\'", 8217)
376 STRING("rp", ")", 41)
377 STRING("Tm", "(Tm)", 8482)
381 CHAR("br", "|", 9474)
383 CHAR("rl", "-", 8254)
389 CHAR("ci", "o", 9675)
390 CHAR("bu", "o", 8226)
391 CHAR("dd", "=", 8225)
392 CHAR("dg", "-", 8224)
393 CHAR("lz", "<>", 9674)
394 CHAR("sq", "[]", 9633)
395 CHAR("ps", "9|", 182)
397 CHAR("lh", "<=", 9756)
398 CHAR("rh", "=>", 9758)
401 CHAR("CR", "_|", 8629)
402 CHAR("OK", "\\/", 10003)
405 CHAR("co", "(C)", 169)
406 CHAR("rg", "(R)", 174)
407 CHAR("tm", "tm", 8482)
413 CHAR("em", "--", 8212)
414 CHAR("en", "-", 8211)
415 CHAR("hy", "-", 8208)
420 CHAR("%0", "%o", 8240)
421 CHAR("fm", "\'", 8242)
422 CHAR("sd", "\"", 8243)
423 CHAR("mc", "mu", 181)