Font import issue?


I’m trying to add a custom font to my project, and whilst searching online through other threads, I came across the ability to add the font into Projucer, then use the following:

Font getLabelFont(Label &) override
    return Font(Typeface::createSystemTypefaceFor(BinaryData::robotoblack_ttf, BinaryData::robotoblack_ttfSize));

This method is is constructed in my custom slider class.

However, it displays an error saying: Use of undeclared ‘BinaryData’.

Is the the current / correct way of using a custom font? Or have I missed a step

Thanks in advance :slight_smile:

Have you included the header that declares robotoblack_ttf and robotoblack_ttfSize in namespace BinaryData?

How did you add the font to your project, using the Projucer?

Excuse me if I did this incorrectly, but I added it using the following method:

Added a new GUI Component inside Projucer, then added new resource, and chose the font file. I couldn’t find a tutorial importing specific files like fonts.