Skip to content

Commit f7f7fec

Browse files
committedDec 4, 2014
(INTERIM) Make sizes of the font in formspecs consistent and not so large
Until a permanent fix can be developed
1 parent c16b1e2 commit f7f7fec

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
 

‎src/constants.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
9898
* GUI related things
9999
*/
100100
#define LEGACY_SCALING (2./3.)
101-
#define TTF_DEFAULT_FONT_SIZE (13.0 / LEGACY_SCALING)
101+
#define TTF_DEFAULT_FONT_SIZE (12.0 / LEGACY_SCALING)
102102
#define DEFAULT_FONT_SIZE (14)
103103

104104
#endif

‎src/guiFormSpecMenu.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ static unsigned int font_line_height(gui::IGUIFont *font)
7676

7777
static gui::IGUIFont *select_font_by_line_height(double target_line_height)
7878
{
79+
return g_fontengine->getFont();
80+
81+
/* I have no idea what this is trying to achieve, but scaling the font according
82+
* to the size of a formspec/dialog does not seem to be a standard (G)UI
83+
* design and AFAIK no existing nor proposed GUI does this. Besides that it:
84+
* a) breaks most (current) formspec layouts
85+
* b) font sizes change depending on the size of the formspec/dialog (see above)
86+
* meaning that there is no UI consistency
87+
* c) the chosen fonts are, in general, probably too large
88+
*
89+
* Disabling for now.
90+
*
91+
* FIXME
92+
*/
93+
#if 0
7994
// We don't get to directly select a font according to its
8095
// baseline-to-baseline height. Rather, we select by em size.
8196
// 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)
105120
}
106121
}
107122
return g_fontengine->getFont(target_line_height - lohgt < hihgt - target_line_height ? loreq : hireq);
123+
#endif
108124
}
109125

110126
GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,

0 commit comments

Comments
 (0)
Please sign in to comment.