trfn_ch.h: add troff alias for oe
[neatmkfn.git] / trfn_ch.h
blobdff5ee7e564caec7c54c66759199f0a3589bde61
1 /* ligatures with unicode aliases */
2 static char *ligs_utf8[][2] = {
3 {"ff", "ff"},
4 {"fi", "fi"},
5 {"fl", "fl"},
6 {"ffi", "ffi"},
7 {"ffl", "ffl"},
8 {"st", "st"},
9 };
11 /* AGL exceptions */
12 static char *agl_exceptions[][2] = {
13 {"`", "ga"}, /* grave; using quoteleft for ` */
14 {"'", "aq"}, /* quotesingle; using quoteright for ' */
15 {"~", "ti"}, /* asciitilde; using tilde for ~ */
16 {"^", "ha"}, /* asciicircum; using circumflex for ^ */
19 /* troff aliases */
20 static char *alts[][8] = {
21 {"’", "'", "cq"},
22 {"+", "pl"},
23 {"-", "hy"},
24 {"/", "sl"},
25 {"=", "eq"},
26 {"\"", "dq"},
27 {"\\", "bs", "rs"},
28 {"_", "ru", "ul"},
29 {"‘", "`", "oq"},
30 {"|", "or"},
31 {"¡", "!!", "r!"},
32 {"¢", "c|", "ct"},
33 {"£", "L-", "ps"},
34 {"¤", "xo", "cr"},
35 {"¥", "Y-", "yn"},
36 {"¦", "||"},
37 {"§", "so", "sc"},
38 {"©", "co"},
39 {"ª", "a_"},
40 {"«", "<<", "Fo"},
41 {"¬", "-,", "no"},
42 {"®", "ro", "rg"},
43 {"°", "0^", "de"},
44 {"±", "+-"},
45 {"²", "2^"},
46 {"³", "3^"},
47 {"¶", "P!", "pg"},
48 {"·", ".^"},
49 {"¹", "1^"},
50 {"º", "o_"},
51 {"»", ">>", "Fc"},
52 {"¼", "14"},
53 {"½", "12"},
54 {"¾", "34"},
55 {"¿", "??", "r?"},
56 {"À", "A`"},
57 {"Á", "A'"},
58 {"Â", "A^"},
59 {"Ã", "A~"},
60 {"Ä", "A:", "A\""},
61 {"Å", "A*"},
62 {"Æ", "AE"},
63 {"Ç", "C,"},
64 {"È", "E`"},
65 {"É", "E'"},
66 {"Ê", "E^"},
67 {"Ë", "E:"},
68 {"Ì", "I`"},
69 {"Í", "I'"},
70 {"Î", "I^"},
71 {"Ï", "I:"},
72 {"Ð", "D-"},
73 {"Ñ", "N~"},
74 {"Ò", "O`"},
75 {"Ó", "O'"},
76 {"Ô", "O^"},
77 {"Õ", "O~"},
78 {"Ö", "O:"},
79 {"Œ", "OE"},
80 {"×", "xx", "mu"},
81 {"Ø", "O/"},
82 {"Ù", "U`"},
83 {"Ú", "U'"},
84 {"Û", "U^"},
85 {"Ü", "U:"},
86 {"Ý", "Y'"},
87 {"Þ", "TH"},
88 {"ß", "ss"},
89 {"à", "a`"},
90 {"á", "a'"},
91 {"â", "a^"},
92 {"ã", "a~"},
93 {"ä", "a:"},
94 {"å", "a*"},
95 {"æ", "ae"},
96 {"ç", "c,"},
97 {"è", "e`"},
98 {"é", "e'"},
99 {"ê", "e^"},
100 {"ë", "e:"},
101 {"ì", "i`"},
102 {"í", "i'"},
103 {"î", "i^"},
104 {"ï", "i:"},
105 {"ð", "d-"},
106 {"ñ", "n~"},
107 {"ò", "o`"},
108 {"ó", "o'"},
109 {"ô", "o^"},
110 {"õ", "o~"},
111 {"ö", "o:"},
112 {"œ", "oe"},
113 {"÷", "di", "-:"},
114 {"ø", "o/"},
115 {"ù", "u`"},
116 {"ú", "u'"},
117 {"û", "u^"},
118 {"ü", "u:"},
119 {"ý", "y'"},
120 {"þ", "th"},
121 {"ÿ", "y:"},
122 {"Č", "C<"},
123 {"č", "c<"},
124 {"Ď", "D<"},
125 {"ď", "d<"},
126 {"ě", "e<"},
127 {"ň", "n<"},
128 {"Ő", "O\""},
129 {"ő", "o\""},
130 {"Ř", "R<"},
131 {"ř", "r<"},
132 {"Š", "S<"},
133 {"š", "s<"},
134 {"Ť", "T<"},
135 {"ť", "t<"},
136 {"Ů", "U*"},
137 {"ů", "u*"},
138 {"Ű", "U\""},
139 {"ű", "u\""},
140 {"Ÿ", "Y:"},
141 {"Ž", "Z<"},
142 {"ž", "z<"},
143 {"ƒ", "fn",},
144 {"¸", ",,", ",a"},
145 {"´", "aa", "\\'"},
146 {"¯", "-a"},
147 {"¨", "\"\"", ":a"},
148 {"ga", "\\`"},
149 {"ˆ", "^", "^a"},
150 {"ˇ", "va"},
151 {"˘", "Ua"},
152 {"˙", ".a"},
153 {"˚", "oa"},
154 {"˛", "Ca"},
155 {"˝", "\"a"},
156 {"˜", "~"},
157 {"Α", "*A"},
158 {"Β", "*B"},
159 {"Γ", "*G"},
160 {"Ε", "*E"},
161 {"Ζ", "*Z"},
162 {"Η", "*Y"},
163 {"Θ", "*H"},
164 {"Ι", "*I"},
165 {"Κ", "*K"},
166 {"Λ", "*L"},
167 {"Μ", "*M"},
168 {"Ν", "*N"},
169 {"Ξ", "*C"},
170 {"Ο", "*O"},
171 {"Π", "*P"},
172 {"Ρ", "*R"},
173 {"Σ", "*S"},
174 {"Τ", "*T"},
175 {"Υ", "*U"},
176 {"Φ", "*F"},
177 {"Χ", "*X"},
178 {"Ψ", "*Q"},
179 {"Ω", "*W", "Ω"}, {"Ω", "Ω", "*W"},
180 {"α", "*a"},
181 {"β", "*b"},
182 {"γ", "*g"},
183 {"δ", "*d"},
184 {"ε", "*e"},
185 {"ζ", "*z"},
186 {"η", "*y"},
187 {"θ", "*h"},
188 {"ι", "*i"},
189 {"κ", "*k"},
190 {"λ", "*l"},
191 {"μ", "*m", "µ", "/u"}, {"µ", "/u", "*m", "μ"},
192 {"ν", "*n"},
193 {"ξ", "*c"},
194 {"ο", "*o"},
195 {"π", "*p"},
196 {"ρ", "*r"},
197 {"ς", "ts"},
198 {"σ", "*s"},
199 {"τ", "*t"},
200 {"υ", "*u"},
201 {"φ", "*f"},
202 {"χ", "*x"},
203 {"ψ", "*q"},
204 {"ω", "*w"},
205 {"–", "en", "\\-"},
206 {"—", "em", "--"},
207 {"‚", "bq"},
208 {"“", "``", "lq"},
209 {"”", "''", "rq"},
210 {"†", "dg"},
211 {"‡", "dd"},
212 {"•", "bu"},
213 {"…", "el"},
214 {"‰", "%0"},
215 {"′", "fm"},
216 {"‹", "fo"},
217 {"›", "fc"},
218 {"⁄", "fr"},
219 {"ℑ", "If"},
220 {"ℛ", "ws"},
221 {"ℜ", "Rf"},
222 {"ℵ", "af"},
223 {"←", "<-"},
224 {"↑", "ua"},
225 {"→", "->"},
226 {"↓", "da"},
227 {"↔", "ab", "<>"},
228 {"↵", "CR"},
229 {"∀", "fa"},
230 {"∂", "pd"},
231 {"∃", "te"},
232 {"∅", "es"},
233 {"∆", "*D", "Δ"}, {"Δ", "∆", "*D"},
234 {"∇", "gr"},
235 {"∈", "mo"},
236 {"∉", "!m"},
237 {"∋", "st"},
238 {"∏", "pr"},
239 {"∑", "su"},
240 {"−", "mi"},
241 {"∓", "-+"},
242 {"∗", "**"},
243 {"√", "sr"},
244 {"∝", "pt"},
245 {"∞", "if"},
246 {"∠", "an"},
247 {"∧", "l&"},
248 {"∨", "l|"},
249 {"∩", "ca"},
250 {"∪", "cu"},
251 {"∫", "is"},
252 {"∴", "tf"},
253 {"∼", "ap"},
254 {"≅", "cg", "=~"},
255 {"≈", "~~"},
256 {"≠", "!="},
257 {"≡", "=="},
258 {"≤", "<="},
259 {"≥", ">="},
260 {"⊂", "sb"},
261 {"⊃", "sp"},
262 {"⊄", "!b"},
263 {"⊆", "ib"},
264 {"⊇", "ip"},
265 {"⊕", "O+"},
266 {"⊗", "Ox"},
267 {"⊥", "pp"},
268 {"⋅", "c."},
269 {"〈", "b<"},
270 {"〉", "b>"},
271 {"◊", "lz"},
272 {"○", "ci"},
273 {"⟨", "la"},
274 {"⟩", "ra"},
275 {"", "co"},
276 {"", "rg"},
277 {"", "tm"},
278 {"", "rn"},
279 {"", "av"},
280 {"", "ah"},
281 {"", "RG"},
282 {"", "CO"},
283 {"", "TM"},
284 {"", "LT"},
285 {"", "br", "LX"},
286 {"", "LB"},
287 {"⎛", "LT"},
288 {"⎜", "LX"},
289 {"⎝", "LB"},
290 {"", "lc"},
291 {"", "lx"},
292 {"", "lf"},
293 {"⎡", "lc"},
294 {"⎢", "lx"},
295 {"⎣", "lf"},
296 {"", "lt"},
297 {"", "lk"},
298 {"", "lb"},
299 {"", "bv", "|"},
300 {"⎧", "lt"},
301 {"⎨", "lk"},
302 {"⎩", "lb"},
303 {"⎪", "bv"},
304 {"", "RT"},
305 {"", "RX"},
306 {"", "RB"},
307 {"⎞", "RT"},
308 {"⎟", "RX"},
309 {"⎠", "RB"},
310 {"", "rc"},
311 {"", "rx"},
312 {"", "rf"},
313 {"⎤", "rc"},
314 {"⎥", "rx"},
315 {"⎦", "rf"},
316 {"", "rt"},
317 {"", "rk"},
318 {"", "rb"},
319 {"⎫", "rt"},
320 {"⎬", "rk"},
321 {"⎭", "rb"},
322 {"ff", "ff"},
323 {"fi", "fi"},
324 {"fl", "fl"},
325 {"ffi", "ffi", "Fi"},
326 {"ffl", "ffl", "Fl"},
327 {"st", "st"},
328 {"ﺀ", "ء"},
329 {"ﺁ", "آ"},
330 {"ﺃ", "أ"},
331 {"ﺅ", "ؤ"},
332 {"ﺇ", "إ"},
333 {"ﺉ", "ئ"},
334 {"ﺍ", "ا"},
335 {"ﺏ", "ب"},
336 {"ﺓ", "ة"},
337 {"ﺕ", "ت"},
338 {"ﺙ", "ث"},
339 {"ﺝ", "ج"},
340 {"ﺡ", "ح"},
341 {"ﺥ", "خ"},
342 {"ﺩ", "د"},
343 {"ﺫ", "ذ"},
344 {"ﺭ", "ر"},
345 {"ﺯ", "ز"},
346 {"ﺱ", "س"},
347 {"ﺵ", "ش"},
348 {"ﺹ", "ص"},
349 {"ﺽ", "ض"},
350 {"ﻁ", "ط"},
351 {"ﻅ", "ظ"},
352 {"ﻉ", "ع"},
353 {"ﻍ", "غ"},
354 {"ـ", "ـ"},
355 {"ﻑ", "ف"},
356 {"ﻕ", "ق"},
357 {"ﻙ", "ك"},
358 {"ﻝ", "ل"},
359 {"ﻡ", "م"},
360 {"ﻥ", "ن"},
361 {"ﻩ", "ه"},
362 {"ﻭ", "و"},
363 {"ﻯ", "ى"},
364 {"ﻱ", "ي"},
365 {"ﭖ", "پ"},
366 {"ﭺ", "چ"},
367 {"ﮊ", "ژ"},
368 {"ﮎ", "ک"},
369 {"ﮒ", "گ"},
370 {"ﯼ", "ی"},
373 /* different shapes of arabic and farsi characters */
374 static struct achar {
375 char *name;
376 unsigned c;
377 unsigned s;
378 unsigned i;
379 unsigned m;
380 unsigned f;
381 } achars[] = {
382 {"hamza", 0x0621, 0xfe80},
383 {"alefwithmaddaabove", 0x0622, 0xfe81, 0, 0, 0xfe82},
384 {"alefwithhamzaabove", 0x0623, 0xfe83, 0, 0, 0xfe84},
385 {"wawwithhamzaabove", 0x0624, 0xfe85, 0, 0, 0xfe86},
386 {"alefwithhamzabelow", 0x0625, 0xfe87, 0, 0, 0xfe88},
387 {"yehwithhamzaabove", 0x0626, 0xfe89, 0xfe8b, 0xfe8c, 0xfe8a},
388 {"alef", 0x0627, 0xfe8d, 0, 0, 0xfe8e},
389 {"arabicalef", 0x0627},
390 {"beh", 0x0628, 0xfe8f, 0xfe91, 0xfe92, 0xfe90},
391 {"tehmarbuta", 0x0629, 0xfe93, 0, 0, 0xfe94},
392 {"teh", 0x062a, 0xfe95, 0xfe97, 0xfe98, 0xfe96},
393 {"theh", 0x062b, 0xfe99, 0xfe9b, 0xfe9c, 0xfe9a},
394 {"jeem", 0x062c, 0xfe9d, 0xfe9f, 0xfea0, 0xfe9e},
395 {"hah", 0x062d, 0xfea1, 0xfea3, 0xfea4, 0xfea2},
396 {"khah", 0x062e, 0xfea5, 0xfea7, 0xfea8, 0xfea6},
397 {"dal", 0x062f, 0xfea9, 0, 0, 0xfeaa},
398 {"thal", 0x0630, 0xfeab, 0, 0, 0xfeac},
399 {"reh", 0x0631, 0xfead, 0, 0, 0xfeae},
400 {"zain", 0x0632, 0xfeaf, 0, 0, 0xfeb0},
401 {"seen", 0x0633, 0xfeb1, 0xfeb3, 0xfeb4, 0xfeb2},
402 {"sheen", 0x0634, 0xfeb5, 0xfeb7, 0xfeb8, 0xfeb6},
403 {"sad", 0x0635, 0xfeb9, 0xfebb, 0xfebc, 0xfeba},
404 {"dad", 0x0636, 0xfebd, 0xfebf, 0xfec0, 0xfebe},
405 {"tah", 0x0637, 0xfec1, 0xfec3, 0xfec4, 0xfec2},
406 {"zah", 0x0638, 0xfec5, 0xfec7, 0xfec8, 0xfec6},
407 {"ain", 0x0639, 0xfec9, 0xfecb, 0xfecc, 0xfeca},
408 {"ghain", 0x063a, 0xfecd, 0xfecf, 0xfed0, 0xfece},
409 {"tatweel", 0x0640},
410 {"feh", 0x0641, 0xfed1, 0xfed3, 0xfed4, 0xfed2},
411 {"qaf", 0x0642, 0xfed5, 0xfed7, 0xfed8, 0xfed6},
412 {"kaf", 0x0643, 0xfed9, 0xfedb, 0xfedc, 0xfeda},
413 {"lam", 0x0644, 0xfedd, 0xfedf, 0xfee0, 0xfede},
414 {"meem", 0x0645, 0xfee1, 0xfee3, 0xfee4, 0xfee2},
415 {"noon", 0x0646, 0xfee5, 0xfee7, 0xfee8, 0xfee6},
416 {"heh", 0x0647, 0xfee9, 0xfeeb, 0xfeec, 0xfeea},
417 {"waw", 0x0648, 0xfeed, 0, 0, 0xfeee},
418 {"alefmaksura", 0x0649, 0xfeef, 0, 0, 0xfef0},
419 {"yeh", 0x064a, 0xfef1, 0xfef3, 0xfef4, 0xfef2},
420 {"fathatan", 0x064b, 0xfe70},
421 {"dammatan", 0x064c, 0xfe72},
422 {"kasratan", 0x064d, 0xfe74},
423 {"fatha", 0x064e, 0xfe76, 0, 0xfe77, 0},
424 {"damma", 0x064f, 0xfe78, 0, 0xfe79, 0},
425 {"kasra", 0x0650, 0xfe7a, 0, 0xfe7b, 0},
426 {"shadda", 0x0651, 0xfe7c, 0, 0xfe7c, 0},
427 {"sukun", 0x0652, 0xfe7e, 0, 0xfe7f, 0},
428 {"peh", 0x067e, 0xfb56, 0xfb58, 0xfb59, 0xfb57},
429 {"tcheh", 0x0686, 0xfb7a, 0xfb7c, 0xfb7d, 0xfb7b},
430 {"jeh", 0x0698, 0xfb8a, 0, 0, 0xfb8b},
431 {"keheh", 0x06a9, 0xfb8e, 0xfb90, 0xfb91, 0xfb8f},
432 {"gaf", 0x06af, 0xfb92, 0xfb94, 0xfb95, 0xfb93},
433 {"farsiyeh", 0x06cc, 0xfbfc, 0xfbfe, 0xfbff, 0xfbfd},
434 {"lamwithalef", 0xfefb, 0xfefb, 0, 0, 0xfefc},
435 {"arabiccomma", 0x060c},
436 {"arabicsemicolon", 0x061b},
437 {"arabicquestionmark", 0x061f},
438 {"arabicindicdigitzero", 0x0660},
439 {"arabicindicdigitone", 0x0661},
440 {"arabicindicdigittwo", 0x0662},
441 {"arabicindicdigitthree", 0x0663},
442 {"arabicindicdigitfour", 0x0664},
443 {"arabicindicdigitfive", 0x0665},
444 {"arabicindicdigitsix", 0x0666},
445 {"arabicindicdigitseven", 0x0667},
446 {"arabicindicdigiteight", 0x0668},
447 {"arabicindicdigitnine", 0x0669},
448 {"arabicpercentsign", 0x066a},
449 {"extendedarabicindicdigitzero", 0x06f0},
450 {"extendedarabicindicdigitone", 0x06f1},
451 {"extendedarabicindicdigittwo", 0x06f2},
452 {"extendedarabicindicdigitthree", 0x06f3},
453 {"extendedarabicindicdigitfour", 0x06f4},
454 {"extendedarabicindicdigitfive", 0x06f5},
455 {"extendedarabicindicdigitsix", 0x06f6},
456 {"extendedarabicindicdigitseven", 0x06f7},
457 {"extendedarabicindicdigiteight", 0x06f8},
458 {"extendedarabicindicdigitnine", 0x06f9},
459 {"zeronojoin", 0x200c},
460 {"zerojoin", 0x200d},
463 static int ctype_ascii[128] = {
464 ['!'] = 2, ['"'] = 2, ['#'] = 2, ['$'] = 2, ['%'] = 2,
465 ['&'] = 2, ['\''] = 2, ['('] = 3, [')'] = 3, ['*'] = 2,
466 ['+'] = 0, [','] = 1, ['-'] = 0, ['.'] = 0, ['/'] = 2,
467 ['0'] = 2, ['1'] = 2, ['2'] = 2, ['3'] = 2, ['4'] = 2,
468 ['5'] = 2, ['6'] = 2, ['7'] = 2, ['8'] = 2, ['9'] = 2,
469 [':'] = 0, [';'] = 1, ['<'] = 0, ['='] = 0, ['>'] = 0,
470 ['?'] = 2, ['@'] = 3, ['A'] = 2, ['B'] = 2, ['C'] = 2,
471 ['D'] = 2, ['E'] = 2, ['F'] = 2, ['G'] = 2, ['H'] = 2,
472 ['I'] = 2, ['J'] = 3, ['K'] = 2, ['L'] = 2, ['M'] = 2,
473 ['N'] = 2, ['O'] = 2, ['P'] = 2, ['Q'] = 3, ['R'] = 2,
474 ['S'] = 2, ['T'] = 2, ['U'] = 2, ['V'] = 2, ['W'] = 2,
475 ['X'] = 2, ['Y'] = 2, ['Z'] = 2, ['['] = 3, ['\\'] = 2,
476 [']'] = 3, ['^'] = 2, ['_'] = 1, ['a'] = 0, ['b'] = 2,
477 ['c'] = 0, ['d'] = 2, ['e'] = 0, ['f'] = 2, ['g'] = 1,
478 ['h'] = 2, ['i'] = 2, ['j'] = 3, ['k'] = 2, ['l'] = 2,
479 ['m'] = 0, ['n'] = 0, ['o'] = 0, ['p'] = 1, ['q'] = 1,
480 ['r'] = 0, ['s'] = 0, ['t'] = 2, ['u'] = 0, ['v'] = 0,
481 ['w'] = 0, ['x'] = 0, ['y'] = 1, ['z'] = 0, ['{'] = 3,
482 ['|'] = 3, ['}'] = 3, ['~'] = 0,