aboutsummaryrefslogtreecommitdiff
path: root/src/defaultsettings.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/defaultsettings.cpp
parent25945dc5395a03cab069ff0e6470ba8d59b03978 (diff)
downloadminetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.tar.gz
minetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.tar.bz2
minetest-dceb9f7d6058785cf60d9dbcc8eecdcee1053412.zip
Implement proper font handling
Diffstat (limited to 'src/defaultsettings.cpp')
-rw-r--r--src/defaultsettings.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 72eac76c2..a8ae9e251 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -187,10 +187,23 @@ void set_default_settings(Settings *settings)
settings->setDefault("fallback_font_shadow", "1");
settings->setDefault("fallback_font_shadow_alpha", "128");
+
+ std::stringstream fontsize;
+ fontsize << TTF_DEFAULT_FONT_SIZE;
+
+ settings->setDefault("font_size", fontsize.str());
+ settings->setDefault("mono_font_size", fontsize.str());
+ settings->setDefault("fallback_font_size", fontsize.str());
#else
- settings->setDefault("freetype", "false");
- settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "fontlucida.png"));
- settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "fontdejavusansmono.png"));
+ settings->setDefault("freetype", "false");
+ settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "lucida_sans"));
+ settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "mono_dejavu_sans"));
+
+ std::stringstream fontsize;
+ fontsize << DEFAULT_FONT_SIZE;
+
+ settings->setDefault("font_size", fontsize.str());
+ settings->setDefault("mono_font_size", fontsize.str());
#endif
// Server stuff
@@ -317,22 +330,8 @@ void set_default_settings(Settings *settings)
settings->setDefault("gui_scaling", "0.7");
}
settings->setDefault("curl_verify_cert","false");
-#endif
-}
-
-void late_init_default_settings(Settings* settings)
-{
-#ifndef SERVER
- std::stringstream fontsize;
- fontsize << floor(
- DEFAULT_FONT_SIZE *
- porting::getDisplayDensity() *
- settings->getFloat("gui_scaling")
- );
-
- settings->setDefault("font_size", fontsize.str());
- settings->setDefault("mono_font_size", fontsize.str());
- settings->setDefault("fallback_font_size", fontsize.str());
+#else
+ settings->setDefault("screen_dpi", "72");
#endif
}