ToME compiles but refuses to start on some Linux distros

Everything about ToME 2.x.x. No spoilers, please

Moderator: Moderator

Message
Author
darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: ToME compiles but refuses to start on some Linux distros

#16 Post by darkgod »

Ahahahahahah "logical" indeed ...
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Nerdanel
Sher'Tul
Posts: 1461
Joined: Mon Jul 07, 2003 5:22 pm
Location: Finland

Re: ToME compiles but refuses to start on some Linux distros

#17 Post by Nerdanel »

It's kind of logical in that it's ordered, but it's also utterly opaque...

I made it so that the game first tries to load 9x15, then if that doesn't work, it tries to load the same thing by the lengthy string name, and if THAT doesn't work, it resorts to "fixed" which is supposed to exist on every X11 installation. Fixed is small though, so it isn't very good. And if there still is no font, the game exits with an error message instead of crashing mysteriously.
Zothiqband -- still an Angband variant.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME compiles but refuses to start on some Linux distros

#18 Post by Lord Estraven »

Nerdanel, can you post the patch? I'd like to incorporate it into my branch of T2.

BTW, does the GTK2 interface support XFT fonts?

(I really need to fix running in the GTK2 interface, but I haven't really a clue how...)

Nerdanel
Sher'Tul
Posts: 1461
Joined: Mon Jul 07, 2003 5:22 pm
Location: Finland

Re: ToME compiles but refuses to start on some Linux distros

#19 Post by Nerdanel »

Good thing I checked back here... eventually.

I don't have a patch as I also deleted dead code and stuff, but these snippets should be easy to apply:

The new font handling section of term_data_init in main-x11.c:

Code: Select all

	/* No environment variables, use default font */
	if (!font) font = DEFAULT_X11_FONT;

	/* Prepare the standard font */
	MAKE(td->fnt, infofnt);
	Infofnt_set(td->fnt);
	if (Infofnt_init_data(font))
	{
		if (Infofnt_init_data(DEFAULT_X11_FONT_FALLBACK))
		{
			if (Infofnt_init_data(DEFAULT_X11_FONT_FALLBACK2))
			{
				quit("Could not find a font");
			}
		}
	}
(The beginning of that is the same as in the old version.)

The new default font definitions in config.h:

Code: Select all

/*
 * OPTION: Default font (when using X11).
 * The first two are the same font under different names.
 * The "fixed" font should be found on any X11 system.
 */
#define DEFAULT_X11_FONT		"9x15"
#define DEFAULT_X11_FONT_FALLBACK	"-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1"
#define DEFAULT_X11_FONT_FALLBACK2	"fixed"
This bit replaces the old bit with the DEFAULT_X11_FONT.

The fix turned out to be pretty simple after all.

I don't know about GTK2 so I can't help you there.
Zothiqband -- still an Angband variant.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: ToME compiles but refuses to start on some Linux distros

#20 Post by Lord Estraven »

Applied... Thank you very much.

Post Reply