Modern custom font guide?

I’ve always found dealing with custom fonts in JUCE confusing and unintuitive.

Thanks to this and the other thread linked I boiled it down to these 3 lines to set a new default font stored as Binary Data:

In my custom L&F constructor

Typeface::Ptr tface = Typeface::createSystemTypefaceFor(BinaryData::MontserratRegular_ttf, BinaryData::MontserratRegular_ttfSize);
setDefaultSansSerifTypeface (tface);

and then in Main::initialise() or MainComponent constructor:

LookAndFeel::setDefaultLookAndFeel (&customLookAndFeel);
13 Likes