Reload the fonts (both GUI1 and GUI2) when changing language

Getting fonts in the correct order is important for CJK (Chinese, Japanese,
Korean), as the same codepoint may have different images even between
DroidSansJapanese and DroidSansFallbackFull (see discussion in issue #5194).

This method of calling load_font_config() to reload the fonts is already used
during startup - see the two calls to it in src/wesnoth.cpp. This commit should
ensure that, if starting the game in a given language works properly, then
changing to that language without restarting also works properly.
This commit is contained in:
Steve Cotton 2020-10-10 13:51:23 +02:00
parent bb237f34ae
commit 0099080a3f
2 changed files with 1 additions and 2 deletions

View file

@ -127,8 +127,6 @@ t_string family_order_script;
bool load_font_config()
{
//read font config separately, so we do not have to re-read the whole
//config when changing languages
config cfg;
try {
const std::string& cfg_path = filesystem::get_wml_location("hardwired/fonts.cfg");

View file

@ -385,6 +385,7 @@ void title_screen::pre_show(window& win)
t_string::reset_translations();
::image::flush_cache();
sound::flush_cache();
font::load_font_config();
on_resize(win);
}
} catch(const std::runtime_error& e) {