summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-08-23 10:50:11 +0000
committerschwarze <schwarze@openbsd.org>2017-08-23 10:50:11 +0000
commitc250368c07e068f2ffadfa52b6c811e3835f245a (patch)
tree187e9710f19cab1a4aad94b09af1ab1bb6dddc84
parentUpdate IO-Socket-IP to 0.39, bug fix needed for p5-Net-DNS 1.12. (diff)
downloadwireguard-openbsd-c250368c07e068f2ffadfa52b6c811e3835f245a.tar.xz
wireguard-openbsd-c250368c07e068f2ffadfa52b6c811e3835f245a.zip
Switch ASCII rendering of the same mathematical symbols and greek
letters as in groff commit babca15f from trying to imitate the characters' graphical shapes, which resulted in unintelligible renderings in many cases, to transliterations conveying the characters' meanings. One benefit is making these characters usable for portable manual pages. Solving a problem pointed out by bentley@.
-rw-r--r--usr.bin/mandoc/chars.c156
-rw-r--r--usr.bin/mandoc/term_ascii.c12
2 files changed, 84 insertions, 84 deletions
diff --git a/usr.bin/mandoc/chars.c b/usr.bin/mandoc/chars.c
index 13bb663a3a0..c0c6796620c 100644
--- a/usr.bin/mandoc/chars.c
+++ b/usr.bin/mandoc/chars.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chars.c,v 1.41 2017/06/14 20:56:42 schwarze Exp $ */
+/* $OpenBSD: chars.c,v 1.42 2017/08/23 10:50:11 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -68,17 +68,17 @@ static struct ln lines[] = {
/* Text markers. */
{ "ci", "O", 0x25cb },
{ "bu", "+\bo", 0x2022 },
- { "dd", "|\b=", 0x2021 },
- { "dg", "|\b-", 0x2020 },
+ { "dd", "<**>", 0x2021 },
+ { "dg", "<*>", 0x2020 },
{ "lz", "<>", 0x25ca },
{ "sq", "[]", 0x25a1 },
- { "ps", "<par>", 0x00b6 },
- { "sc", "<sec>", 0x00a7 },
+ { "ps", "<paragraph>", 0x00b6 },
+ { "sc", "<section>", 0x00a7 },
{ "lh", "<=", 0x261c },
{ "rh", "=>", 0x261e },
{ "at", "@", 0x0040 },
{ "sh", "#", 0x0023 },
- { "CR", "_|", 0x21b5 },
+ { "CR", "<cr>", 0x21b5 },
{ "OK", "\\/", 0x2713 },
{ "CL", "<club>", 0x2663 },
{ "SP", "<spade>", 0x2660 },
@@ -171,11 +171,11 @@ static struct ln lines[] = {
{ "OR", "v", 0x2228 },
{ "no", "~", 0x00ac },
{ "tno", "~", 0x00ac },
- { "te", "3", 0x2203 },
- { "fa", "-\bV", 0x2200 },
- { "st", "-)", 0x220b },
- { "tf", ".:.", 0x2234 },
- { "3d", ".:.", 0x2234 },
+ { "te", "<there\037exists>", 0x2203 },
+ { "fa", "<for\037all>", 0x2200 },
+ { "st", "<such\037that>", 0x220b },
+ { "tf", "<therefore>", 0x2234 },
+ { "3d", "<therefore>", 0x2234 },
{ "or", "|", 0x007c },
/* Mathematicals. */
@@ -191,8 +191,8 @@ static struct ln lines[] = {
{ "tmu", "x", 0x00d7 },
{ "c*", "O\bx", 0x2297 },
{ "c+", "O\b+", 0x2295 },
- { "di", "-:-", 0x00f7 },
- { "tdi", "-:-", 0x00f7 },
+ { "di", "/", 0x00f7 },
+ { "tdi", "/", 0x00f7 },
{ "f/", "/", 0x2044 },
{ "**", "*", 0x2217 },
{ "<=", "<=", 0x2264 },
@@ -208,38 +208,38 @@ static struct ln lines[] = {
{ "=~", "=~", 0x2245 },
{ "~~", "~~", 0x2248 },
{ "~=", "~=", 0x2248 },
- { "pt", "oc", 0x221d },
+ { "pt", "<proportional\037to>", 0x221d },
{ "es", "{}", 0x2205 },
- { "mo", "E", 0x2208 },
- { "nm", "!E", 0x2209 },
- { "sb", "(=", 0x2282 },
+ { "mo", "<element\037of>", 0x2208 },
+ { "nm", "<not\037element\037of>", 0x2209 },
+ { "sb", "<proper\037subset>", 0x2282 },
{ "nb", "(!=", 0x2284 },
- { "sp", "=)", 0x2283 },
+ { "sp", "<proper\037superset>", 0x2283 },
{ "nc", "!=)", 0x2285 },
- { "ib", "(=\b_", 0x2286 },
- { "ip", "=\b_)", 0x2287 },
- { "ca", "(^)", 0x2229 },
- { "cu", "U", 0x222a },
- { "/_", "_\b/", 0x2220 },
- { "pp", "_\b|", 0x22a5 },
- { "is", "'\b,\bI", 0x222b },
+ { "ib", "<subset\037or\037equal>", 0x2286 },
+ { "ip", "<superset\037or\037equal>", 0x2287 },
+ { "ca", "<intersection>", 0x2229 },
+ { "cu", "<union>", 0x222a },
+ { "/_", "<angle>", 0x2220 },
+ { "pp", "<perpendicular>", 0x22a5 },
+ { "is", "<integral>", 0x222b },
{ "integral", "'\b,\bI", 0x222b },
{ "sum", "E", 0x2211 },
{ "product", "TT", 0x220f },
{ "coproduct", "U", 0x2210 },
- { "gr", "V", 0x2207 },
- { "sr", "\\/", 0x221a },
+ { "gr", "<nabla>", 0x2207 },
+ { "sr", "<sqrt>", 0x221a },
{ "sqrt", "\\/", 0x221a },
{ "lc", "|~", 0x2308 },
{ "rc", "~|", 0x2309 },
{ "lf", "|_", 0x230a },
{ "rf", "_|", 0x230b },
- { "if", "oo", 0x221e },
- { "Ah", "N", 0x2135 },
- { "Im", "I", 0x2111 },
- { "Re", "R", 0x211c },
+ { "if", "<infinity>", 0x221e },
+ { "Ah", "<Aleph>", 0x2135 },
+ { "Im", "<Im>", 0x2111 },
+ { "Re", "<Re>", 0x211c },
{ "wp", "P", 0x2118 },
- { "pd", "a", 0x2202 },
+ { "pd", "<del>", 0x2202 },
{ "-h", "/h", 0x210f },
{ "hbar", "/h", 0x210f },
{ "12", "1/2", 0x00bd },
@@ -249,9 +249,9 @@ static struct ln lines[] = {
{ "38", "3/8", 0x215C },
{ "58", "5/8", 0x215D },
{ "78", "7/8", 0x215E },
- { "S1", "1", 0x00B9 },
- { "S2", "2", 0x00B2 },
- { "S3", "3", 0x00B3 },
+ { "S1", "^1", 0x00B9 },
+ { "S2", "^2", 0x00B2 },
+ { "S3", "^3", 0x00B3 },
/* Ligatures. */
{ "ff", "ff", 0xfb00 },
@@ -344,8 +344,8 @@ static struct ln lines[] = {
{ "oa", "o\ba", 0x00e5 },
/* Special letters. */
- { "-D", "-\bD", 0x00d0 },
- { "Sd", "d", 0x00f0 },
+ { "-D", "Dh", 0x00d0 },
+ { "Sd", "dh", 0x00f0 },
{ "TP", "Th", 0x00de },
{ "Tp", "th", 0x00fe },
{ ".i", "i", 0x0131 },
@@ -362,68 +362,68 @@ static struct ln lines[] = {
{ "Fn", ",\bf", 0x0192 },
/* Units. */
- { "de", "<deg>", 0x00b0 },
- { "%0", "%o", 0x2030 },
+ { "de", "<degree>", 0x00b0 },
+ { "%0", "<permille>", 0x2030 },
{ "fm", "\'", 0x2032 },
{ "sd", "''", 0x2033 },
- { "mc", ",\bu", 0x00b5 },
+ { "mc", "<micro>", 0x00b5 },
{ "Of", "_\ba", 0x00aa },
{ "Om", "_\bo", 0x00ba },
/* Greek characters. */
{ "*A", "A", 0x0391 },
{ "*B", "B", 0x0392 },
- { "*G", "G", 0x0393 },
- { "*D", "_\b/_\b\\", 0x0394 },
+ { "*G", "<Gamma>", 0x0393 },
+ { "*D", "<Delta>", 0x0394 },
{ "*E", "E", 0x0395 },
{ "*Z", "Z", 0x0396 },
{ "*Y", "H", 0x0397 },
- { "*H", "-\bO", 0x0398 },
+ { "*H", "<Theta>", 0x0398 },
{ "*I", "I", 0x0399 },
{ "*K", "K", 0x039a },
- { "*L", "/\\", 0x039b },
+ { "*L", "<Lambda>", 0x039b },
{ "*M", "M", 0x039c },
{ "*N", "N", 0x039d },
- { "*C", "_\bH", 0x039e },
+ { "*C", "<Xi>", 0x039e },
{ "*O", "O", 0x039f },
- { "*P", "TT", 0x03a0 },
+ { "*P", "<Pi>", 0x03a0 },
{ "*R", "P", 0x03a1 },
- { "*S", "S", 0x03a3 },
+ { "*S", "<Sigma>", 0x03a3 },
{ "*T", "T", 0x03a4 },
{ "*U", "Y", 0x03a5 },
- { "*F", "I\bO", 0x03a6 },
+ { "*F", "<Phi>", 0x03a6 },
{ "*X", "X", 0x03a7 },
- { "*Q", "I\bY", 0x03a8 },
- { "*W", "_\bO", 0x03a9 },
- { "*a", "a", 0x03b1 },
- { "*b", "B", 0x03b2 },
- { "*g", "y", 0x03b3 },
- { "*d", "d", 0x03b4 },
- { "*e", "e", 0x03b5 },
- { "*z", ",\bC", 0x03b6 },
- { "*y", "n", 0x03b7 },
- { "*h", "-\b0", 0x03b8 },
- { "*i", "i", 0x03b9 },
- { "*k", "k", 0x03ba },
- { "*l", ">\b\\", 0x03bb },
- { "*m", ",\bu", 0x03bc },
- { "*n", "v", 0x03bd },
- { "*c", ",\bE", 0x03be },
+ { "*Q", "<Psi>", 0x03a8 },
+ { "*W", "<Omega>", 0x03a9 },
+ { "*a", "<alpha>", 0x03b1 },
+ { "*b", "<beta>", 0x03b2 },
+ { "*g", "<gamma>", 0x03b3 },
+ { "*d", "<delta>", 0x03b4 },
+ { "*e", "<epsilon>", 0x03b5 },
+ { "*z", "<zeta>", 0x03b6 },
+ { "*y", "<eta>", 0x03b7 },
+ { "*h", "<theta>", 0x03b8 },
+ { "*i", "<iota>", 0x03b9 },
+ { "*k", "<kappa>", 0x03ba },
+ { "*l", "<lambda>", 0x03bb },
+ { "*m", "<mu>", 0x03bc },
+ { "*n", "<nu>", 0x03bd },
+ { "*c", "<xi>", 0x03be },
{ "*o", "o", 0x03bf },
- { "*p", "-\bn", 0x03c0 },
- { "*r", "p", 0x03c1 },
- { "*s", "-\bo", 0x03c3 },
- { "*t", "~\bt", 0x03c4 },
- { "*u", "u", 0x03c5 },
- { "*f", "|\bo", 0x03d5 },
- { "*x", "x", 0x03c7 },
- { "*q", "|\bu", 0x03c8 },
- { "*w", "w", 0x03c9 },
- { "+h", "-\b0", 0x03d1 },
- { "+f", "|\bo", 0x03c6 },
- { "+p", "-\bw", 0x03d6 },
- { "+e", "e", 0x03f5 },
- { "ts", "s", 0x03c2 },
+ { "*p", "<pi>", 0x03c0 },
+ { "*r", "<rho>", 0x03c1 },
+ { "*s", "<sigma>", 0x03c3 },
+ { "*t", "<tau>", 0x03c4 },
+ { "*u", "<upsilon>", 0x03c5 },
+ { "*f", "<phi>", 0x03d5 },
+ { "*x", "<chi>", 0x03c7 },
+ { "*q", "<psi>", 0x03c8 },
+ { "*w", "<omega>", 0x03c9 },
+ { "+h", "<theta>", 0x03d1 },
+ { "+f", "<phi>", 0x03c6 },
+ { "+p", "<pi>", 0x03d6 },
+ { "+e", "<epsilon>", 0x03f5 },
+ { "ts", "<sigma>", 0x03c2 },
};
static struct ohash mchars;
diff --git a/usr.bin/mandoc/term_ascii.c b/usr.bin/mandoc/term_ascii.c
index a989f73f933..73b6da603b0 100644
--- a/usr.bin/mandoc/term_ascii.c
+++ b/usr.bin/mandoc/term_ascii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term_ascii.c,v 1.43 2017/06/14 14:23:50 schwarze Exp $ */
+/* $OpenBSD: term_ascii.c,v 1.44 2017/08/23 10:50:11 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -282,17 +282,17 @@ ascii_uc2str(int uc)
"<88>", "<89>", "<8A>", "<8B>", "<8C>", "<8D>", "<8E>", "<8F>",
"<90>", "<91>", "<92>", "<93>", "<94>", "<95>", "<96>", "<97>",
"<98>", "<99>", "<9A>", "<9B>", "<9C>", "<9D>", "<9E>", "<9F>",
- nbrsp, "!", "/\bc", "GBP", "o\bx", "=\bY", "|", "<sec>",
+ nbrsp, "!", "/\bc", "GBP", "o\bx", "=\bY", "|", "<section>",
"\"", "(C)", "_\ba", "<<", "~", "", "(R)", "-",
- "<deg>","+-", "2", "3", "'", ",\bu", "<par>",".",
- ",", "1", "_\bo", ">>", "1/4", "1/2", "3/4", "?",
+ "<degree>","+-","^2", "^3", "'","<micro>","<paragraph>",".",
+ ",", "^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",
+ "Dh", "~\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","-:-",
+ "dh", "~\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",