1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make freetype usage configureable by a setting

This commit is contained in:
PilzAdam 2013-08-04 20:18:56 +02:00
parent 3fd84edb61
commit 2af5864534
8 changed files with 48 additions and 14 deletions

View file

@ -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
}