]> git.cameronkatri.com Git - mandoc.git/commitdiff
Refine -Tascii rendering of Unicode characters, mostly to better agree
authorIngo Schwarze <schwarze@openbsd.org>
Tue, 28 Oct 2014 02:43:59 +0000 (02:43 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Tue, 28 Oct 2014 02:43:59 +0000 (02:43 +0000)
with groff, in particular in cases where groff uses backspace overstrike.
In two cases, agreement is impossible because groff clobbers the
previous line: \(*G \(*S
In a number of cases, groff rendering is so misleading that i chose
to render differently: \(Sd \(TP \(Tp \(Po \(ps \(sc \(r! \(r? \(de
While here, also correct the \(la and \(ra Unicode code points.

chars.in
term_ascii.c

index 098504fa164838d1880529f1bddc00be448f62a0..d902e1a23a921a82369fb12deb8a77263ff331b9 100644 (file)
--- a/chars.in
+++ b/chars.in
@@ -1,4 +1,4 @@
-/*     $Id: chars.in,v 1.46 2014/04/20 16:46:04 schwarze Exp $ */
+/*     $Id: chars.in,v 1.47 2014/10/28 02:43:59 schwarze Exp $ */
 /*
  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -57,7 +57,7 @@ CHAR("\'",                    "\'",           180)
 CHAR("aa",                     "\'",           180)
 CHAR("ga",                     "`",            96)
 CHAR("`",                      "`",            96)
-CHAR("ab",                     "`",            728)
+CHAR("ab",                     "'\b`",         728)
 CHAR("ac",                     ",",            184)
 CHAR("ad",                     "\"",           168)
 CHAR("ah",                     "v",            711)
@@ -86,8 +86,8 @@ CHAR("lB",                    "[",            91)
 CHAR("rB",                     "]",            93)
 CHAR("lC",                     "{",            123)
 CHAR("rC",                     "}",            125)
-CHAR("la",                     "<",            60)
-CHAR("ra",                     ">",            62)
+CHAR("la",                     "<",            10216)
+CHAR("ra",                     ">",            10217)
 CHAR("bv",                     "|",            9130)
 CHAR("braceex",                        "|",            9130)
 CHAR("bracketlefttp",          "|",            9121)
@@ -120,114 +120,114 @@ CHAR("parenrightex",            "|",            9119)
 /* Greek characters. */
 CHAR("*A",                     "A",            913)
 CHAR("*B",                     "B",            914)
-CHAR("*G",                     "|",            915)
-CHAR("*D",                     "/\\",          916)
+CHAR("*G",                     "G",            915)
+CHAR("*D",                     "_\b/_\b\\",    916)
 CHAR("*E",                     "E",            917)
 CHAR("*Z",                     "Z",            918)
 CHAR("*Y",                     "H",            919)
-CHAR("*H",                     "O",            920)
+CHAR("*H",                     "-\bO",         920)
 CHAR("*I",                     "I",            921)
 CHAR("*K",                     "K",            922)
 CHAR("*L",                     "/\\",          923)
 CHAR("*M",                     "M",            924)
 CHAR("*N",                     "N",            925)
-CHAR("*C",                     "H",            926)
+CHAR("*C",                     "_\bH",         926)
 CHAR("*O",                     "O",            927)
 CHAR("*P",                     "TT",           928)
 CHAR("*R",                     "P",            929)
-CHAR("*S",                     ">",            931)
+CHAR("*S",                     "S",            931)
 CHAR("*T",                     "T",            932)
 CHAR("*U",                     "Y",            933)
-CHAR("*F",                     "O_",           934)
+CHAR("*F",                     "I\bO",         934)
 CHAR("*X",                     "X",            935)
-CHAR("*Q",                     "Y",            936)
-CHAR("*W",                     "O",            937)
+CHAR("*Q",                     "I\bY",         936)
+CHAR("*W",                     "_\bO",         937)
 CHAR("*a",                     "a",            945)
 CHAR("*b",                     "B",            946)
 CHAR("*g",                     "y",            947)
 CHAR("*d",                     "d",            948)
 CHAR("*e",                     "e",            949)
-CHAR("*z",                     "C",            950)
+CHAR("*z",                     ",\bC",         950)
 CHAR("*y",                     "n",            951)
-CHAR("*h",                     "0",            952)
+CHAR("*h",                     "-\b0",         952)
 CHAR("*i",                     "i",            953)
 CHAR("*k",                     "k",            954)
-CHAR("*l",                     "\\",           955)
-CHAR("*m",                     "u",            956)
+CHAR("*l",                     ">\b\\",        955)
+CHAR("*m",                     ",\bu",         956)
 CHAR("*n",                     "v",            957)
-CHAR("*c",                     "E",            958)
+CHAR("*c",                     ",\bE",         958)
 CHAR("*o",                     "o",            959)
-CHAR("*p",                     "n",            960)
+CHAR("*p",                     "-\bn",         960)
 CHAR("*r",                     "p",            961)
-CHAR("*s",                     "o",            963)
-CHAR("*t",                     "t",            964)
+CHAR("*s",                     "-\bo",         963)
+CHAR("*t",                     "~\bt",         964)
 CHAR("*u",                     "u",            965)
-CHAR("*f",                     "o",            981)
+CHAR("*f",                     "|\bo",         981)
 CHAR("*x",                     "x",            967)
-CHAR("*q",                     "u",            968)
+CHAR("*q",                     "|\bu",         968)
 CHAR("*w",                     "w",            969)
-CHAR("+h",                     "0",            977)
-CHAR("+f",                     "o",            966)
-CHAR("+p",                     "w",            982)
+CHAR("+h",                     "-\b0",         977)
+CHAR("+f",                     "|\bo",         966)
+CHAR("+p",                     "-\bw",         982)
 CHAR("+e",                     "e",            1013)
 CHAR("ts",                     "s",            962)
 
 /* Accented letters. */
-CHAR(",C",                     "C",            199)
-CHAR(",c",                     "c",            231)
-CHAR("/L",                     "L",            321)
-CHAR("/O",                     "O",            216)
-CHAR("/l",                     "l",            322)
-CHAR("/o",                     "o",            248)
-CHAR("oA",                     "A",            197)
-CHAR("oa",                     "a",            229)
-CHAR(":A",                     "A",            196)
-CHAR(":E",                     "E",            203)
-CHAR(":I",                     "I",            207)
-CHAR(":O",                     "O",            214)
-CHAR(":U",                     "U",            220)
-CHAR(":a",                     "a",            228)
-CHAR(":e",                     "e",            235)
-CHAR(":i",                     "i",            239)
-CHAR(":o",                     "o",            246)
-CHAR(":u",                     "u",            252)
-CHAR(":y",                     "y",            255)
-CHAR("\'A",                    "A",            193)
-CHAR("\'E",                    "E",            201)
-CHAR("\'I",                    "I",            205)
-CHAR("\'O",                    "O",            211)
-CHAR("\'U",                    "U",            218)
-CHAR("\'a",                    "a",            225)
-CHAR("\'e",                    "e",            233)
-CHAR("\'i",                    "i",            237)
-CHAR("\'o",                    "o",            243)
-CHAR("\'u",                    "u",            250)
-CHAR("^A",                     "A",            194)
-CHAR("^E",                     "E",            202)
-CHAR("^I",                     "I",            206)
-CHAR("^O",                     "O",            212)
-CHAR("^U",                     "U",            219)
-CHAR("^a",                     "a",            226)
-CHAR("^e",                     "e",            234)
-CHAR("^i",                     "i",            238)
-CHAR("^o",                     "o",            244)
-CHAR("^u",                     "u",            251)
-CHAR("`A",                     "A",            192)
-CHAR("`E",                     "E",            200)
-CHAR("`I",                     "I",            204)
-CHAR("`O",                     "O",            210)
-CHAR("`U",                     "U",            217)
-CHAR("`a",                     "a",            224)
-CHAR("`e",                     "e",            232)
-CHAR("`i",                     "i",            236)
-CHAR("`o",                     "o",            242)
-CHAR("`u",                     "u",            249)
-CHAR("~A",                     "A",            195)
-CHAR("~N",                     "N",            209)
-CHAR("~O",                     "O",            213)
-CHAR("~a",                     "a",            227)
-CHAR("~n",                     "n",            241)
-CHAR("~o",                     "o",            245)
+CHAR(",C",                     ",\bC",         199)
+CHAR(",c",                     ",\bc",         231)
+CHAR("/L",                     "/\bL",         321)
+CHAR("/O",                     "/\bO",         216)
+CHAR("/l",                     "/\bl",         322)
+CHAR("/o",                     "/\bo",         248)
+CHAR("oA",                     "o\bA",         197)
+CHAR("oa",                     "o\ba",         229)
+CHAR(":A",                     "\"\bA",        196)
+CHAR(":E",                     "\"\bE",        203)
+CHAR(":I",                     "\"\bI",        207)
+CHAR(":O",                     "\"\bO",        214)
+CHAR(":U",                     "\"\bU",        220)
+CHAR(":a",                     "\"\ba",        228)
+CHAR(":e",                     "\"\be",        235)
+CHAR(":i",                     "\"\bi",        239)
+CHAR(":o",                     "\"\bo",        246)
+CHAR(":u",                     "\"\bu",        252)
+CHAR(":y",                     "\"\by",        255)
+CHAR("'A",                     "'\bA",         193)
+CHAR("'E",                     "'\bE",         201)
+CHAR("'I",                     "'\bI",         205)
+CHAR("'O",                     "'\bO",         211)
+CHAR("'U",                     "'\bU",         218)
+CHAR("'a",                     "'\ba",         225)
+CHAR("'e",                     "'\be",         233)
+CHAR("'i",                     "'\bi",         237)
+CHAR("'o",                     "'\bo",         243)
+CHAR("'u",                     "'\bu",         250)
+CHAR("^A",                     "^\bA",         194)
+CHAR("^E",                     "^\bE",         202)
+CHAR("^I",                     "^\bI",         206)
+CHAR("^O",                     "^\bO",         212)
+CHAR("^U",                     "^\bU",         219)
+CHAR("^a",                     "^\ba",         226)
+CHAR("^e",                     "^\be",         234)
+CHAR("^i",                     "^\bi",         238)
+CHAR("^o",                     "^\bo",         244)
+CHAR("^u",                     "^\bu",         251)
+CHAR("`A",                     "`\bA",         192)
+CHAR("`E",                     "`\bE",         200)
+CHAR("`I",                     "`\bI",         204)
+CHAR("`O",                     "`\bO",         210)
+CHAR("`U",                     "`\bU",         217)
+CHAR("`a",                     "`\ba",         224)
+CHAR("`e",                     "`\be",         232)
+CHAR("`i",                     "`\bi",         236)
+CHAR("`o",                     "`\bo",         242)
+CHAR("`u",                     "`\bu",         249)
+CHAR("~A",                     "~\bA",         195)
+CHAR("~N",                     "~\bN",         209)
+CHAR("~O",                     "~\bO",         213)
+CHAR("~a",                     "~\ba",         227)
+CHAR("~n",                     "~\bn",         241)
+CHAR("~o",                     "~\bo",         245)
 
 /* Arrows and lines. */
 CHAR("<-",                     "<-",           8592)
@@ -336,22 +336,22 @@ CHAR("IJ",                        "IJ",           306)
 CHAR("ij",                     "ij",           307)
 
 /* Special letters. */
-CHAR("-D",                     "D",            208)
-CHAR("Sd",                     "o",            240)
-CHAR("TP",                     "b",            222)
-CHAR("Tp",                     "b",            254)
+CHAR("-D",                     "-\bD",         208)
+CHAR("Sd",                     "d",            240)
+CHAR("TP",                     "Th",           222)
+CHAR("Tp",                     "th",           254)
 CHAR(".i",                     "i",            305)
 CHAR(".j",                     "j",            567)
 
 /* Currency. */
 CHAR("Do",                     "$",            36)
-CHAR("ct",                     "c",            162)
+CHAR("ct",                     "/\bc",         162)
 CHAR("Eu",                     "EUR",          8364)
 CHAR("eu",                     "EUR",          8364)
-CHAR("Ye",                     "Y",            165)
-CHAR("Po",                     "L",            163)
-CHAR("Cs",                     "x",            164)
-CHAR("Fn",                     "f",            402)
+CHAR("Ye",                     "=\bY",         165)
+CHAR("Po",                     "GBP",          163)
+CHAR("Cs",                     "o\bx",         164)
+CHAR("Fn",                     ",\bf",         402)
 
 /* Lines. */
 CHAR("ba",                     "|",            124)
@@ -369,8 +369,8 @@ CHAR("dd",                  "=",            8225)
 CHAR("dg",                     "-",            8224)
 CHAR("lz",                     "<>",           9674)
 CHAR("sq",                     "[]",           9633)
-CHAR("ps",                     "9|",           182)
-CHAR("sc",                     "S",            167)
+CHAR("ps",                     "<par>",        182)
+CHAR("sc",                     "<sec>",        167)
 CHAR("lh",                     "<=",           9756)
 CHAR("rh",                     "=>",           9758)
 CHAR("at",                     "@",            64)
@@ -385,18 +385,18 @@ CHAR("tm",                        "tm",           8482)
 
 /* Punctuation. */
 CHAR(".",                      ".",            46)
-CHAR("r!",                     "i",            161)
-CHAR("r?",                     "c",            191)
+CHAR("r!",                     "!",            161)
+CHAR("r?",                     "?",            191)
 CHAR("em",                     "--",           8212)
 CHAR("en",                     "-",            8211)
 CHAR("hy",                     "-",            8208)
 CHAR("e",                      "\\",           92)
 
 /* Units. */
-CHAR("de",                     "o",            176)
+CHAR("de",                     "<deg>",        176)
 CHAR("%0",                     "%o",           8240)
 CHAR("fm",                     "\'",           8242)
 CHAR("sd",                     "\"",           8243)
-CHAR("mc",                     "mu",           181)
+CHAR("mc",                     ",\bu",         181)
 
 CHAR_TBL_END
index 3b1a36f6cd96aef1bcbf31082c9369edc36fd79c..0f1c1e01bedffff949912654b3b4cc7da4f8bace 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: term_ascii.c,v 1.36 2014/10/26 18:12:28 schwarze Exp $ */
+/*     $Id: term_ascii.c,v 1.37 2014/10/28 02:43:59 schwarze Exp $ */
 /*
  * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -290,50 +290,50 @@ ascii_uc2str(int uc)
        "<88>", "<89>", "<8A>", "<8B>", "<8C>", "<8D>", "<8E>", "<8F>",
        "<90>", "<91>", "<92>", "<93>", "<94>", "<95>", "<96>", "<97>",
        "<99>", "<99>", "<9A>", "<9B>", "<9C>", "<9D>", "<9E>", "<9F>",
-       nbrsp,  "!",    "c",    "GBP",  "$?",   "Y=",   "|",    "<sec>",
-       "\"",   "(C)",  "a.",   "<<",   "<not>","",     "(R)",  "-",
-       "<deg>","+-",   "^2",   "^3",   "'",    "<my>", "<par>","*",
-       ",",    "^1",   "o.",   ">>",   "1/4",  "1/2",  "3/4",  "?",
-       "A",    "A",    "A",    "A",    "Ae",   "Aa",   "AE",   "C",
-       "E",    "E",    "E",    "E",    "I",    "I",    "I",    "I",
-       "D",    "N",    "O",    "O",    "O",    "O",    "Oe",   "*",
-       "Oe",   "U",    "U",    "U",    "Ue",   "Y",    "Th",   "ss",
-       "a",    "a",    "a",    "a",    "ae",   "aa",   "ae",   "c",
-       "e",    "e",    "e",    "e",    "i",    "i",    "i",    "i",
-       "d",    "n",    "o",    "o",    "o",    "o",    "oe",   "/",
-       "oe",   "u",    "u",    "u",    "ue",   "y",    "th",   "y",
-       "A",    "a",    "A",    "a",    "A",    "a",    "C",    "c",
-       "C",    "c",    "C",    "c",    "C",    "c",    "D",    "d",
-       "D",    "d",    "E",    "e",    "E",    "e",    "E",    "e",
-       "E",    "e",    "E",    "e",    "G",    "g",    "G",    "g",
-       "G",    "g",    "G",    "g",    "H",    "h",    "H",    "h",
-       "I",    "i",    "I",    "i",    "I",    "i",    "I",    "i",
-       "I",    "i",    "IJ",   "ij",   "J",    "j",    "K",    "k",
-       "q",    "L",    "l",    "L",    "l",    "L",    "l",    "L",
-       "l",    "L",    "l",    "N",    "n",    "N",    "n",    "N",
+       nbrsp,  "!",    "/\bc", "GBP",  "o\bx", "=\bY", "|",    "<sec>",
+       "\"",   "(C)",  "_\ba", "<<",   "~",    "",     "(R)",  "-",
+       "<deg>","+-",   "2",    "3",    "'",    ",\bu", "<par>",".",
+       ",",    "1",    "_\bo", ">>",   "1/4",  "1/2",  "3/4",  "?",
+       "`\bA", "'\bA", "^\bA", "~\bA", "\"\bA","o\bA", "AE",   ",\bC",
+       "`\bE", "'\bE", "^\bE", "\"\bE","`\bI", "'\bI", "^\bI", "\"\bI",
+       "-\bD", "~\bN", "`\bO", "'\bO", "^\bO", "~\bO", "\"\bO","x",
+       "/\bO", "`\bU", "'\bU", "^\bU", "\"\bU","'\bY", "Th",   "ss",
+       "`\ba", "'\ba", "^\ba", "~\ba", "\"\ba","o\ba", "ae",   ",\bc",
+       "`\be", "'\be", "^\be", "\"\be","`\bi", "'\bi", "^\bi", "\"\bi",
+       "d",    "~\bn", "`\bo", "'\bo", "^\bo", "~\bo", "\"\bo","-:-",
+       "/\bo", "`\bu", "'\bu", "^\bu", "\"\bu","'\by", "th",   "\"\by",
+       "A",    "a",    "A",    "a",    "A",    "a",    "'\bC", "'\bc",
+       "^\bC", "^\bc", "C",    "c",    "C",    "c",    "D",    "d",
+       "/\bD", "/\bd", "E",    "e",    "E",    "e",    "E",    "e",
+       "E",    "e",    "E",    "e",    "^\bG", "^\bg", "G",    "g",
+       "G",    "g",    ",\bG", ",\bg", "^\bH", "^\bh", "/\bH", "/\bh",
+       "~\bI", "~\bi", "I",    "i",    "I",    "i",    "I",    "i",
+       "I",    "i",    "IJ",   "ij",   "^\bJ", "^\bj", ",\bK", ",\bk",
+       "q",    "'\bL", "'\bl", ",\bL", ",\bl", "L",    "l",    "L",
+       "l",    "/\bL", "/\bl", "'\bN", "'\bn", ",\bN", ",\bn", "N",
        "n",    "'n",   "Ng",   "ng",   "O",    "o",    "O",    "o",
-       "O",    "o",    "OE",   "oe",   "R",    "r",    "R",    "r",
-       "R",    "r",    "S",    "s",    "S",    "s",    "S",    "s",
-       "S",    "s",    "T",    "t",    "T",    "t",    "T",    "t",
-       "U",    "u",    "U",    "u",    "U",    "u",    "U",    "u",
-       "U",    "u",    "U",    "u",    "W",    "w",    "Y",    "y",
-       "Y",    "Z",    "z",    "Z",    "z",    "Z",    "z",    "s",
+       "O",    "o",    "OE",   "oe",   "'\bR", "'\br", ",\bR", ",\br",
+       "R",    "r",    "'\bS", "'\bs", "^\bS", "^\bs", ",\bS", ",\bs",
+       "S",    "s",    ",\bT", ",\bt", "T",    "t",    "/\bT", "/\bt",
+       "~\bU", "~\bu", "U",    "u",    "U",    "u",    "U",    "u",
+       "U",    "u",    "U",    "u",    "^\bW", "^\bw", "^\bY", "^\by",
+       "\"\bY","'\bZ", "'\bz", "Z",    "z",    "Z",    "z",    "s",
        "b",    "B",    "B",    "b",    "6",    "6",    "O",    "C",
        "c",    "D",    "D",    "D",    "d",    "d",    "3",    "@",
-       "E",    "F",    "f",    "G",    "G",    "hv",   "I",    "I",
-       "K",    "k",    "l",    "l",    "W",    "N",    "n",    "O",
+       "E",    "F",    ",\bf", "G",    "G",    "hv",   "I",    "/\bI",
+       "K",    "k",    "/\bl", "l",    "W",    "N",    "n",    "~\bO",
        "O",    "o",    "OI",   "oi",   "P",    "p",    "YR",   "2",
        "2",    "SH",   "sh",   "t",    "T",    "t",    "T",    "U",
-       "u",    "Y",    "V",    "Y",    "y",    "Z",    "z",    "ZH",
-       "ZH",   "zh",   "zh",   "2",    "5",    "5",    "ts",   "w",
+       "u",    "Y",    "V",    "Y",    "y",    "/\bZ", "/\bz", "ZH",
+       "ZH",   "zh",   "zh",   "/\b2", "5",    "5",    "ts",   "w",
        "|",    "||",   "|=",   "!",    "DZ",   "Dz",   "dz",   "LJ",
        "Lj",   "lj",   "NJ",   "Nj",   "nj",   "A",    "a",    "I",
        "i",    "O",    "o",    "U",    "u",    "U",    "u",    "U",
        "u",    "U",    "u",    "U",    "u",    "@",    "A",    "a",
-       "A",    "a",    "AE",   "ae",   "G",    "g",    "G",    "g",
+       "A",    "a",    "AE",   "ae",   "/\bG", "/\bg", "G",    "g",
        "K",    "k",    "O",    "o",    "O",    "o",    "ZH",   "zh",
-       "j",    "DZ",   "D",    "dz",   "G",    "g",    "HV",   "W",
-       "N",    "n",    "A",    "a",    "AE",   "ae",   "O",    "o"};
+       "j",    "DZ",   "Dz",   "dz",   "'\bG", "'\bg", "HV",   "W",
+       "`\bN", "`\bn", "A",    "a",    "'\bAE","'\bae","O",    "o"};
 
        if (uc < 0)
                return("<?>");