diff options
-rw-r--r-- | mdoc_term.c | 6 | ||||
-rw-r--r-- | term.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/mdoc_term.c b/mdoc_term.c index 5457836d..789d3454 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -494,13 +494,13 @@ arg2width(const struct mdoc_argv *arg, int pos) assert(arg->value[pos]); if ( ! a2roffsu(arg->value[pos], &su, SCALE_MAX)) - SCALE_HS_INIT(&su, strlen(arg->value[pos]) + 2); + SCALE_HS_INIT(&su, strlen(arg->value[pos])); - return(term_hspan(&su)); + /* XXX: pachemu? */ + return(term_hspan(&su) + 2); } -/* FIXME: put in utility file for front-ends. */ static int arg_listtype(const struct mdoc_node *n) { @@ -602,18 +602,21 @@ term_hspan(const struct roffsu *su) { double r; + /* XXX: CM, IN, and PT are approximations. */ + switch (su->unit) { case (SCALE_CM): - r = (4 * su->scale) + 2; /* FIXME: double-check. */ + r = 4 * su->scale; break; case (SCALE_IN): - r = (10 * su->scale) + 2; /* FIXME: double-check. */ + /* XXX: this is an approximation. */ + r = 10 * su->scale; break; case (SCALE_PC): - r = (10 * su->scale) / 6; /* FIXME: double-check. */ + r = (10 * su->scale) / 6; break; case (SCALE_PT): - r = (10 * su->scale) / 72; /* FIXME: double-check. */ + r = (10 * su->scale) / 72; break; case (SCALE_MM): r = su->scale / 1000; /* FIXME: double-check. */ |