/* $Id: chars.in,v 1.3 2009/12/24 02:08:14 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * The ASCII translation tables. STRING corresponds to predefined * strings (cf. mdoc_samples.7 and tmac/mdoc/doc-nroff). CHAR * corresponds to special characters (cf. groff_char.7). BOTH contains * sequences that are equivalent in both STRING and CHAR. * * Either way, the left-hand side corresponds to the input sequence (\x, * \(xx, \*(xx and so on) whose length is listed second element. The * right-hand side is what's produced by the front-end, with the fourth * element being its length. * * XXX - C-escape strings! * XXX - update LINES_MAX if adding more! */ /* Non-breaking, non-collapsing space uses unit separator. */ static const char ascii_nbrsp[2] = { 31, 0 }; CHAR_TBL_START /* Spacing. */ CHAR("c", 1, "", 0, "", 0) CHAR("0", 1, " ", 1, " ", 7) CHAR(" ", 1, " ", 1, " ", 7) CHAR("~", 1, ascii_nbrsp, 1, " ", 6) CHAR("%", 1, "", 0, "", 0) CHAR("&", 1, "", 0, "", 0) CHAR("^", 1, "", 0, "", 0) CHAR("|", 1, "", 0, "", 0) /* Accents. */ CHAR("a\"", 2, "\"", 1, "̋", 6) CHAR("a-", 2, "-", 1, "¯", 6) CHAR("a.", 2, ".", 1, "˙", 6) CHAR("a^", 2, "^", 1, "̂", 6) CHAR("\'", 1, "\'", 1, "́", 6) BOTH("aa", 2, "\'", 1, "́", 6) BOTH("ga", 2, "`", 1, "̀", 6) CHAR("`", 1, "`", 1, "̀", 6) CHAR("ab", 2, "`", 1, "̆", 6) CHAR("ac", 2, ",", 1, "̧", 6) CHAR("ad", 2, "\"", 1, "̈", 6) CHAR("ah", 2, "v", 1, "ˇ", 6) CHAR("ao", 2, "o", 1, "˚", 6) CHAR("a~", 2, "~", 1, "̃", 6) CHAR("ho", 2, ",", 1, "̨", 6) CHAR("ha", 2, "^", 1, "^", 1) CHAR("ti", 2, "~", 1, "~", 1) /* Quotes. */ CHAR("Bq", 2, ",,", 2, "„", 7) CHAR("bq", 2, ",", 1, "‚", 7) BOTH("lq", 2, "``", 2, "“", 7) BOTH("rq", 2, "\'\'", 2, "”", 7) CHAR("oq", 2, "`", 1, "‘", 7) CHAR("cq", 2, "\'", 1, "’", 7) CHAR("aq", 2, "\'", 1, "\'", 1) CHAR("dq", 2, "\"", 1, "\"", 1) CHAR("Fo", 2, "<<", 2, "«", 6) CHAR("Fc", 2, ">>", 2, "»", 6) CHAR("fo", 2, "<", 1, "‹", 7) CHAR("fc", 2, ">", 1, "›", 7) /* Brackets. */ CHAR("lB", 2, "[", 1, "[", 1) CHAR("rB", 2, "]", 1, "]", 1) CHAR("lC", 2, "{", 1, "{", 1) CHAR("rC", 2, "}", 1, "}", 1) CHAR("la", 2, "<", 1, "⟨", 8) CHAR("ra", 2, ">", 1, "⟩", 8) CHAR("bv", 2, "|", 1, "⎪", 7) CHAR("braceex", 7, "|", 1, "⎪", 7) CHAR("bracketlefttp", 13, "|", 1, "⎡", 7) CHAR("bracketleftbp", 13, "|", 1, "⎣", 7) CHAR("bracketleftex", 13, "|", 1, "⎢", 7) CHAR("bracketrighttp", 14, "|", 1, "⎤", 7) CHAR("bracketrightbp", 14, "|", 1, "⎦", 7) CHAR("bracketrightex", 14, "|", 1, "⎥", 7) CHAR("lt", 2, ",-", 2, "⎧", 7) CHAR("bracelefttp", 11, ",-", 2, "⎧", 7) CHAR("lk", 2, "{", 1, "⎨", 7) CHAR("braceleftmid", 12, "{", 1, "⎨", 7) CHAR("lb", 2, ",-", 2, "⎩", 7) CHAR("braceleftbp", 11, "`-", 2, "⎩", 7) CHAR("braceleftex", 11, "|", 1, "⎪", 7) CHAR("rt", 2, "-.", 2, "⎫", 7) CHAR("bracerighttp", 12, "-.", 2, "⎫", 7) CHAR("rk", 2, "}", 1, "⎬", 7) CHAR("bracerightmid", 13, "}", 1, "⎬", 7) CHAR("rb", 2, "-\'", 2, "⎭", 7) CHAR("bracerightbp", 12, "-\'", 2, "⎭", 7) CHAR("bracerightex", 12, "|", 1, "⎪", 7) CHAR("parenlefttp", 11, "/", 1, "⎛", 7) CHAR("parenleftbp", 11, "\\", 1, "⎝", 7) CHAR("parenleftex", 11, "|", 1, "⎜", 7) CHAR("parenrighttp", 12, "\\", 1, "⎞", 7) CHAR("parenrightbp", 12, "/", 1, "⎠", 7) CHAR("parenrightex", 12, "|", 1, "⎟", 7) /* Greek characters. */ CHAR("*A", 2, "A", 1, "Α", 6) CHAR("*B", 2, "B", 1, "Β", 6) CHAR("*G", 2, "|", 1, "Γ", 6) CHAR("*D", 2, "/\\", 2, "Δ", 6) CHAR("*E", 2, "E", 1, "Ε", 6) CHAR("*Z", 2, "Z", 1, "Ζ", 6) CHAR("*Y", 2, "H", 1, "Η", 6) CHAR("*H", 2, "O", 1, "Θ", 6) CHAR("*I", 2, "I", 1, "Ι", 6) CHAR("*K", 2, "K", 1, "Κ", 6) CHAR("*L", 2, "/\\", 2, "Λ", 6) CHAR("*M", 2, "M", 1, "Μ", 6) CHAR("*N", 2, "N", 1, "Ν", 6) CHAR("*C", 2, "H", 1, "Ξ", 6) CHAR("*O", 2, "O", 1, "Ο", 6) CHAR("*P", 2, "TT", 2, "Π", 6) CHAR("*R", 2, "P", 1, "Ρ", 6) CHAR("*S", 2, ">", 1, "Σ", 6) CHAR("*T", 2, "T", 1, "Τ", 6) CHAR("*U", 2, "Y", 1, "Υ", 6) CHAR("*F", 2, "O_", 1, "Φ", 6) CHAR("*X", 2, "X", 1, "Χ", 6) CHAR("*Q", 2, "Y", 1, "Ψ", 6) CHAR("*W", 2, "O", 1, "Ω", 6) CHAR("*a", 2, "a", 1, "α", 6) CHAR("*b", 2, "B", 1, "β", 6) CHAR("*g", 2, "y", 1, "γ", 6) CHAR("*d", 2, "d", 1, "δ", 6) CHAR("*e", 2, "e", 1, "ε", 6) CHAR("*z", 2, "C", 1, "ζ", 6) CHAR("*y", 2, "n", 1, "η", 6) CHAR("*h", 2, "0", 1, "θ", 6) CHAR("*i", 2, "i", 1, "ι", 6) CHAR("*k", 2, "k", 1, "κ", 6) CHAR("*l", 2, "\\", 1, "λ", 6) CHAR("*m", 2, "u", 1, "μ", 6) CHAR("*n", 2, "v", 1, "ν", 6) CHAR("*c", 2, "E", 1, "ξ", 6) CHAR("*o", 2, "o", 1, "ο", 6) CHAR("*p", 2, "n", 1, "π", 6) CHAR("*r", 2, "p", 1, "ρ", 6) CHAR("*s", 2, "o", 1, "σ", 6) CHAR("*t", 2, "t", 1, "τ", 6) CHAR("*u", 2, "u", 1, "υ", 6) CHAR("*f", 2, "o", 1, "ϕ", 6) CHAR("*x", 2, "x", 1, "χ", 6) CHAR("*q", 2, "u", 1, "ψ", 6) CHAR("*w", 2, "w", 1, "ω", 6) CHAR("+h", 2, "0", 1, "ϑ", 6) CHAR("+f", 2, "o", 1, "φ", 6) CHAR("+p", 2, "w", 1, "ϖ", 6) CHAR("+e", 2, "e", 1, "ϵ", 7) CHAR("ts", 2, "s", 1, "ς", 6) /* Accented letters. */ CHAR(",C", 2, "C", 1, "Ç", 6) CHAR(",c", 2, "c", 1, "ç", 6) CHAR("/L", 2, "L", 1, "Ł", 6) CHAR("/O", 2, "O", 1, "Ø", 6) CHAR("/l", 2, "l", 1, "ł", 6) CHAR("/o", 2, "o", 1, "ø", 6) CHAR("oA", 2, "A", 1, "Å", 6) CHAR("oa", 2, "a", 1, "å", 6) CHAR(":A", 2, "A", 1, "Ä", 6) CHAR(":E", 2, "E", 1, "Ë", 6) CHAR(":I", 2, "I", 1, "Ï", 6) CHAR(":O", 2, "O", 1, "Ö", 6) CHAR(":U", 2, "U", 1, "Ü", 6) CHAR(":a", 2, "a", 1, "ä", 6) CHAR(":e", 2, "e", 1, "ë", 6) CHAR(":i", 2, "i", 1, "ï", 6) CHAR(":o", 2, "o", 1, "õ", 6) CHAR(":u", 2, "u", 1, "ü", 6) CHAR(":y", 2, "y", 1, "ÿ", 6) CHAR("\'A", 2, "A", 1, "Á", 6) CHAR("\'E", 2, "E", 1, "É", 6) CHAR("\'I", 2, "I", 1, "Í", 6) CHAR("\'O", 2, "O", 1, "Ó", 6) CHAR("\'U", 2, "U", 1, "Ú", 6) CHAR("\'a", 2, "a", 1, "á", 6) CHAR("\'e", 2, "e", 1, "é", 6) CHAR("\'i", 2, "i", 1, "í", 6) CHAR("\'o", 2, "o", 1, "ó", 6) CHAR("\'u", 2, "u", 1, "ú", 6) CHAR("^A", 2, "A", 1, "Â", 6) CHAR("^E", 2, "E", 1, "Ê", 6) CHAR("^I", 2, "I", 1, "Î", 6) CHAR("^O", 2, "O", 1, "Ô", 6) CHAR("^U", 2, "U", 1, "Û", 6) CHAR("^a", 2, "a", 1, "â", 6) CHAR("^e", 2, "e", 1, "ê", 6) CHAR("^i", 2, "i", 1, "î", 6) CHAR("^o", 2, "o", 1, "ô", 6) CHAR("^u", 2, "u", 1, "û", 6) CHAR("`A", 2, "A", 1, "À", 6) CHAR("`E", 2, "E", 1, "È", 6) CHAR("`I", 2, "I", 1, "Ì", 6) CHAR("`O", 2, "O", 1, "Ò", 6) CHAR("`U", 2, "U", 1, "Ù", 6) CHAR("`a", 2, "a", 1, "à", 6) CHAR("`e", 2, "e", 1, "è", 6) CHAR("`i", 2, "i", 1, "ì", 6) CHAR("`o", 2, "o", 1, "ò", 6) CHAR("`u", 2, "u", 1, "ù", 6) CHAR("~A", 2, "A", 1, "Ã", 6) CHAR("~N", 2, "N", 1, "Ñ", 6) CHAR("~O", 2, "O", 1, "Õ", 6) CHAR("~a", 2, "a", 1, "ã", 6) CHAR("~n", 2, "n", 1, "ñ", 6) CHAR("~o", 2, "o", 1, "õ", 6) /* Arrows and lines. */ CHAR("<-", 2, "<-", 2, "←", 7) CHAR("->", 2, "->", 2, "→", 7) CHAR("<>", 2, "<>", 2, "↔", 7) CHAR("da", 2, "v", 1, "↓", 7) BOTH("ua", 2, "^", 1, "↑", 7) BOTH("va", 2, "^v", 2, "↕", 7) CHAR("lA", 2, "<=", 2, "⇐", 7) CHAR("rA", 2, "=>", 2, "⇒", 7) CHAR("hA", 2, "<=>", 3, "⇔", 7) CHAR("dA", 2, "v", 1, "⇓", 7) CHAR("uA", 2, "^", 1, "⇑", 7) CHAR("vA", 2, "^=v", 3, "⇕", 7) /* Logic. */ CHAR("AN", 2, "^", 1, "∧", 7) CHAR("OR", 2, "v", 1, "∨", 7) CHAR("no", 2, "~", 1, "¬", 6) CHAR("tno", 3, "~", 1, "¬", 6) CHAR("te", 2, "3", 1, "∃", 7) CHAR("fa", 2, "V", 1, "∀", 7) CHAR("st", 2, "-)", 2, "∋", 7) CHAR("tf", 2, ".:.", 3, "∴", 7) CHAR("3d", 2, ".:.", 3, "∴", 7) CHAR("or", 2, "|", 1, "|", 1) /* Mathematicals. */ CHAR("pl", 2, "+", 1, "+", 5) CHAR("mi", 2, "-", 1, "−", 7) CHAR("-", 1, "-", 1, "-", 1) CHAR("-+", 2, "-+", 2, "∓", 7) CHAR("+-", 2, "+-", 2, "±", 6) CHAR("t+-", 3, "+-", 2, "±", 6) CHAR("pc", 2, ".", 1, "·", 6) CHAR("md", 2, ".", 1, "⋅", 7) CHAR("mu", 2, "x", 1, "×", 6) CHAR("tmu", 3, "x", 1, "×", 6) CHAR("c*", 2, "x", 1, "⊗", 7) CHAR("c+", 2, "+", 1, "⊕", 7) CHAR("di", 2, "-:-", 3, "÷", 6) CHAR("tdi", 3, "-:-", 3, "÷", 6) CHAR("f/", 2, "/", 1, "⁄", 7) CHAR("**", 2, "*", 1, "∗", 7) BOTH("<=", 2, "<=", 2, "≤", 7) BOTH(">=", 2, ">=", 2, "≥", 7) CHAR("<<", 2, "<<", 2, "≪", 7) CHAR(">>", 2, ">>", 2, "≫", 7) CHAR("eq", 2, "=", 1, "=", 5) CHAR("!=", 2, "!=", 2, "≠", 7) CHAR("==", 2, "==", 2, "≡", 7) CHAR("ne", 2, "!==", 3, "≢", 7) CHAR("=~", 2, "=~", 2, "≅", 7) CHAR("-~", 2, "-~", 2, "≃", 7) CHAR("ap", 2, "~", 1, "∼", 7) CHAR("~~", 2, "~~", 2, "≈", 7) CHAR("~=", 2, "~=", 2, "≌", 7) CHAR("pt", 2, "oc", 2, "∝", 7) CHAR("es", 2, "{}", 2, "∅", 7) CHAR("mo", 2, "E", 1, "∈", 7) CHAR("nm", 2, "!E", 2, "∉", 7) CHAR("sb", 2, "(=", 2, "⊂", 7) CHAR("nb", 2, "(!=", 3, "⊄", 7) CHAR("sp", 2, "=)", 2, "⊃", 7) CHAR("nc", 2, "!=)", 3, "⊅", 7) CHAR("ib", 2, "(=", 2, "⊆", 7) CHAR("ip", 2, "=)", 2, "⊇", 7) CHAR("ca", 2, "(^)", 3, "∩", 7) CHAR("cu", 2, "U", 1, "∪", 7) CHAR("/_", 2, "/_", 2, "∠", 7) CHAR("pp", 2, "_|_", 3, "⊥", 7) CHAR("is", 2, "I", 1, "∫", 7) CHAR("integral", 8, "I", 1, "∫", 7) CHAR("sum", 3, "E", 1, "∑", 7) CHAR("product", 7, "TT", 2, "∏", 7) CHAR("coproduct", 9, "U", 1, "∐", 7) CHAR("gr", 2, "V", 1, "∇", 7) CHAR("sr", 2, "\\/", 2, "√", 7) CHAR("sqrt", 4, "\\/", 2, "√", 7) CHAR("lc", 2, "|~", 2, "⌈", 7) CHAR("rc", 2, "~|", 2, "⌉", 7) CHAR("lf", 2, "|_", 2, "⌊", 7) CHAR("rf", 2, "_|", 2, "⌋", 7) CHAR("if", 2, "oo", 2, "∞", 7) CHAR("Ah", 2, "N", 1, "ℵ", 7) CHAR("Im", 2, "I", 1, "ℑ", 7) CHAR("Re", 2, "R", 1, "ℜ", 7) CHAR("pd", 2, "a", 1, "∂", 7) CHAR("-h", 2, "/h", 2, "ℏ", 7) /* Ligatures. */ CHAR("ff", 2, "ff", 2, "ff", 8) CHAR("fi", 2, "fi", 2, "fi", 8) CHAR("fl", 2, "fl", 2, "fl", 8) CHAR("Fi", 2, "ffi", 3, "ffi", 8) CHAR("Fl", 2, "ffl", 3, "ffl", 8) CHAR("AE", 2, "AE", 2, "Æ", 6) CHAR("ae", 2, "ae", 2, "æ", 6) CHAR("OE", 2, "OE", 2, "Œ", 6) CHAR("oe", 2, "oe", 2, "œ", 6) CHAR("ss", 2, "ss", 2, "ß", 6) CHAR("IJ", 2, "IJ", 2, "IJ", 6) CHAR("ij", 2, "ij", 2, "ij", 6) /* Special letters. */ CHAR("-D", 2, "D", 1, "Ð", 6) CHAR("Sd", 2, "o", 1, "ð", 6) CHAR("TP", 2, "b", 1, "Þ", 6) CHAR("Tp", 2, "b", 1, "þ", 6) CHAR(".i", 2, "i", 1, "ı", 6) CHAR(".j", 2, "j", 1, "ȷ", 6) /* Currency. */ CHAR("Do", 2, "$", 1, "$", 1) CHAR("ct", 2, "c", 1, "¢", 6) CHAR("Eu", 2, "EUR", 3, "€", 7) CHAR("eu", 2, "EUR", 3, "€", 7) CHAR("Ye", 2, "Y", 1, "¥", 6) CHAR("Po", 2, "L", 1, "£", 6) CHAR("Cs", 2, "x", 1, "¤", 6) CHAR("Fn", 2, "f", 1, "ƒ", 6) /* Old style. */ STRING("Am", 2, "&", 1, "&", 5) STRING("Ba", 2, "|", 1, "|", 1) STRING("Ge", 2, ">=", 2, "≥", 7) STRING("Gt", 2, ">", 1, ">", 4) STRING("If", 2, "infinity", 8, "infinity", 8) STRING("Le", 2, "<=", 2, "≤", 7) STRING("Lq", 2, "``", 2, "“", 7) STRING("Lt", 2, "<", 1, "<", 4) STRING("Na", 2, "NaN", 3, "NaN", 3) STRING("Ne", 2, "!=", 2, "≠", 7) STRING("Pi", 2, "pi", 2, "π", 6) STRING("Pm", 2, "+-", 2, "±", 6) STRING("R", 1, "(R)", 3, "®", 6) STRING("Rq", 2, "\'\'", 2, "”", 7) STRING("Tm", 2, "tm", 2, "™", 7) STRING("left-bracket", 12, "[", 1, "[", 1) STRING("left-parenthesis", 16, "(", 1, "(", 1) STRING("left-singlequote", 16, "`", 1, "‘", 7) STRING("lp", 2, "(", 1, "(", 1) STRING("q", 1, "\"", 1, """, 6) STRING("quote-left", 10, "`", 1, "‘", 7) STRING("quote-right", 11, "\'", 1, "’", 7) STRING("right-bracket", 13, "]", 1, "]", 1) STRING("right-parenthesis", 17, ")", 1, ")", 1) STRING("right-singlequote", 17, "\'", 1, "’", 7) STRING("rp", 2, ")", 1, ")", 1) /* Lines. */ CHAR("ba", 2, "|", 1, "|", 6) CHAR("br", 2, "|", 1, "│", 7) CHAR("ul", 2, "_", 1, "_", 5) CHAR("rl", 2, "-", 1, "‾", 7) CHAR("bb", 2, "|", 1, "¦", 6) CHAR("sl", 2, "/", 1, "/", 5) CHAR("rs", 2, "\\", 1, "\", 5) /* Text markers. */ CHAR("ci", 2, "o", 1, "○", 7) CHAR("bu", 2, "o", 1, "•", 7) CHAR("dd", 2, "=", 1, "‡", 7) CHAR("dg", 2, "-", 1, "†", 7) CHAR("lz", 2, "<>", 2, "◊", 7) CHAR("sq", 2, "[]", 2, "□", 7) CHAR("ps", 2, "9|", 2, "¶", 6) CHAR("sc", 2, "S", 1, "§", 6) CHAR("lh", 2, "<=", 2, "☜", 7) CHAR("rh", 2, "=>", 2, "☞", 7) CHAR("at", 2, "@", 1, "@", 5) CHAR("sh", 2, "#", 1, "#", 5) CHAR("CR", 2, "_|", 2, "↵", 7) CHAR("OK", 2, "\\/", 2, "✓", 8) /* Legal symbols. */ CHAR("co", 2, "(C)", 3, "©", 6) CHAR("rg", 2, "(R)", 3, "®", 6) CHAR("tm", 2, "tm", 2, "™", 7) /* Punctuation. */ CHAR(".", 1, ".", 1, ".", 1) CHAR("r!", 2, "i", 1, "¡", 6) CHAR("r?", 2, "c", 1, "¿", 6) CHAR("em", 2, "--", 2, "—", 7) CHAR("en", 2, "-", 1, "–", 7) CHAR("hy", 2, "-", 1, "‐", 7) CHAR("\\", 1, "\\", 1, "\\", 1) CHAR("e", 1, "\\", 1, "\\", 1) /* Units. */ CHAR("de", 2, "o", 1, "°", 6) CHAR("%0", 2, "%o", 2, "‰", 7) CHAR("fm", 2, "\'", 1, "′", 7) CHAR("sd", 2, "\"", 1, "″", 7) CHAR("mc", 2, "mu", 2, "µ", 6) CHAR_TBL_END