Subwindows and fonts options in curses mode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krugar
    Apprentice
    • Sep 2010
    • 76

    Subwindows and fonts options in curses mode

    Hello all,

    I'm looking into curses mode as an alternative to GTK since the latter introduces a few problems. I'm however having trouble setting up the subwindow options ('=' then 'w - subwindow display settings').

    1. Can I really only construct a 2x2 grid of subwindows in curses mode? I'd like to play with 5 opened subwindows, but I can only see 3 plus the main one)

    2. Can I instruct angband on the number of lines of each subwindow? I'd like to reduce the monster recall and messages subwindows, for instance, to 8 lines, instead of what I believe is the current 24.

    3. Can I tell Angband to not use it's own fonts? I'd like to play the game with my own fonts as defined in .Xdefaults and that I use for all my terminal windows.

    edit:
    For clarification I''m running 3.1.2v2, built with X11, GTK and SDL disabled.
    I'm executing with: "angband -mgcu -- -a"
    Last edited by krugar; September 9, 2010, 22:13.
  • d_m
    Angband Devteam member
    • Aug 2008
    • 1517

    #2
    RIght now GCU has two modes.

    By default you get an (approximately) 80x24 main window, and then you get 3 subwindows whose dimensions are:

    upper right (WIDTH - 80) x 24
    lower right (WIDTH - 80) x (HEIGHT - 24)
    lower left 80 x (HEIGHT - 24)

    In big screen mode you just get the main window, and no subwindows.

    So unfortunately I don't think it's going to be able to support the subwindow set up you want.

    Originally posted by krugar
    3. Can I tell Angband to not use it's own fonts? I'd like to play the game with my own fonts as defined in .Xdefaults and that I use for all my terminal windows.
    GCU mode isn't able to switch fonts. So whatever font your terminal (e.g. XTerm, Gnome Terminal, rxvt, etc) uses is what Angband will use. What is the issue you're seeing. Could you give me a screenshot of "normal terminal output" and then one of Angband? Otherwise it will be hard to understand what's happening.

    I would expect that if your terminal loads your fonts from Xdefaults then they would be used in Angband.
    linux->xterm->screen->pmacs

    Comment

    • krugar
      Apprentice
      • Sep 2010
      • 76

      #3
      Originally posted by d_m
      GCU mode isn't able to switch fonts. So whatever font your terminal (e.g. XTerm, Gnome Terminal, rxvt, etc) uses is what Angband will use. What is the issue you're seeing. Could you give me a screenshot of "normal terminal output" and then one of Angband? Otherwise it will be hard to understand what's happening.

      I would expect that if your terminal loads your fonts from Xdefaults then they would be used in Angband.
      Sure, here they are:

      1. Terminals without Angband
      2. Terminal with angband -ngcu -- -a

      In retrospect, this is probably to do with the fact I'm using xft fonts?

      As for the rest, I understand d_m. Thanks for the explanation. But unless there's some technical impediment that you are aware, you understand if I eventually will want to introduce myself that functionality?

      Comment

      • d_m
        Angband Devteam member
        • Aug 2008
        • 1517

        #4
        I think that is the effect of your font being bolded. You can run this command to confirm my hypothesis:

        printf '\033[0mabcdefg\033[1mabcdefg\n\033[0m'

        This should show you your unbolded font next to your bolded font.

        If you want to submit a bug about the font bolding issue I would totally accept that. I'm not sure what the best way to configure that is. Also, in many terminals bold and non-bold are needed simply to create the illusion of 16 colors from 8.

        P.S. I look forward to patches!
        linux->xterm->screen->pmacs

        Comment

        • krugar
          Apprentice
          • Sep 2010
          • 76

          #5
          Oh! Good catch, d_m.
          Indeed that's the issue. The fix is just a matter of lying to it in .Xdefaults by adding something like the following:

          Code:
          ! Angband
          angband*boldFont: -windows-dina-medium-r-normal-*-*-*-*-*-*-microsoft-cp1252
          I do need to launch it with the terminal title (I'm using urxvt) set to angband. So I'm trying to set the following keybind in i3 (my wm):

          bindsym Mod4+g exec /usr/bin/urxvtc -name angband -e angband-mgcu
          angband-mgcu is just a wrapper that calls 'angband -mgcu -- -a'. Problem is the game closes/crashes right after I try to execute it this way.But runs ok when I call it from an already opened terminal. Of course, that doesn't do me any good since I need to set the terminal window title for .Xdefaults to kick in.

          Will investigate what's wrong later. I'm still pretty much a linux newb.

          Comment

          • d_m
            Angband Devteam member
            • Aug 2008
            • 1517

            #6
            Originally posted by krugar
            angband-mgcu is just a wrapper that calls 'angband -mgcu -- -a'. Problem is the game closes/crashes right after I try to execute it this way.But runs ok when I call it from an already opened terminal. Of course, that doesn't do me any good since I need to set the terminal window title for .Xdefaults to kick in.

            Will investigate what's wrong later. I'm still pretty much a linux newb.
            Huh, that's strange. I can run "xterm -e angband -mgcu -- a" and it's fine. If you run the bound command manually does it work?

            Anyway, I hope you find a setup you like.
            linux->xterm->screen->pmacs

            Comment

            • krugar
              Apprentice
              • Sep 2010
              • 76

              #7
              Thank you d_m. I did, in fact.
              I'm enjoying very much the game in curses mode. Despite the limitations, when compared to the GTK mode, 3 subwindows do give me room for a few essentials (monster list, inventory and messages). So this is definitely the mode I intend to play the game from now on.

              As for the urxvt bug(?), for now I circumvented it by simply creating the window without launching the game.

              Code:
              bindsym Mod4+g exec /usr/bin/urxvtc -name angband
              Then I manually launch the game from that newly created (and properly named) terminal window, so that the .Xdefaults settings take place and X recognizes angband font setting.

              Comment

              • linlem
                Rookie
                • Oct 2010
                • 2

                #8
                There's also an Angband patch which can disable bolding:
                In main-gcu.c, in line 652, change this:
                Code:
                	colortable[i] = COLOR_PAIR(i + 1) | A_BRIGHT;
                to this:
                Code:
                	colortable[i] = COLOR_PAIR(i + 1);
                (Note that earlier in the source, A_BRIGHT is redefined as A_BOLD.)

                I learned this patch from d_m at the Unangband comment section here.

                Comment

                Working...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