From dceb9f7d6058785cf60d9dbcc8eecdcee1053412 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Nov 2014 13:40:43 +0100 Subject: Implement proper font handling --- src/guiChatConsole.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'src/guiChatConsole.cpp') diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index d8881dbd1..c9f41c76f 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "main.h" // for g_settings #include "porting.h" #include "tile.h" -#include "IGUIFont.h" +#include "fontengine.h" #include #include "gettext.h" @@ -92,23 +92,11 @@ GUIChatConsole::GUIChatConsole( m_background_color.setBlue(255); } - // load the font - // FIXME should a custom texture_path be searched too? - std::string font_name = g_settings->get("mono_font_path"); - #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 - m_font = env->getFont(font_name.c_str()); - #endif + m_font = glb_fontengine->getFont(FONT_SIZE_UNSPECIFIED, FM_Mono); + if (m_font == NULL) { - dstream << "Unable to load font: " << font_name << std::endl; + errorstream << "GUIChatConsole: Unable to load mono font "; } else { @@ -124,12 +112,7 @@ GUIChatConsole::GUIChatConsole( } GUIChatConsole::~GUIChatConsole() -{ -#if USE_FREETYPE - if (m_use_freetype) - m_font->drop(); -#endif -} +{} void GUIChatConsole::openConsole(f32 height) { -- cgit v1.2.3