At the time we used that because there was no Typeface::createSystemTypefaceFor so this was the only solution besides serialising font on the system which was clearly not very practical (even though we first started doing that in first Juce based products).
In some recent project, we have tried to move to Juce own stuff (createSystemTypefaceFor)
but it has some quirks.
On Windows, there was some user reporting some bogus font display which was fixed using TextLayout instead of Graphics::drawText (don’t ask me why)
On Mac, I have some alignement issue (centred is not really vertically centred)
And there is a huge difference in font size between OSX and Windows and probably rendering as well.
I wonder as well if the Juce Team has something planned for those shortcomings ?
I find that fonts are displayed much bolder on mac than on Windows and that they can appear larger on mac.
To get around this, I simply use a lighter font on mac, loaded from binary data, and I scale the font size down by a fixed amount. Something like this:
The bolder font on macOS from what I remember is a difference between the font smoothing in CoreGraphics and whatever is used on windows. If I remember correctly using the OpenGLContext will be different again but consistent between platforms. Also I think if you draw the text into an image and then display the image it will also be different? It’s been a while since i investigated it and things may have changed since then though.
I now understand why custom font have different size and placement on OSX and Window.
It’s all related to differences with HHead Ascent and HHead Descent (used by OSX) with Win Ascent and Win Descent (used by windows) in the font itself
I followed the instructions using fontForge, but in the font I used the values were already the same for height in both win assent & HHead Ascent. I generated a TTF, but it’s still not right, the Windows rendering looks like letraset compared to the nice looking MAC rendering. The size actually looks the same, it’s more that the MAC version is much bolder.