Setting a default font typeface


I want to set a font typeface that will be used for ALL text within my application.
As far as I can understand, I need to call the setDefaultSansSerifTypefaceName (const String &newName) on my default LookAndFeel object, with &newName being something like “Times New Roman”. However this does not change the typeface of any text.
I have managed to change the font of a single Label component by creating a new Font object and calling the setFont (const Font & newFont) function, but is it not possible to change a LookAndFeel typeface to apply a typeface to all text?


I would love to know how to make global style changes, especially typeface, as well.


Have a look at this thread. Make sure you read all the following posts to make sure you get the fixes. Note that this will also show you how to embed fonts. If that doesn’t matter to you, then the main bit you’re after is the bit about getTypefaceForFont().

If you have issues, then post back on this thread and I’ll see if I can help.


Hi Andrew, that thread is not helpful for our questions. It’s about embedding fonts, not app skinning in general. I do not know how to use the LookAndFeel class, and can’t figure it out from the documentation. Just looking for a tutorial.