X11 Specifying Fonts / Geometry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chadhogg
    Rookie
    • Aug 2009
    • 4

    X11 Specifying Fonts / Geometry

    I am attempting to play Angband 3.0.9b, as packaged in Ubuntu GNU/Linux 9.04. When I played before I controlled the fonts and locations of various windows using ~/.Xdefaults, as suggested at http://www.thangorodrim.net/linux/faq.html (but with my own particular preferences). I cannot now get Angband to recognize these X resources, although I am able to use them to customize xterm and other applications. My guess at this point would be that Angband has changed the name of the classes and settings that it supports, but I cannot find any documentation of this.

    As an alternative, I discovered through looking at the source code that Angband reads several environment variables. Specifically, I am able to control the font used in the main window by setting ANGBAND_X11_FONT_0="fixed" (or "5x7" or "7x13" or whatever). However, this only partially works. Decreasing the size of the font causes the individual glyphs to be smaller, but space is inserted between them so that I cannot shrink the window from taking up almost my entire screen. It is set to 24 rows and 80 columns, but I cannot seem to get rid of this extra space, making it basically impossible to see the sub-windows.

    Note that changing the fonts in these sub-windows works exactly as I would expect; it is only the main window that has this strange space-inserting property. Can anyone suggest how I might change this or get the old X resources method to work?

    Thank you,
    Chad
  • Bill Peterson
    Adept
    • Jul 2007
    • 190

    #2
    Have you tried the shell script shown in the comments at the beginning of main-x11.c? I've used that successfully for years.

    Comment

    • chadhogg
      Rookie
      • Aug 2009
      • 4

      #3
      Yes, that is exactly where I got the idea of setting environment variables from. I just changed the particular fonts and sizes in a bash version of the script. The 10x20 font causes the main window to fill up nearly all of my screen.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by chadhogg
        Yes, that is exactly where I got the idea of setting environment variables from. I just changed the particular fonts and sizes in a bash version of the script. The 10x20 font causes the main window to fill up nearly all of my screen.
        I don't think I understand the problem. How big is your screen? A 10x20 main window should occupy 800x480 pixels, plus the border.

        Can you attach a screenshot of the offending setup?
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • chadhogg
          Rookie
          • Aug 2009
          • 4

          #5
          Sure, I've attached two PNGs. The first uses the "fixed" font for the main window (what I would like), while the second uses the "10x20" font (what it seems to default to).

          Note that in the first one while the glyphs in the main window are the same size as those in the sub-windows, they have this strange extra space around them that makes the window much larger than it should need to be. Specifically, this space makes the window exactly the same size as it needs to be to hold the larger font in the second screenshot.

          The script that I am using to run the game is as follows (not bothering to specify sizes and locations of sub-windows until I get these fonts figured out:

          export ANGBAND_X11_FONT_0="fixed"
          export ANGBAND_X11_FONT_1="fixed"
          export ANGBAND_X11_FONT_2="fixed"
          export ANGBAND_X11_FONT_3="fixed"

          angband -mx11 -- -n5

          Note: did the forum's file uploading script convert my PNG files to JPEGs? That is what appeared to happen, but would be ridiculous.
          Attached Files

          Comment

          • Rizwan
            Swordsman
            • Jun 2007
            • 292

            #6
            Originally posted by chadhogg
            Note that in the first one while the glyphs in the main window are the same size as those in the sub-windows, they have this strange extra space around them that makes the window much larger than it should need to be. Specifically, this space makes the window exactly the same size as it needs to be to hold the larger font in the second screenshot.
            Is bigtile mode on? That also produces the space between the tiles.

            Comment

            • Magnate
              Angband Devteam member
              • May 2007
              • 5110

              #7
              Ok, I think I understand. See attached x11-settings.prf - you need to adjust the TILE_WIDTH and TILE_HEIGHT as well. That bit me a long while ago - sorry I didn't think of it straight off.
              Attached Files
              "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

              Comment

              • chadhogg
                Rookie
                • Aug 2009
                • 4

                #8
                Originally posted by Magnate
                Ok, I think I understand. See attached x11-settings.prf - you need to adjust the TILE_WIDTH and TILE_HEIGHT as well. That bit me a long while ago - sorry I didn't think of it straight off.
                Thanks! That works, and seems like a much more unix-y solution than what I had been trying. I wish I had known about the existence of this file long ago.

                Comment

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