summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 16:44:22 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-26 16:44:22 +0000
commit9c76c6d767357bc47b14de643aa304c5dcc7977b (patch)
tree58b309f595637f4e18cac6767bed6503367a6ad9
parent9411fef4a53cf7d424010611e37ecd186b283683 (diff)
downloadmandoc-9c76c6d767357bc47b14de643aa304c5dcc7977b.tar.gz
Added simple font-escapes.
-rw-r--r--mandoc.111
-rw-r--r--terminal.c20
2 files changed, 31 insertions, 0 deletions
diff --git a/mandoc.1 b/mandoc.1
index 4b1616f7..326ee203 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -160,6 +160,17 @@ format is
recommended;
.Xr man 7
should only be used for legacy manuals.
+.Pp
+The following escape sequences are recognised, although the per-format
+compiler may not allow certain sequences.
+.Bl -tag -width Ds -offset XXXX
+.It \efX
+sets the font mode to X (B, I, R or P, where P resets the font)
+.It \eX, \e(XX, \e[XN]
+queries the special-character table for a corresponding symbol
+.It \e*X, \e*(XX, \e*[XN]
+deprecated special-character format
+.El
.\" SUB-SECTION
.Ss Output Formats
The
diff --git a/terminal.c b/terminal.c
index e77b7a63..75988eb8 100644
--- a/terminal.c
+++ b/terminal.c
@@ -454,6 +454,26 @@ term_pescape(struct termp *p, const char *word, int *i, int len)
term_nescape(p, &word[*i], 1);
return;
}
+
+ } else if ('f' == word[*i]) {
+ if (++(*i) >= len)
+ return;
+ switch (word[*i]) {
+ case ('B'):
+ p->flags |= TERMP_BOLD;
+ break;
+ case ('I'):
+ p->flags |= TERMP_UNDER;
+ break;
+ case ('P'):
+ /* FALLTHROUGH */
+ case ('R'):
+ p->flags &= ~TERMP_STYLE;
+ break;
+ default:
+ break;
+ }
+ return;
} else if ('[' != word[*i]) {
term_nescape(p, &word[*i], 1);