bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] terminfo.5: fix tables rendering on wide terminals


From: Kir Kolyshkin
Subject: [PATCH] terminfo.5: fix tables rendering on wide terminals
Date: Thu, 22 Feb 2018 16:13:16 -0800

The tables in this man page renders unreadable on a
wide (cols > 80) terminal, as the columns are narrow
(as requested by lwNN options to tbl), and the whole
table is expanded to fit the width of the screen.

Here is an example for 118 columns terminal:

>                Variable                           Cap-                   TCap 
>                      Description
>                String                            name                   Code
>       acs_chars                                  acsc                   ac    
>                 graphics charset
>                                                                               
>                 pairs, based on
>                                                                               
>                 vt100
>       back_tab                                   cbt                    bt    
>                 back tab (P)
>       bell                                       bel                    bl    
>                 audible signal

Due to wide spaces between columns, it's hard to distinguish
between lines and see which description is from which variable.

It looks even worse (totally unreadable) on a yet wider terminal,
and also when rendered to PostScript for printing.

The fix is easy: remove 'expand' from the table options.

An alternative solution would be to use x for the last column,
which leads to yet better rendering, but x is a GNU tbl
extension which might not be supported and lead to some warnings
or errors for other tbl/*roff implementations.

The patch is against the latest snapshot of project "ncurses",
label v6_1_20180217, as found on
https://github.com/ThomasDickey/ncurses-snapshots/

Signed-off-by: Kir Kolyshkin <address@hidden>
---
 include/Caps      | 24 ++++++++++++------------
 man/terminfo.tail | 10 +++++-----
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/Caps b/include/Caps
index dfc6a397..1cabc491 100644
--- a/include/Caps
+++ b/include/Caps
@@ -203,10 +203,10 @@
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw20.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBBooleans  name    Code\fR
 auto_left_margin               bw      bool    bw      -       -       YB-G-   
cub1 wraps from column 0 to last column
@@ -253,10 +253,10 @@ lpi_changes_res                   lpix    bool    YG      
-       -       -----   changing line pitch changes resolution
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw20.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBNumeric   name    Code\fR
 columns                                cols    num     co      -       -       
YBCGE   number of columns in a line
@@ -285,10 +285,10 @@ no_color_video                    ncv     num     NC      
-       -       -----   video attributes that cannot be used with
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw20.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBNumeric   name    Code\fR
 buffer_capacity                        bufsz   num     Ya      -       -       
-----   numbers of bytes buffered before printing
@@ -315,10 +315,10 @@ bit_image_type                    bitype  num     Yp      
-       -       -----   type of bit-image device
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw20.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBString    name    Code\fR
 back_tab                       cbt     str     bt      -               -       
YBCGE   back tab (P)
@@ -693,10 +693,10 @@ zero_motion                       zerom   str     Zx      
-               -       -----   No motion for subsequent character
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw18.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBString    name    Code\fR
 char_set_names                 csnm    str     Zy      -               -       
-----   Produce #1'th item from list of character set names
@@ -749,10 +749,10 @@ alt_scancode_esc          scesa   str     S8      -       
        -       -----   Alternate escape for scancode emulatio
 #%
 #%.na
 #%.TS H
-#%center expand;
+#%center;
 #%c l l c
 #%c l l c
-#%lw25 lw6 lw2 lw20.
+#%lw25 lw6 lw2 l.
 #%\fBVariable  Cap-    TCap    Description\fR
 #%\fBString    name    Code\fR
 enter_horizontal_hl_mode       ehhlm   str     Xh      -               -       
-----   Enter horizontal highlight mode
diff --git a/man/terminfo.tail b/man/terminfo.tail
index 37db325e..f43a414f 100644
--- a/man/terminfo.tail
+++ b/man/terminfo.tail
@@ -866,7 +866,7 @@ For example, the DEC vt220 supports most of the modes:
 center;
 l l l
 l l l
-lw18 lw14 lw18.
+lw18 lw14 l.
 \fBtparm parameter     attribute       escape sequence\fP
 
 none   none    \\E[0m
@@ -902,7 +902,7 @@ Writing out the above sequences, along with their 
dependencies yields
 center;
 l l l
 l l l
-lw18 lw14 lw18.
+lw18 lw14 l.
 \fBsequence    when to output  terminfo translation\fP
 
 .ft CW
@@ -1296,11 +1296,11 @@ supported by the VT100, with some characters from the 
AT&T 4410v1 added.
 This alternate character set may be specified by the \fBacsc\fR capability.
 .PP
 .TS H
-center expand;
+center;
 l l l l l
 l l l l l
 _ _ _ _ _
-lw25 lw10 lw6 lw6 lw6.
+lw25 lw10 lw6 lw6 l.
 .\".TH
 \fBGlyph       ACS     Ascii   acsc    acsc\fR
 \fBName        Name    Default Char    Value\fR
@@ -1500,7 +1500,7 @@ attributes understood by \fBcurses\fR is as follows:
 .TS
 center;
 l l l l
-lw20 lw2 lw10 lw10.
+lw20 lw2 lw10 l.
 \fBAttribute   Bit     Decimal Set by\fR
 A_STANDOUT     0       1       sgr
 A_UNDERLINE    1       2       sgr
-- 
2.14.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]