mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Fix #4929: Changing TTF language crashes game
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
0.0.6 (in development)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#4929] Changing TTF language crashes game.
|
||||
|
||||
0.0.5 (2016-12-27)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -192,6 +192,9 @@ bool font_supports_string_ttf(const utf8 *text, int fontSize)
|
||||
{
|
||||
const utf8 *src = text;
|
||||
const TTF_Font *font = gCurrentTTFFontSet->size[fontSize].font;
|
||||
if (font == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 codepoint;
|
||||
while ((codepoint = utf8_get_next(src, &src)) != 0) {
|
||||
|
||||
@@ -101,6 +101,7 @@ static bool LoadFont(TTFFontSetDescriptor * font)
|
||||
gUseTrueTypeFont = true;
|
||||
gCurrentTTFFontSet = font;
|
||||
|
||||
ttf_dispose();
|
||||
bool fontInitialised = ttf_initialise();
|
||||
return fontInitialised;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user