(INTERIM) Make sizes of the font in formspecs consistent and not so large
authorCraig Robbins <kde.psych@gmail.com>
Thu, 4 Dec 2014 15:42:03 +0000 (01:42 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Thu, 4 Dec 2014 16:35:21 +0000 (02:35 +1000)
Until a permanent fix can be developed

src/constants.h
src/guiFormSpecMenu.cpp

index 8e39ccb74e0b002e48a3d9ff1ba5bebcfb6ec931..2da4a34e527c0443aeebda277d72195fdc0dbbb2 100644 (file)
@@ -98,7 +98,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  *    GUI related things
  */
 #define LEGACY_SCALING                                     (2./3.)
-#define TTF_DEFAULT_FONT_SIZE              (13.0 / LEGACY_SCALING)
+#define TTF_DEFAULT_FONT_SIZE              (12.0 / LEGACY_SCALING)
 #define DEFAULT_FONT_SIZE                                     (14)
 
 #endif
index 883228820409c382d8e781976edb293489fd7388..d3c2a0b883abca3152786bfb0c2e7a7a2fd05a1f 100644 (file)
@@ -76,6 +76,21 @@ static unsigned int font_line_height(gui::IGUIFont *font)
 
 static gui::IGUIFont *select_font_by_line_height(double target_line_height)
 {
+       return g_fontengine->getFont();
+
+/* I have no idea what this is trying to achieve, but scaling the font according
+ * to the size of a formspec/dialog does not seem to be a standard (G)UI
+ * design and AFAIK no existing nor proposed GUI does this. Besides that it:
+ * a) breaks most (current) formspec layouts
+ * b) font sizes change depending on the size of the formspec/dialog (see above)
+ *    meaning that there is no UI consistency
+ * c) the chosen fonts are, in general, probably too large
+ *
+ * Disabling for now.
+ *
+ * FIXME
+ */
+#if 0
        // We don't get to directly select a font according to its
        // baseline-to-baseline height.  Rather, we select by em size.
        // The ratio between these varies between fonts.  The font
@@ -105,6 +120,7 @@ static gui::IGUIFont *select_font_by_line_height(double target_line_height)
                }
        }
        return g_fontengine->getFont(target_line_height - lohgt < hihgt - target_line_height ? loreq : hireq);
+#endif
 }
 
 GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,