I want to use Roboto Bold font in the app. I’ve generated binary h/cpp from Roboto-Bold.ttf with binarybuilder and tried to use it:
[code]
AnyComponentLookAndFeel::AnyComponentLookAndFeel(void)
{
vf::FreeTypeFaces::addFaceFromMemory(7.f, 50.f, false, binarydata::robotobold_ttf, binarydata::robotobold_ttfSize);
}
const Typeface::Ptr AnyComponentLookAndFeel::getTypefaceForFont (Font const& font)
{
Typeface::Ptr tf;
String faceName (font.getTypefaceName());
// Make requests for the default sans serif font use our
// FreeType hinted font instead.
if (faceName == Font::getDefaultSansSerifFontName())
{
// Create a new Font identical to the old one, then
// switch the name to our hinted font.
Font f (font);
// You’ll need to know the exact name embedded in the font. There
// are a variety of free programs for retrieving this information.
f.setTypefaceName (“Helvetica Neue LT Com 65 Medium”);
// Now get the hinted typeface.
tf = vf::FreeTypeFaces::createTypefaceForFont (f);
}
// If we got here without creating a new typeface
// then just use the default LookAndFeel behavior.
if (!tf)
{
tf = LookAndFeel::getTypefaceForFont (font);
}
return tf;
}
void AnyComponentLookAndFeel::drawLabel (Graphics& g, Label& label)
{
Font f(“Roboto Bold”, 40, 1);
Typeface::Ptr tf = getTypefaceForFont(f);
g.fillAll (label.findColour (Label::backgroundColourId));
if (! label.isBeingEdited())
{
const float alpha = label.isEnabled() ? 1.0f : 0.5f;
const Font font (getLabelFont (label));
Font robotoFont(tf->getName(), 40, 1);
g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
g.setFont (robotoFont);
....
}[/code]
But the default font is rendered