diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-08-04 20:18:56 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-08-04 20:35:14 +0200 |
commit | 2af5864534c7615aeaff7e66c4dfb9618809c173 (patch) | |
tree | 2b429cd7b78ecb54484b50baf3990c5484b67d91 /src/main.cpp | |
parent | 3fd84edb615692cc26ea9528fb7b68387f6c471f (diff) | |
download | minetest-2af5864534c7615aeaff7e66c4dfb9618809c173.tar.gz minetest-2af5864534c7615aeaff7e66c4dfb9618809c173.tar.bz2 minetest-2af5864534c7615aeaff7e66c4dfb9618809c173.zip |
Make freetype usage configureable by a setting
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index b3aa9c92f..f495a6ba2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1388,12 +1388,18 @@ int main(int argc, char *argv[]) guienv = device->getGUIEnvironment(); gui::IGUISkin* skin = guienv->getSkin(); - #if USE_FREETYPE std::string font_path = g_settings->get("font_path"); - u16 font_size = g_settings->getU16("font_size"); - gui::IGUIFont *font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size); + gui::IGUIFont *font; + bool use_freetype = g_settings->getBool("freetype"); + #if USE_FREETYPE + if (use_freetype) { + u16 font_size = g_settings->getU16("font_size"); + font = gui::CGUITTFont::createTTFont(guienv, font_path.c_str(), font_size); + } else { + font = guienv->getFont(font_path.c_str()); + } #else - gui::IGUIFont* font = guienv->getFont(getTexturePath("fontlucida.png").c_str()); + font = guienv->getFont(font_path.c_str()); #endif if(font) skin->setFont(font); @@ -1736,7 +1742,8 @@ int main(int argc, char *argv[]) device->drop(); #if USE_FREETYPE - font->drop(); + if (use_freetype) + font->drop(); #endif #endif // !SERVER |