summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-13 22:00:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-13 22:00:47 +0000
commit20f575dbc9204dc8160154cc316fc82dc3b64188 (patch)
treefdc67b9c480e98e6c2a0fc1e1ef8fe53184b036b /mdoc_term.c
parent61fcdf77510d89258927a8cfc957096701a22191 (diff)
downloadmandoc-20f575dbc9204dc8160154cc316fc82dc3b64188.tar.gz
Properly scale string length measurements for PostScript and PDF output;
this doesn't change anything for ASCII and UTF-8. Problem reported by bentley@.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 7ece23fe..a7266724 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -541,8 +541,10 @@ a2width(const struct termp *p, const char *v)
struct roffsu su;
assert(v);
- if ( ! a2roffsu(v, &su, SCALE_MAX))
+ if ( ! a2roffsu(v, &su, SCALE_MAX)) {
SCALE_HS_INIT(&su, term_strlen(p, v));
+ su.scale /= term_strlen(p, "0");
+ }
return(term_hspan(p, &su));
}
@@ -560,8 +562,10 @@ a2offs(const struct termp *p, const char *v)
return(term_len(p, p->defindent + 1));
else if (0 == strcmp(v, "indent-two"))
return(term_len(p, (p->defindent + 1) * 2));
- else if ( ! a2roffsu(v, &su, SCALE_MAX))
+ else if ( ! a2roffsu(v, &su, SCALE_MAX)) {
SCALE_HS_INIT(&su, term_strlen(p, v));
+ su.scale /= term_strlen(p, "0");
+ }
return(term_hspan(p, &su));
}