source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: round default width of tbl(7) text blocks in the same way as
@ 2017-06-15  0:27 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-15  0:27 UTC (permalink / raw)
  To: source

Log Message:
-----------
round default width of tbl(7) text blocks in the same way as groff

Modified Files:
--------------
    mdocml:
        out.c
    mdocml/regress/tbl/data:
        Makefile

Added Files:
-----------
    mdocml/regress/tbl/data:
        block_width.in
        block_width.out_ascii

Revision Data
-------------
Index: out.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/out.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -Lout.c -Lout.c -u -p -r1.68 -r1.69
--- out.c
+++ out.c
@@ -157,7 +157,8 @@ tblcalc(struct rofftbl *tbl, const struc
 			tblcalc_data(tbl, col, opts, dp,
 			    dp->block == 0 ? 0 :
 			    dp->layout->width ? dp->layout->width :
-			    rmargin ? rmargin / (sp->opts->cols + 1) : 0);
+			    rmargin ? (rmargin + sp->opts->cols / 2)
+			    / (sp->opts->cols + 1) : 0);
 		}
 	}
 
--- /dev/null
+++ regress/tbl/data/block_width.in
@@ -0,0 +1,102 @@
+.Dd June 15, 2017
+.Dt TBL-DATA-BLOCK_WIDTH 1
+.Os OpenBSD
+.Sh NAME
+.Nm tbl-data-block_width
+.Nd default width of text blocks
+.Sh DESCRIPTION
+one column:
+.TS
+allbox tab(:);
+l.
+T{
+1234567890123456789012345678901234567 9
+T}
+T{
+1234567890123456789012345678901234567 90
+T}
+.TE
+.sp
+two columns:
+.TS
+allbox tab(:);
+l l.
+a:T{
+123456789012345678901234 6
+T}
+a:T{
+123456789012345678901234 67
+T}
+.TE
+.sp
+three columns:
+.TS
+allbox tab(:);
+l l l.
+a:b:T{
+12345678901234567 9
+T}
+a:b:T{
+12345678901234567 90
+T}
+.TE
+.sp
+four columns:
+.TS
+allbox tab(:);
+l l l l.
+a:b:c:T{
+12345678901234 6
+T}
+a:b:c:T{
+12345678901234 67
+T}
+.TE
+.sp
+five columns:
+.TS
+allbox tab(:);
+l l l l l.
+a:b:c:d:T{
+12345678901 3
+T}
+a:b:c:d:T{
+12345678901 34
+T}
+.TE
+.sp
+six columns:
+.TS
+allbox tab(:);
+l l l l l l.
+a:b:c:d:e:T{
+123456789 1
+T}
+a:b:c:d:e:T{
+123456789 12
+T}
+.TE
+.sp
+seven columns:
+.TS
+allbox tab(:);
+l l l l l l l.
+a:b:c:d:e:f:T{
+12345678 0
+T}
+a:b:c:d:e:f:T{
+12345678 01
+T}
+.TE
+.sp
+eight columns:
+.TS
+allbox tab(:);
+l l l l l l l l.
+a:b:c:d:e:f:g:T{
+1234567 9
+T}
+a:b:c:d:e:f:g:T{
+1234567 90
+T}
+.TE
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/regress/tbl/data/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/tbl/data/Makefile -Lregress/tbl/data/Makefile -u -p -r1.2 -r1.3
--- regress/tbl/data/Makefile
+++ regress/tbl/data/Makefile
@@ -1,6 +1,6 @@
 # $OpenBSD: Makefile,v 1.1.1.1 2015/01/29 23:24:24 schwarze Exp $
 
-REGRESS_TARGETS	 = blankline block_unclosed block_wrap empty
+REGRESS_TARGETS	 = blankline block_unclosed block_width block_wrap empty
 LINT_TARGETS	 = block_unclosed empty
 
 # groff-1.22.3 defect:
--- /dev/null
+++ regress/tbl/data/block_width.out_ascii
@@ -0,0 +1,63 @@
+TBL-DATA-BLOCK_WIDTH(1)     General Commands Manual    TBL-DATA-BLOCK_WIDTH(1)
+
+N\bNA\bAM\bME\bE
+     t\btb\bbl\bl-\b-d\bda\bat\bta\ba-\b-b\bbl\blo\boc\bck\bk_\b_w\bwi\bid\bdt\bth\bh - default width of text blocks
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+     one column:
+     +----------------------------------------+
+     |1234567890123456789012345678901234567 9 |
+     +----------------------------------------+
+     |1234567890123456789012345678901234567   |
+     |90                                      |
+     +----------------------------------------+
+     two columns:
+     +--+----------------------------+
+     |a | 123456789012345678901234 6 |
+     +--+----------------------------+
+     |a | 123456789012345678901234   |
+     |  | 67                         |
+     +--+----------------------------+
+     three columns:
+     +--+---+---------------------+
+     |a | b | 12345678901234567 9 |
+     +--+---+---------------------+
+     |a | b | 12345678901234567   |
+     |  |   | 90                  |
+     +--+---+---------------------+
+     four columns:
+     +--+---+---+------------------+
+     |a | b | c | 12345678901234 6 |
+     +--+---+---+------------------+
+     |a | b | c | 12345678901234   |
+     |  |   |   | 67               |
+     +--+---+---+------------------+
+     five columns:
+     +--+---+---+---+---------------+
+     |a | b | c | d | 12345678901 3 |
+     +--+---+---+---+---------------+
+     |a | b | c | d | 12345678901   |
+     |  |   |   |   | 34            |
+     +--+---+---+---+---------------+
+     six columns:
+     +--+---+---+---+---+-------------+
+     |a | b | c | d | e | 123456789 1 |
+     +--+---+---+---+---+-------------+
+     |a | b | c | d | e | 123456789   |
+     |  |   |   |   |   | 12          |
+     +--+---+---+---+---+-------------+
+     seven columns:
+     +--+---+---+---+---+---+------------+
+     |a | b | c | d | e | f | 12345678 0 |
+     +--+---+---+---+---+---+------------+
+     |a | b | c | d | e | f | 12345678   |
+     |  |   |   |   |   |   | 01         |
+     +--+---+---+---+---+---+------------+
+     eight columns:
+     +--+---+---+---+---+---+---+-----------+
+     |a | b | c | d | e | f | g | 1234567 9 |
+     +--+---+---+---+---+---+---+-----------+
+     |a | b | c | d | e | f | g | 1234567   |
+     |  |   |   |   |   |   |   | 90        |
+     +--+---+---+---+---+---+---+-----------+
+OpenBSD                          June 15, 2017                         OpenBSD
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-15  0:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  0:27 mdocml: round default width of tbl(7) text blocks in the same way as schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).