I’ve added an OTF file to the projucer which has been automatically added to the BinaryData namespace.
I’m now trying to use that font like so:
Font font(Typeface::createSystemTypefaceFor(BinaryData::MontserratRegular_otf, BinaryData::MontserratRegular_otfSize)); g.setFont(font.withHeight(25.f)); g.setColour(Colours::white); g.drawText("12345", getLocalBounds(), Justification::centred, true);
However the font is displayed wrong, as shown below:
The font should look like this (using paint.NET):
I’ve also installed the font to my OS and it does work if I instead use
Font font("Montserrat", 25.f, Font::plain);
But I can’t rely on my users having the font installed!
Have I done something wrong or is there something odd going on?