I'm looking for a simple step-by-step solution to embedding fonts in JUCE.
I'm having a bit of trouble embedding fonts in my app (totally forgot to put time into this before an app release, and now my app isn't displaying my font on user systems - understandably so).
I've searched and followed all the posts available on the subject, but am still having issues. I'd like to be to add the embedded font to labels already present in my app that we're created and layed out via a ProJucer GUI component.
What I've done so far:
1) Added the font to my ProJucer session so that it gets added to BinaryData
2) Created a class I called "EmbeddedFont:"
#include "../JuceLibraryCode/JuceHeader.h"
class EmbeddedFonts
{
private:
Font calistoMT;
public:
EmbeddedFonts();
Font& getCalistoMT();
};
and
EmbeddedFonts::EmbeddedFonts()
{
// in the line below is where I'm getting the assertion error: jassert (typefaceName.isNotEmpty());
calistoMT = Font(Typeface::createSystemTypefaceFor(BinaryData::Calisto_MT,
BinaryData::Calisto_MTSize));
}
Font& EmbeddedFonts::getCalistoMT()
{
return calistoMT;
}
3) Made an instance of this in the header of my GUI component class 4) Tried passing this font to the label font:
genericLabelName->setFont(embeddedFont.getCalistoMT());
Not really sure what to do from here. Also, after I get the embedded font to work, is there anything specific I should be doing to the font field in the projucer GUI component? Should I just set it to the same font? I only ask because I will technically be setting the font twice in the constructor (once from the GUI Component option drop-down menu and once from hand coding the embedded font).
I've tried this for a few days and still am having trouble. Thanks for any help. This is the last thing I need to do before releasing my next app update, so any assistance is greatly appreciated.