Fonts - Using system fonts or packaging in a default font

So in looking in the doc’s, it says when I set a font to use, it looks for that font on the users system, and if it doesn’t find it it will use whatever is set as default for that font family (e.g. Arial). Is there a way to package a default font that will display the same on all systems and not access any of the font’s on the machine at all? Just to have a consistent display.

Thanks

Yep, of course there’s a way!

You can load your desired font up and override getTypefaceForFont in a custom LookAndFeel.

The Typeface::Ptr instance you create should be loaded once, via this call:

Typeface::Ptr myFont = Typeface::createSystemTypefaceFor (/*data*/, /*sizeOfDataInBytes*/);