From dceb9f7d6058785cf60d9dbcc8eecdcee1053412 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Nov 2014 13:40:43 +0100 Subject: Implement proper font handling --- src/defaultsettings.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'src/defaultsettings.cpp') 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 } -- cgit v1.2.3