Skip to main content
Topic: r2185 bug in gui/sprachen.cc (Read 4339 times) previous topic - next topic

r2185 bug in gui/sprachen.cc

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):
Code: [Select]
#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.

Re: r2185 bug in gui/sprachen.cc

Reply #1
such a tranlation is not allowed anyway and is an error of the pak

Re: r2185 bug in gui/sprachen.cc

Reply #2
But none of my installed paks contains a valid translation in text/de.tab.

Re: r2185 bug in gui/sprachen.cc

Reply #3
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?

Re: r2185 bug in gui/sprachen.cc

Reply #4
Immediatly after starting simutrans, it freezes. The log says
Code: [Select]
Warning: sprachengui_t::sprachengui_t():	no font found for Belaruskaja
and some debug output:
Code: [Select]
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'.

Re: r2185 bug in gui/sprachen.cc

Reply #5
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

Re: r2185 bug in gui/sprachen.cc

Reply #6
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

Re: r2185 bug in gui/sprachen.cc

Reply #7
Maybe there was some linefeed trouble then? Because this is still a defined font. Hmm.