A snippet of code speaks more than a thousand words…
// Get a Label
auto *lbl = new Label("myLabel", "This text will be displayed with a beatiful font");
addAndMakeVisible(lbl);
// Choose a font name
String FontFace = "myBeautifulFont.ttf";
Font lblFont;
int ff_size(0);
auto ff_data = BinaryData::getNamedResource(FontFace.replace(".", "_").replace("-", "").toRawUTF8(), ff_size);
if (ff_size > 0)
lblFont = Font(Typeface::createSystemTypefaceFor(ff_data, ff_size));
// Set font height... this will however look bigger on iOS! (but that's a different matter)
lblFont.setHeight(juce::jmax<float>(8.f, (float)Parameter_Height - 4.f));
// Set some style options...
String Style = "Bold Italic";
// Don't set if not necessary! Setting these will revert to the default system font on iOS (Juce bug?!)
lblFont.setBold(Style.containsIgnoreCase("Bold"));
lblFont.setItalic(Style.containsIgnoreCase("Italic"));
lbl->setFont(lblFont);
And yes… on a side note, all fonts look bigger on iOS.
