diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-26 16:44:22 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-26 16:44:22 +0000 |
commit | 9c76c6d767357bc47b14de643aa304c5dcc7977b (patch) | |
tree | 58b309f595637f4e18cac6767bed6503367a6ad9 | |
parent | 9411fef4a53cf7d424010611e37ecd186b283683 (diff) | |
download | mandoc-9c76c6d767357bc47b14de643aa304c5dcc7977b.tar.gz |
Added simple font-escapes.
-rw-r--r-- | mandoc.1 | 11 | ||||
-rw-r--r-- | terminal.c | 20 |
2 files changed, 31 insertions, 0 deletions
@@ -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 @@ -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); |