aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-04 17:47:18 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-04 17:47:18 +0000
commita203fd4e6f05d56d51d63d78b0357f1c67ffec39 (patch)
treeed23dfa1c237f1cd01f66b96ab8912beb1bcd018 /term.h
parentec66e073f559e3a2d8c56fd67060b2ccde12788a (diff)
downloadmandoc-a203fd4e6f05d56d51d63d78b0357f1c67ffec39.tar.gz
mandoc-a203fd4e6f05d56d51d63d78b0357f1c67ffec39.tar.zst
mandoc-a203fd4e6f05d56d51d63d78b0357f1c67ffec39.zip
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).
Diffstat (limited to 'term.h')
-rw-r--r--term.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/term.h b/term.h
index ab34717b..bda7f7da 100644
--- a/term.h
+++ b/term.h
@@ -1,4 +1,4 @@
-/* $Id: term.h,v 1.112 2015/04/02 23:48:20 schwarze Exp $ */
+/* $Id: term.h,v 1.113 2015/04/04 17:47:18 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -95,9 +95,9 @@ struct termp {
void (*end)(struct termp *);
void (*endline)(struct termp *);
void (*advance)(struct termp *, size_t);
- void (*setwidth)(struct termp *, int, size_t);
+ void (*setwidth)(struct termp *, int, int);
size_t (*width)(const struct termp *, int);
- double (*hspan)(const struct termp *,
+ int (*hspan)(const struct termp *,
const struct roffsu *);
const void *argf; /* arg for headf/footf */
struct termp_ps *ps;