Menu Fonts

Hello everyone,

this is most likely a really stupid question, but I’m unable to find out how to change Font in my main menu. Am I missing something here?

Thank you in advance.

There’s a method in the LookAndFeel to set the font, I think.

I was looking into LookAndFeel but I couldn’t find anything but this.

virtual const Font LookAndFeel::getMenuBarFont ( MenuBarComponent & menuBar, int itemIndex, const String & itemText )

So if I’m not mistaken the only way to do it, is to inherit form the base class LookAndFeel and create a new LAF?


Well yes - the font might need to be chosen dynamically, so this method allows more flexibility. It’s only a few lines of code to write one.

Yep, no problem. I was thinking of making a simple one anyways.

I’m doing pretty much what you’re talking about here, and I just got this odd behaviour:

If you look at the arpegiator popup thingy, you see the combobox label defaulting to 17 pt font size. The look and feel returns “font(9.0f)” on the methods for the popup menu font and the combobox font.
As you can see, the menu part gets it. As does the combo boxes on the main component.
I don’t think I’m doing anything different.

EDIT: Never mind! The font size isn’t until there’s a resize call. I wasn’t propagating those to the child component, so that combobox never got the call to set the font size.

Hey RH, somewhat OT question:

seems like you have a screenshot with no antialiasing (fonts and drop shadow). How did you do that? Or is this OS dependant? I didn’t have time to try juce under linux yet.

Well, if you look at the text at 17 pt you see that it actually does blur. What I do here though, is use a font called Amiga Topaz 8 which is actually pixelated. Again look at a text of the wrong size.

But when you set topaz 8 to 9.0pt, the pixels align and the anti aliasing magically disappears. There are other fonts that are made like this too. All monospaced, but that’s the nature of the beast.