X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2FguiChatConsole.cpp;h=d8881dbd1a77304ab257a73ef7afe486338ca4a4;hb=56195dc2e45b85b7177cfa97aade77e92cff8805;hp=c1219fb808c29fe535e01b3267b5e7c4070f8444;hpb=7cb521725569b7eda98af40f7e4b4eb63afff633;p=oweals%2Fminetest.git diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index c1219fb80..d8881dbd1 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -94,13 +94,17 @@ GUIChatConsole::GUIChatConsole( // load the font // FIXME should a custom texture_path be searched too? - #if USE_FREETYPE std::string font_name = g_settings->get("mono_font_path"); - u16 font_size = g_settings->getU16("mono_font_size"); - m_font = gui::CGUITTFont::createTTFont(env, font_name.c_str(), font_size); + #if USE_FREETYPE + m_use_freetype = g_settings->getBool("freetype"); + if (m_use_freetype) { + u16 font_size = g_settings->getU16("mono_font_size"); + m_font = gui::CGUITTFont::createTTFont(env, font_name.c_str(), font_size); + } else { + m_font = env->getFont(font_name.c_str()); + } #else - std::string font_name = "fontdejavusansmono.png"; - m_font = env->getFont(getTexturePath(font_name).c_str()); + m_font = env->getFont(font_name.c_str()); #endif if (m_font == NULL) { @@ -122,7 +126,8 @@ GUIChatConsole::GUIChatConsole( GUIChatConsole::~GUIChatConsole() { #if USE_FREETYPE - m_font->drop(); + if (m_use_freetype) + m_font->drop(); #endif } @@ -550,7 +555,13 @@ bool GUIChatConsole::OnEvent(const SEvent& event) } else if(event.KeyInput.Char != 0 && !event.KeyInput.Control) { - m_chat_backend->getPrompt().input(event.KeyInput.Char); + #if (defined(linux) || defined(__linux)) + wchar_t wc = L'_'; + mbtowc( &wc, (char *) &event.KeyInput.Char, sizeof(event.KeyInput.Char) ); + m_chat_backend->getPrompt().input(wc); + #else + m_chat_backend->getPrompt().input(event.KeyInput.Char); + #endif return true; } }