summaryrefslogtreecommitdiff
path: root/src/guiChatConsole.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-08-04 20:18:56 +0200
committerPilzAdam <pilzadam@minetest.net>2013-08-04 20:35:14 +0200
commit2af5864534c7615aeaff7e66c4dfb9618809c173 (patch)
tree2b429cd7b78ecb54484b50baf3990c5484b67d91 /src/guiChatConsole.cpp
parent3fd84edb615692cc26ea9528fb7b68387f6c471f (diff)
downloadminetest-2af5864534c7615aeaff7e66c4dfb9618809c173.tar.gz
minetest-2af5864534c7615aeaff7e66c4dfb9618809c173.tar.bz2
minetest-2af5864534c7615aeaff7e66c4dfb9618809c173.zip
Make freetype usage configureable by a setting
Diffstat (limited to 'src/guiChatConsole.cpp')
-rw-r--r--src/guiChatConsole.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp
index daec18efc..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
}