tweak fonts to make screens sort of fit at very low resolutions

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14178 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2013-10-02 00:56:17 +00:00
parent a7214699e8
commit fbf1e46e2f

View File

@@ -1017,10 +1017,12 @@ namespace GUIEngine
// normal text will range from 0.2, in 640x* resolutions (won't scale
// below that) to 0.4, in 1024x* resolutions, and linearly up
const int screen_width = irr_driver->getFrameSize().Width;
const float normal_text_scale =
0.7f + 0.2f*std::max(0, screen_width - 640)/564.0f;
const float title_text_scale =
0.2f + 0.2f*std::max(0, screen_width - 640)/564.0f;
const int screen_height = irr_driver->getFrameSize().Height;
float scale = std::max(0, screen_width - 640)/564.0f;
if (screen_height < 700) scale = std::min(scale, 0.25f); // attempt to compensate for small screens
float normal_text_scale = 0.7f + 0.2f*scale;
float title_text_scale = 0.2f + 0.2f*scale;
ScalableFont* sfont =
new ScalableFont(g_env,