Hello Everyone !
I am currently having trouble finding a way to specify which style of a typeface I wish using in JUCE.
Specifically I have imported the ‘Bahnschrift.ttf’ typeface that has 15 different styles such as :
‘Regular’
‘Bold’
‘Light’
‘SemiLight’
etc…
When using it, juce defaults the style to ‘Regular’, my question is :
Is there a way to specify that i want to use the ‘SemiBold Condensed’ style (for instance) instead of splitting the ttf file beforehand and adding it to JUCE ?
Thanks
Just found out that this only works when you install the font on your system doesn’t it ?
After trying out the code on a different system, and uninstalling it from mine, the setTypefaceStyle method seem to not work on binarised font file ?
A single font file, like an .otf typically only has one style. When you download a font from say Google Fonts, it’ll be a .zip containing a font file for each individual style.
So if you want to use different styles with an embedded font, you need to embed each individual font file. At that point there’s not much point in using setTypefaceStyle since you can just load the different styles to different juce::Font variables like so:
Hello ImJimmi. I work on the same project as Milos. Thank you so much for your answer ! So helpfull. At that point if we consider what you say the solution would be to find different otfs with different styles of the Bahnschrift font in it. However for the moment our search is not successfull. Do you know where we could find these otf ? Do you think we can use a font editor to split the styles ? If so, have you any recomandation on which editor we could use.