ascii: Improve look of dashed line ends.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 28 Jan 2023 18:16:25 +0000 (10:16 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 28 Jan 2023 18:16:25 +0000 (10:16 -0800)
Until now, partial ends of horizontal dashed lines were rendered as
U+2574 BOX DRAWINGS LIGHT LEFT and U+2576 BOX DRAWINGS LIGHT RIGHT,
which are solid lines.  This looks funny at the end of a dashed line,
especially in some fonts.  This commit changes these ends to
U+254C BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL, which does extend all the
way across the character cell but looks much better.

src/output/ascii.c
tests/output/pivot-table.at

index 1ce3b0ce15a885a0626260c1fd9f98300de4ac06..e654691cd65209356399e28f16044ef5a55f7834 100644 (file)
@@ -173,7 +173,7 @@ get_unicode_box (void)
     {
       /* r  b  l   t:   _       d       S       D */
       .c[_][_][_] = { 0x0020, 0x2575, 0x2575, 0x2551, }, /*  ╵╵║ */
-      .c[_][_][d] = { 0x2574, 0x256f, 0x256f, 0x255c, }, /* ╴╯╯╜ */
+      .c[_][_][d] = { 0x254c, 0x256f, 0x256f, 0x255c, }, /* ╴╯╯╜ */
       .c[_][_][S] = { 0x2574, 0x256f, 0x256f, 0x255c, }, /* ╴╯╯╜ */
       .c[_][_][D] = { 0x2550, 0x255b, 0x255b, 0x255d, }, /* ═╛╛╝ */
       .c[_][S][_] = { 0x2577, 0x2502, 0x2502, 0x2551, }, /* ╷││║ */
@@ -188,7 +188,7 @@ get_unicode_box (void)
       .c[_][D][d] = { 0x2556, 0x2562, 0x2562, 0x2562, }, /* ╖╢╢╢ */
       .c[_][D][S] = { 0x2556, 0x2562, 0x2562, 0x2562, }, /* ╖╢╢╢ */
       .c[_][D][D] = { 0x2557, 0x2563, 0x2563, 0x2563, }, /* ╗╣╣╣ */
-      .c[d][_][_] = { 0x2576, 0x2570, 0x2570, 0x2559, }, /* ╶╰╰╙ */
+      .c[d][_][_] = { 0x254c, 0x2570, 0x2570, 0x2559, }, /* ╶╰╰╙ */
       .c[d][_][d] = { 0x254c, 0x2534, 0x2534, 0x2568, }, /* ╌┴┴╨ */
       .c[d][_][S] = { 0x2500, 0x2534, 0x2534, 0x2568, }, /* ─┴┴╨ */
       .c[d][_][D] = { 0x2550, 0x2567, 0x2567, 0x2569, }, /* ═╧╧╩ */
index 9e006eac0af9b39b926dd606ad3036bdb47c3fca..60bab974f742a1534bcfeb7ffbc07dd1f66a5173 100644 (file)
@@ -706,21 +706,21 @@ Category Borders 1
                 ┊ ag1 ┊  ┊ ag1 ┊  ┊ ag1
 d      c      a1┊a2┊a3┊a1┊a2┊a3┊a1┊a2┊a3
 dg1 d1 c1      0┊ 1┊ 2┊ 3┊ 4┊ 5┊ 6┊ 7┊ 8
-      â\95╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+      â\95\8c╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
        cg1 c2  9┊10┊11┊12┊13┊14┊15┊16┊17
-          â\95╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+          â\95\8c╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
            c3 18┊19┊20┊21┊22┊23┊24┊25┊26
-   â\95╌╌╌╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+   â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
     d2 c1     27┊28┊29┊30┊31┊32┊33┊34┊35
-      â\95╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+      â\95\8c╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
        cg1 c2 36┊37┊38┊39┊40┊41┊42┊43┊44
-          â\95╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+          â\95\8c╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
            c3 45┊46┊47┊48┊49┊50┊51┊52┊53
 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
 d3     c1     54┊55┊56┊57┊58┊59┊60┊61┊62
-      â\95╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+      â\95\8c╌╌╌╌╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
        cg1 c2 63┊64┊65┊66┊67┊68┊69┊70┊71
-          â\95╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
+          â\95\8c╌╌╌╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌+╌╌
            c3 72┊73┊74┊75┊76┊77┊78┊79┊80
 
 Category and Dimension Borders 1
@@ -733,19 +733,19 @@ d      c      a1│a2┊a3│a1│a2┊a3│a1│a2┊a3
 dg1 d1 c1      0│ 1┊ 2│ 3│ 4┊ 5│ 6│ 7┊ 8
       ╶─────────┼──┼──┼──┼──┼──┼──┼──┼──
        cg1 c2  9│10┊11│12│13┊14│15│16┊17
-          â\95╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
+          â\95\8c╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
            c3 18│19┊20│21│22┊23│24│25┊26
    ╶────────────┼──┼──┼──┼──┼──┼──┼──┼──
     d2 c1     27│28┊29│30│31┊32│33│34┊35
       ╶─────────┼──┼──┼──┼──┼──┼──┼──┼──
        cg1 c2 36│37┊38│39│40┊41│42│43┊44
-          â\95╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
+          â\95\8c╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
            c3 45│46┊47│48│49┊50│51│52┊53
 ────────────────┼──┼──┼──┼──┼──┼──┼──┼──
 d3     c1     54│55┊56│57│58┊59│60│61┊62
       ╶─────────┼──┼──┼──┼──┼──┼──┼──┼──
        cg1 c2 63│64┊65│66│67┊68│69│70┊71
-          â\95╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
+          â\95\8c╌╌╌╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌┼╌╌┼╌╌+╌╌
            c3 72│73┊74│75│76┊77│78│79┊80
 ])
 AT_CHECK([pivot-table-test --table-look $srcdir/output/look.stt pivot.txt --box unicode], [0], [expout])
