I’m drawing text and using .boldened() to increase the weight.
On Windows it shows the font with bold style.
On macOS it falls back to the default font. Removing the boldened call shows the correct font again, but without the desired weight increase.
If need be I can try putting together a minimal repro, but it’s fairly easy thing to repro, essentially what I’m doing is:
font is set to an instance of the above linked font, colour is a juce::Colour, size is a float, text is the text I want to display.
On macOS this will instead paint the text using the fallback:
Without the boldened call it will look like this:
It’s possible that the reason this is happening is that the font doesn’t have a bold weight included, but the discrepancy between macOS and Windows is somewhat surprising.
It sounds like one system is simulating a bold version of the font, whereas the other is looking for a non-simulated bold version of the font, failing, and falling back to a different font. Unfortunately we can’t prioritise investigating this at the moment. I expect you could work around this by bundling and loading the desired bold face from binarydata, rather than relying on font lookup to locate/simulate a suitable font.
Seeing something similar here, embedding Open Sans as a .ttf and trying to get a bold version of the font, using the following in a custom Look and Feel constructor:
I had thought about that workaround (bundling a bold version), but that particular font doesn’t have a bold version.
The main issue really was that there is a disparity between platforms, and that it wasn’t mentioned anywhere that this is a “breaking” change for JUCE 8 (JUCE 7 doesn’t exhibit this behaviour).
I hope the team will find time eventually to address this problem.
I understand you’d like the underlying issue fixed, that would be best, but as a workaround it is possible with FontForge to make a bold version of the font rather easily. I had to do that with a font recently and it was pretty easy. Example:
Element > Select > Glyphs worth outputting (selects only active glyphs, and not empty ones)
Element > Style > Change Weight > Embolden 25 (try different amounts until you like it).