Wintermute Engine Forum

Wintermute Engine => Bug reports => Fixed => Topic started by: Schnuffel on December 17, 2007, 08:51:55 PM

Title: TTF problem
Post by: Schnuffel on December 17, 2007, 08:51:55 PM
This is strange: I wanted to grey out or "soft delete" dialog responses that have already been used, so I assigned a different font to them - and WME kept crashing on me. So I tried my code on the wme_demo and it boils down to some TrueType issue, I think.
Take the 'oldguy' entity in the wme_demo, for example:

Code: [Select]
// fill the response box
Game.AddResponse(0, Responses[0], null, null, null, "fonts\truetype.font");
Game.AddResponse(1, Responses[1]);
Game.AddResponse(2, Responses[2]);
Game.AddResponse(3, Responses[3]);

This works fine. Then I added the font parameter to the second response, too:

Code: [Select]
// fill the response box
Game.AddResponse(0, Responses[0], null, null, null, "fonts\truetype.font");
Game.AddResponse(1, Responses[1], null, null, null, "fonts\truetype.font");
Game.AddResponse(2, Responses[2]);
Game.AddResponse(3, Responses[3]);

Now when you select the first response, WME will crash. This only happens on the first response, though, only with truetype fonts, and only if a TTF is assigned to any other response except (or besided) the first one.

Took me 3 hours to realize :-\
Title: Re: TTF problem
Post by: Mnemonic on December 17, 2007, 09:56:23 PM
Thanks for reporting. I was able to reproduce and fix the bug.
Title: Re: TTF problem
Post by: Schnuffel on December 17, 2007, 10:17:59 PM
God, you're fast :o Thanks :)
Title: Re: TTF problem
Post by: Schnuffel on December 18, 2007, 03:17:31 PM
Hm, apparently I was wrong - this is not exclusive to TTFs. I tried my own bitmap fonts as a workaround and WME crashed again. It seemed to work with the standard bitmap fonts, though (outline_red.font, outline_white.font, sserif.font etc.). So I copied 'outline_white.font' and renamed it to 'response.font', then assigned it as before:

Code: [Select]
// fill the response box
Game.AddResponse(0, Responses[0], null, null, null, "fonts\response.font");
Game.AddResponse(1, Responses[1], null, null, null, "fonts\response.font");
Game.AddResponse(2, Responses[2], null, null, null, "fonts\response.font");
Game.AddResponse(3, Responses[3], null, null, null, "fonts\response.font");

And it crashes again. Even though the font is an exact copy of one that works, just the filename is different. Does your bugfix cover that?

I'm out of workarounds now...

Edit:

Ah, okay... so it's also important which fonts are set as defaults for the response box. If a font isn't one of the response box defaults, the system font or the video font, it won't work. Well... enough for a workaround until the next WME version :)