Couple of custom font questions


#1

Hello all. I got a couple of custom font questions. I've embedded a font into BinaryData and create a Font in my LookAndFeel class

customFont = new Font(Typeface::createSystemTypefaceFor(BinaryData::AvenirNextLTProUltLtCn_otf, BinaryData::AvenirNextLTProUltLtCn_otfSize));

I've then overriden the various get...Font functions

Font getTextButtonFont(TextButton& button, int buttonHeight) override;

However, there seems to be no way of doing this for the 'ToggleButton'?

 

2. How do I change the font on the main window title?

 

Cheers!


#2

Ouch! Please never create a Font object on the heap! It's a pass-by-value class.

I don't know where the ToggleButton gets its font from, but it's as easy for you to find out as it would be for me: just look inside the LookAndFeel method that draws it, and see where the font comes from.