Default font height


#1

Hi,

Would it be possible to move all default font height (usually 14.0f) in the look and feel ?

It’s currently possible to change the default font’s typeface, but not the height.

I don’t know why, but it seems that the last tip gives smaller font than the previous versions…


#2

I’d have thought that most fonts were sized by the l+f already. Which comps are giving you trouble?


#3

The TextEditor for one, use a default 14.0f font size (set in the constructor).
I can set the font by myself with a setFont call, but I would prefer not having to do so for all the text editor I’m using.

TextButton use default 15.0f font height (in getFont()), and it’s not possible to increase this.

Label use a default 15.0f font height (in the constructor)

The combobox use label, hence a 15.0f font but also use the LookAndFeel::comboBoxFont…

Probably adding a LookAndFeel::getDefaultFontHeight() or a Font::getDefaultFontHeight() could be a good idea there.


#4

Yes, not a bad idea. I guess ideally there’d be a default height and all the l+f methods would set their sizes relative to it.

Some of those comps aren’t quite that simple though - e.g. the textbutton and combobox fonts are actually proportional to their height.


#5

Well, I disagree with you on that point.
textButton and comboBox font are proportional to the height only if the “computed” height is below the min height said above.

(The code is something like “return Font (jmin (15.0f, getHeight() * 0.6f));”)
This means that the maximum height is 15.0f and it’s not customizable.

Maybe a better code would be “return Font (jmin (Font::getDefaultFontHeight(), getHeight() * 0.6f));” ?


#6

Yes, that’s true…


#7