The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: gerw on December 27, 2008, 01:25:27 PM

Title: r2185 bug in gui/sprachen.cc
Post by: gerw on December 27, 2008, 01:25:27 PM
The newest revision seem to have a bug in gui/sprachen.cc. If I revert gui/sprachen.cc to r2184 all works fine. In r2185 it hangs up in an infinite loop in: dsp_read_bdf_font, because it want's to read the font "font/" (line #9):
#8  0x080b6b6e in dsp_read_bdf_font (fin=0x8aca090, font=0xbff46e64)
    at font.cc:165
#9  0x080b75a2 in load_font (fnt=0xbff46e64, fname=0xbff46ea0 "font/")
    at font.cc:365
#10 0x081413f6 in sprachengui_t (this=0x853f120) at gui/sprachen.cc:105
#11 0x0819808c in simu_main (argc=5, argv=0xbff48df4) at simmain.cc:759
#12 0x081f346d in main (argc=5, argv=0xbff48df4) at simsys_s.cc:667

I think, the main problem is in gui/sprachen.cc:98, when PROP_FONT_FILE isn't translatable and it isn't been checked, whether prop_font_file_name is really a file. But this is only a guess.
Title: Re: r2185 bug in gui/sprachen.cc
Post by: prissi on December 27, 2008, 01:43:52 PM
such a tranlation is not allowed anyway and is an error of the pak
Title: Re: r2185 bug in gui/sprachen.cc
Post by: gerw on December 27, 2008, 02:24:16 PM
But none of my installed paks contains a valid translation in text/de.tab.
Title: Re: r2185 bug in gui/sprachen.cc
Post by: prissi on December 27, 2008, 08:09:14 PM
I should have written: Is an error of the language file. I recently rechecked all files (the one under simutrans/text/de.tab) and they seemed ok. Could you be more specific?
Title: Re: r2185 bug in gui/sprachen.cc
Post by: gerw on December 27, 2008, 08:19:14 PM
Immediatly after starting simutrans, it freezes. The log says
Warning: sprachengui_t::sprachengui_t(): no font found for Belaruskaja
and some debug output:
Loading BDF font font/Prop-Latin1.bdf with 255 characters
Loading font 'font/prop-latin2.fnt'
font/prop-latin2.fnt sucessfully loaded as old format prop font!
Loading font 'font/ro_font.fnt'
font/ro_font.fnt sucessfully loaded as old format prop font!
Loading BDF font 'font/'


The problem is, that line 105 in sprachen.cc calls load_font with prop_font_file_name='/font'.
Title: Re: r2185 bug in gui/sprachen.cc
Post by: prissi on December 27, 2008, 10:36:38 PM
This should not be a problem, since it should not suceed to open this file for reading.

Even more, the translation is defined, it is cyr.bdf. Or did some funny guy changed this to space? It is the third line in be.tab
Title: Re: r2185 bug in gui/sprachen.cc
Post by: z9999 on December 27, 2008, 11:03:47 PM
I tested on Ubuntu, and freezed. Both gcc3 and gcc4 versions on nightly site.

Simutrans strat and show title, but when I click on window, simutrans freeze - no new map window, no crash but freezed.



[edit]
Okay, I replaced "be.tab" to new one and did't freeze anymore.

Old one is this
Quote
Belaruskaja
PROP_FONT_FILE
prop_cyrillic-be.fnt
Title: Re: r2185 bug in gui/sprachen.cc
Post by: prissi on December 27, 2008, 11:34:02 PM
Maybe there was some linefeed trouble then? Because this is still a defined font. Hmm.