FontEngine: Don't use file extension to check font file compatibility
authorkwolekr <kwolekr@minetest.net>
Mon, 29 Dec 2014 06:46:13 +0000 (01:46 -0500)
committerkwolekr <kwolekr@minetest.net>
Mon, 29 Dec 2014 06:46:13 +0000 (01:46 -0500)
src/fontengine.cpp

index b9d35ba4218963725d166ed1c36d6cd238d7f113..79d53c9898cd7306d350be1f60d0019c4dd4c724 100644 (file)
@@ -337,12 +337,6 @@ void FontEngine::initFont(unsigned int basesize, FontMode mode)
 
                std::string font_path = g_settings->get(font_config_prefix + "font_path");
 
-               if (font_path.substr(font_path.length() -4) != ".ttf") {
-                       errorstream << "FontEngine: \"" << font_path
-                                       << "\" doesn't seem to be a ttf File." << std::endl;
-                       return;
-               }
-
                irr::gui::IGUIFont* font = gui::CGUITTFont::createTTFont(m_env,
                                font_path.c_str(), size, true, true, font_shadow,
                                font_shadow_alpha);
@@ -378,7 +372,7 @@ void FontEngine::initSimpleFont(unsigned int basesize, FontMode mode)
                return;
        }
 
-       if ((ending == ".xml") || ( ending == ".png")) {
+       if ((ending == ".xml") || (ending == ".png")) {
                basename = font_path.substr(0,font_path.length()-4);
        }