-# $OpenBSD: Makefile,v 1.3 2012/07/13 14:15:50 schwarze Exp $
+# $OpenBSD: Makefile,v 1.4 2014/12/23 06:16:21 schwarze Exp $
-REGRESS_TARGETS = badargs-mdoc badargs-man negative
+REGRESS_TARGETS = badargs-man badargs-mdoc negative scaling-man scaling-mdoc
.include <bsd.regress.mk>
--- /dev/null
+.TH SP-SCALING-MAN 1 "December 23, 2014" OpenBSD
+.SH NAME
+sp-scaling-man \- scaled arguments to .sp requests in man(7)
+.SH DESCRIPTION
+20 basic units:
+.sp 20u
+21 basic units:
+.sp 21u
+one centimeter:
+.sp 1c
+quarter of an inch:
+.sp 0.25i
+half a pica:
+.sp 0.5P
+one pica:
+.sp 1P
+6 points:
+.sp 6p
+7 points:
+.sp 7p
+one en:
+.sp 1n
+three en:
+.sp 3n
+two em:
+.sp 2m
+end of test document
--- /dev/null
+SP-SCALING-MAN(1) General Commands Manual SP-SCALING-MAN(1)
+
+
+
+N\bNA\bAM\bME\bE
+ sp-scaling-man - scaled arguments to .sp requests in man(7)
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ 20 basic units:
+ 21 basic units:
+
+ one centimeter:
+
+
+ quarter of an inch:
+
+ half a pica:
+ one pica:
+
+ 6 points:
+ 7 points:
+
+ one en:
+
+ three en:
+
+
+ two em:
+
+ end of test document
+
+
+
+OpenBSD December 23, 2014 SP-SCALING-MAN(1)
--- /dev/null
+.Dd December 23, 2014
+.Dt SP-SCALING-MDOC 1
+.Os OpenBSD
+.Sh NAME
+.Nm sp-scaling-mdoc
+.Nd scaled arguments to .sp requests in mdoc(7)
+.Sh DESCRIPTION
+20 basic units:
+.sp 20u
+21 basic units:
+.sp 21u
+one centimeter:
+.sp 1c
+quarter of an inch:
+.sp 0.25i
+half a pica:
+.sp 0.5P
+one pica:
+.sp 1P
+6 points:
+.sp 6p
+7 points:
+.sp 7p
+one en:
+.sp 1n
+three en:
+.sp 3n
+two em:
+.sp 2m
+end of test document
--- /dev/null
+SP-SCALING-MDOC(1) General Commands Manual SP-SCALING-MDOC(1)
+
+N\bNA\bAM\bME\bE
+ s\bsp\bp-\b-s\bsc\bca\bal\bli\bin\bng\bg-\b-m\bmd\bdo\boc\bc - scaled arguments to .sp requests in mdoc(7)
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ 20 basic units:
+ 21 basic units:
+
+ one centimeter:
+
+
+ quarter of an inch:
+
+ half a pica:
+ one pica:
+
+ 6 points:
+ 7 points:
+
+ one en:
+
+ three en:
+
+
+ two em:
+
+ end of test document
+
+OpenBSD December 23, 2014 OpenBSD
-/* $OpenBSD: term.c,v 1.98 2014/12/19 17:10:42 schwarze Exp $ */
+/* $OpenBSD: term.c,v 1.99 2014/12/23 06:16:21 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
double r;
switch (su->unit) {
+ case SCALE_BU:
+ r = su->scale / 40.0;
+ break;
case SCALE_CM:
- r = su->scale * 2.0;
+ r = su->scale * 6.0 / 2.54;
+ break;
+ case SCALE_FS:
+ r = su->scale * 65536.0 / 40.0;
break;
case SCALE_IN:
r = su->scale * 6.0;
break;
+ case SCALE_MM:
+ r = su->scale * 0.006;
+ break;
case SCALE_PC:
r = su->scale;
break;
case SCALE_PT:
- r = su->scale / 8.0;
+ r = su->scale / 12.0;
break;
- case SCALE_MM:
- r = su->scale / 1000.0;
+ case SCALE_EN:
+ /* FALLTHROUGH */
+ case SCALE_EM:
+ r = su->scale * 0.6;
break;
case SCALE_VS:
r = su->scale;
break;
default:
- r = su->scale - 1.0;
- break;
+ abort();
+ /* NOTREACHED */
}
if (r < 0.0)
r = 0.0;
- return((size_t)(r + 0.0005));
+ return((size_t)(r + 0.4995));
}
size_t