Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Vanilla (http://angband.oook.cz/forum/forumdisplay.php?f=3)
-   -   X11 Specifying Fonts / Geometry (http://angband.oook.cz/forum/showthread.php?t=2241)

chadhogg August 30, 2009 23:39

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 August 31, 2009 02:59

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

chadhogg August 31, 2009 03:08

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.

Magnate August 31, 2009 12:23

Quote:

Originally Posted by chadhogg (Post 23413)
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?

chadhogg August 31, 2009 16:08

2 Attachment(s)
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.

Rizwan August 31, 2009 16:13

Quote:

Originally Posted by chadhogg (Post 23421)
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.

Magnate August 31, 2009 19:42

1 Attachment(s)
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.

chadhogg August 31, 2009 20:10

Quote:

Originally Posted by Magnate (Post 23427)
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.


All times are GMT +1. The time now is 07:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.