aboutsummaryrefslogtreecommitdiff
path: root/src/guiChatConsole.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-11-23 13:40:43 +0100
committersapier <Sapier at GMX dot net>2014-11-30 17:50:09 +0100
commitdceb9f7d6058785cf60d9dbcc8eecdcee1053412 (patch)
tree0cbaa6969210d3e104f195ac5d3c2cabad8d6338 /src/guiChatConsole.cpp
parent25945dc5395a03cab069ff0e6470ba8d59b03978 (diff)
downloadminetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.tar.gz
minetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.tar.bz2
minetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.zip
Implement proper font handling
Diffstat (limited to 'src/guiChatConsole.cpp')
-rw-r--r--src/guiChatConsole.cpp27
1 files changed, 5 insertions, 22 deletions
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 <string>
#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)
{