aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-05 02:06:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-05 02:06:19 +0000
commit1481c0648531c03ad8b53843797e3c269032f43c (patch)
tree45ea03c49eb82d26f334f5a790e760417bd7b9b5 /roff_term.c
parentd4309408b94eb36fcea040582e8579967cb7878b (diff)
downloadmandoc-1481c0648531c03ad8b53843797e3c269032f43c.tar.gz
mandoc-1481c0648531c03ad8b53843797e3c269032f43c.tar.zst
mandoc-1481c0648531c03ad8b53843797e3c269032f43c.zip
Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules. As a side effect, mdoc(7) now handles .ft, too. Of course, do not use that.
Diffstat (limited to 'roff_term.c')
-rw-r--r--roff_term.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/roff_term.c b/roff_term.c
index d96d9dd8..cd9fba37 100644
--- a/roff_term.c
+++ b/roff_term.c
@@ -1,6 +1,6 @@
/* $OpenBSD$ */
/*
- * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -27,9 +27,11 @@
typedef void (*roff_term_pre_fp)(ROFF_TERM_ARGS);
static void roff_term_pre_br(ROFF_TERM_ARGS);
+static void roff_term_pre_ft(ROFF_TERM_ARGS);
static const roff_term_pre_fp roff_term_pre_acts[ROFF_MAX] = {
roff_term_pre_br, /* br */
+ roff_term_pre_ft, /* ft */
};
@@ -50,3 +52,29 @@ roff_term_pre_br(ROFF_TERM_ARGS)
p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
}
}
+
+static void
+roff_term_pre_ft(ROFF_TERM_ARGS)
+{
+ switch (*n->child->string) {
+ case '4':
+ case '3':
+ case 'B':
+ term_fontrepl(p, TERMFONT_BOLD);
+ break;
+ case '2':
+ case 'I':
+ term_fontrepl(p, TERMFONT_UNDER);
+ break;
+ case 'P':
+ term_fontlast(p);
+ break;
+ case '1':
+ case 'C':
+ case 'R':
+ term_fontrepl(p, TERMFONT_NONE);
+ break;
+ default:
+ break;
+ }
+}