@@ -797,15 +797,15 @@ d3    │c1     54 55 56 57 58 59 60 61 62
 
 Category Borders 2
                            b
-             â\95╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+             â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                      bg1
-             â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´
+             â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c
                  b1       b2       b3
-             â\95╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+             â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                   a        a        a
-             â\95╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+             â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                   ag1      ag1      ag1
-                â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´  â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´  â\95╌╌╌╌╌
+                â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c  â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c  â\95\8c╌╌╌╌╌
 d      c      a1 a2 a3 a1 a2 a3 a1 a2 a3
 dg1┊d1┊c1      0  1  2  3  4  5  6  7  8
    ┊  ┊cg1┊c2  9 10 11 12 13 14 15 16 17
@@ -819,15 +819,15 @@ d3    ┊c1     54 55 56 57 58 59 60 61 62
 
 Category and Dimension Borders 2
                            b
-             â\95╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+             â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                      bg1
-             â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´
+             â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c
                  b1       b2       b3
              ╶──────────────────────────
                   a        a        a
-             â\95╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+             â\95\8c╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
                   ag1      ag1      ag1
-                â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´  â\95¶â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95´  â\95╌╌╌╌╌
+                â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c  â\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8câ\95\8c  â\95\8c╌╌╌╌╌
 d      c      a1 a2 a3 a1 a2 a3 a1 a2 a3
 dg1┊d1│c1      0  1  2  3  4  5  6  7  8
    ┊  │cg1┊c2  9 10 11 12 13 14 15 16 17
@@ -864,7 +864,7 @@ AT_DATA([pivot.txt], [[
 AT_DATA([expout], [dnl
 Category and Dimension Borders 3
                      bg1       │
-             â\95╌╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌╌┤
+             â\95\8c╌╌╌╌╌╌╌╌┬╌╌╌╌╌╌╌╌┤
                  b1   │   b2   │   b3
              ╶──┬─────┼──┬─────┼──┬─────
                 │ ag1 │  │ ag1 │  │ ag1