From 20f575dbc9204dc8160154cc316fc82dc3b64188 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 13 Oct 2014 22:00:47 +0000 Subject: Properly scale string length measurements for PostScript and PDF output; this doesn't change anything for ASCII and UTF-8. Problem reported by bentley@. --- mdoc_term.c | 8 ++++++-- 1 file 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)); } -- cgit