It will use either UTF-8 characters or the ACS characters from TERM.

The way it decides which is somewhat confusing and it looks like it is
choosing to use UTF-8 even when I wouldn't expect it to so I'm not sure
it is actually working correctly in our ncurses version.

I don't think UTF-8 line drawing works properly, at least with the DRM
wscons.

What do you have in TERM now? Can you see if the borders are OK with
"TERM=xterm snake"? This seems to use ACS rather than UTF-8. If it does
I'll see if I can figure out why it choosing UTF-8 borders for the
others.

You can run it in script(1) to see what it is using for the border (lots
of 'q' or 'x' means ACS).


On Wed, Sep 25, 2019 at 11:15:01AM -0500, Scott Cheloha wrote:
> On Mon, Sep 23, 2019 at 06:23:32PM -0400, Ted Unangst wrote:
> > snake and worm draw boxes, but they can be prettier by using the default
> > style, which will use line drawing instead of ugly -*| characters.
> > 
> > should do the right thing on a vt100, but only tested in xterm.
> 
> It looks much prettier in an xterm but in the system console I'm
> getting question marks.  Is that a limitation of the terminal or
> am I missing the glyphs?  Dunno if this is the expected behavior
> but it is uglier than what we had before.
> 
> Also, you forgot to delete the prototype for drawbox().
> 
> > Index: snake/snake.c
> > ===================================================================
> > RCS file: /home/cvs/src/games/snake/snake.c,v
> > retrieving revision 1.34
> > diff -u -p -r1.34 snake.c
> > --- snake/snake.c   28 Jun 2019 13:32:52 -0000      1.34
> > +++ snake/snake.c   13 Sep 2019 17:05:19 -0000
> > @@ -450,23 +450,8 @@ setup(void)
> >             pchar(&snake[i], SNAKETAIL);
> >     }
> >     pchar(&snake[0], SNAKEHEAD);
> > -   drawbox();
> > +   border(0, 0, 0, 0, 0, 0, 0, 0);
> >     refresh();
> > -}
> > -
> > -void
> > -drawbox(void)
> > -{
> > -   int i;
> > -
> > -   for (i = 1; i <= ccnt; i++) {
> > -           mvaddch(0, i, '-');
> > -           mvaddch(lcnt + 1, i, '-');
> > -   }
> > -   for (i = 0; i <= lcnt + 1; i++) {
> > -           mvaddch(i, 0, '|');
> > -           mvaddch(i, ccnt + 1, '|');
> > -   }
> >  }
> >  
> >  void
> > Index: worm/worm.c
> > ===================================================================
> > RCS file: /home/cvs/src/games/worm/worm.c,v
> > retrieving revision 1.39
> > diff -u -p -r1.39 worm.c
> > --- worm/worm.c     24 Aug 2018 11:14:49 -0000      1.39
> > +++ worm/worm.c     13 Sep 2019 16:51:39 -0000
> > @@ -122,7 +122,7 @@ main(int argc, char **argv)
> >     }
> >     stw = newwin(1, COLS-1, 0, 0);
> >     tv = newwin(LINES-1, COLS-1, 1, 0);
> > -   box(tv, '*', '*');
> > +   box(tv, 0, 0);
> >     scrollok(tv, FALSE);
> >     scrollok(stw, FALSE);
> >     wmove(stw, 0, 0);
> > 
> 

Reply via email to