Why can not change font height?


#1

I override lookandfeel method getTypefaceForFont to use a new typeface name, and I also want to change the font height to a big size,but it doesn’t work. Is there a simple way to change all component’s font in UI ? Thanks.


#2

Font in which Component(s)?

Rail


#3

I just want to big size of font in apperance,for all components in UI,thanks.


#4

well Component::paint() is simply:

void Component::paint (Graphics&)
{
    // if your component is marked as opaque, you must implement a paint
    // method and ensure that its entire area is completely painted.
    jassert (getBounds().isEmpty() || ! isOpaque());
}

If you wanted to have a generic L&F for your own Component derived classes you’ll have to add that yourself and get the font in your Components’ paint() method. Some JUCE (derived) Components may already use the L&F for their Font… but you should look at the source code for each of their paint() methods to check.

Rail


#5

This way need change too many code, can I oerride L&F some method to change font size for all ui components display,just like in windows system I change apperance font size, all applications’s font changed.


#6

Maybe just add a global scale factor to the entire UI, rather than trying to change the font size?

Forcing the fonts themselves to be bigger or smaller would mean that they won’t fit properly in the various widgets.