If you create a font with the default constructor, its font style gets set to "<Regular>"
. That value is defined here:
I think it should be "Regular"
without the angle brackets, since it gets compared to the font styles that get read from font files, eg. here for DirectWrite fonts:
One consequence is that, if you set certain fonts as your default font, you get some random font style. With Segoe UI on Windows you will get a mix of “Light” and “Regular” glyphs.
This is reproducible by adding a line to DemoRunnerApplication::initialise
:
void initialise (const String& commandLine) override
{
registerAllDemos();
#if JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
// (This function call is for one of the demos, which involves launching a child process)
if (invokeChildProcessDemo (commandLine))
return;
#else
ignoreUnused (commandLine);
#endif
// ↓↓↓ trigger bug ↓↓↓
Desktop::getInstance().getDefaultLookAndFeel()
.setDefaultSansSerifTypefaceName("Segoe UI");
mainWindow.reset (new MainAppWindow (getApplicationName()));
}