Confusion over Juce 8 fonts

Hi, if I want a font from my binary resource. I now have to make it a pointer…

// Member variable..
	Font *franklin;

// Constructor

	FontOptions opt(Typeface::createSystemTypefaceFor(BinaryData::framd_ttf, BinaryData::framd_ttfSize));
	franklin = new Font(opt);

// Destructor
    delete franklin;


// Usage

g.setFont(*franklin);

g.setFont does not take a pointer?

Is this correct, or should I not use g.setFont any more?

No, you don’t need to use pointers all of a sudden. You simply need to provide a font options object in your member variable.

    Font    franklin { FontOptions { Typeface::createSystemTypefaceFor ( BinaryData::framd_ttf, BinaryData::framd_ttfSize ) } };
2 Likes

Oh thanks. Durrr, I thought I tried every combination!

Cheers reFX.