From 11d090857365b38952fcebea7015e2d8b3bcf3e9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 4 Apr 2015 17:47:18 +0000 Subject: Rounding rules for horizontal scaling widths are more complicated. There is a first rounding to basic units on the input side. After that, rounding rules differ between requests and macros. Requests round to the nearest possible character position. Macros round to the next character position to the left. Implement that by changing the return value of term_hspan() to basic units and leaving the second scaling and rounding stage to the formatters instead of doing it in the terminal handler. Improves for example argtable2(3). --- mdoc_term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdoc_term.c') diff --git a/mdoc_term.c b/mdoc_term.c index 55598c4f..c4745c29 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -533,7 +533,7 @@ a2width(const struct termp *p, const char *v) SCALE_HS_INIT(&su, term_strlen(p, v)); su.scale /= term_strlen(p, "0"); } - return(term_hspan(p, &su)); + return(term_hspan(p, &su) / 24); } /* -- cgit