aboutsummaryrefslogtreecommitdiff
path: root/contrib/mandoc/term_ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/mandoc/term_ps.c')
-rw-r--r--contrib/mandoc/term_ps.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/mandoc/term_ps.c b/contrib/mandoc/term_ps.c
index 374d3d9a6abd..4c6368ca1d1f 100644
--- a/contrib/mandoc/term_ps.c
+++ b/contrib/mandoc/term_ps.c
@@ -1,7 +1,7 @@
-/* $Id: term_ps.c,v 1.92 2020/09/06 14:45:22 schwarze Exp $ */
+/* $Id: term_ps.c,v 1.94 2025/07/18 15:47:18 schwarze Exp $ */
/*
+ * Copyright (c) 2014-2017, 2020, 2025 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014,2015,2016,2017,2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2017 Marc Espie <espie@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -95,7 +95,7 @@ struct termp_ps {
static int ps_hspan(const struct termp *,
const struct roffsu *);
-static size_t ps_width(const struct termp *, int);
+static size_t ps_getwidth(const struct termp *, int);
static void ps_advance(struct termp *, size_t);
static void ps_begin(struct termp *);
static void ps_closepage(struct termp *);
@@ -549,7 +549,7 @@ pspdf_alloc(const struct manoutput *outopts, enum termtype type)
p->hspan = ps_hspan;
p->letter = ps_letter;
p->setwidth = ps_setwidth;
- p->width = ps_width;
+ p->getwidth = ps_getwidth;
/* Default to US letter (millimetres). */
@@ -1211,6 +1211,7 @@ ps_advance(struct termp *p, size_t len)
ps_plast(p);
ps_pclose(p);
p->ps->pscol += len;
+ p->viscol += len;
}
static void
@@ -1234,6 +1235,8 @@ ps_endline(struct termp *p)
/* Left-justify. */
p->ps->pscol = p->ps->left;
+ p->viscol = 0;
+ p->minbl = 0;
/* If we haven't printed anything, return. */
@@ -1282,7 +1285,7 @@ ps_setfont(struct termp *p, enum termfont f)
}
static size_t
-ps_width(const struct termp *p, int c)
+ps_getwidth(const struct termp *p, int c)
{
if (c <= 32 || c - 32 >= MAXCHAR)
@@ -1311,7 +1314,7 @@ ps_hspan(const struct termp *p, const struct roffsu *su)
* scaling unit so that output is the same regardless
* the media.
*/
- r = PNT2AFM(p, su->scale * 72.0 / 240.0);
+ r = PNT2AFM(p, su->scale * 72.0 / 10.0);
break;
case SCALE_CM:
r = PNT2AFM(p, su->scale * 72.0 / 2.54);
@@ -1344,8 +1347,7 @@ ps_hspan(const struct termp *p, const struct roffsu *su)
r = su->scale;
break;
}
-
- return r * 24.0;
+ return r;
}
static void