Anyone have any experience loading Google variable fonts?
Took a stab at it, works for us.
Nice work!
Now that Juce 8 has harfbuzz integrated, is it possible to use variable fonts on all platforms?
Not familiar with harfbuzz
yet, actually first time I heard about the library was when I was discussing all the upcoming JUCE 8 changes with the team. Looks like there is variable font support in harfbuzz. This is probably a question for @anthony-nicholls or anyone on the JUCE team. We can definitely take a crack at it if it’s not a priority for the JUCE team when we upgrade to JUCE 8.
Finally got around to this with harfbuzz.
Thank you for the hard work. I very much hope this can be merged into official JUCE.
Thanks @pflugshaupt - Hope other people find this useful, we really needed it internally because most of the designs coming in now make use of variable fonts. I did see a slight inconsistency between Weight(s) coming from Figma vs harfbuzz (for example wght of 500 in Figma looks too heavy when applying it in harfbuzz) not a big deal but worth noting, I have to set it to 400 to match.
This is great! Bump to get this merged into JUCE. The entire font system has been updated and I still have to go in and manually add this into my fork.
For anyone reading this in the future: Seems like this was just added to JUCE 8.0.9
I don’t think so… Maybe just some of the backend required but there’s no API to actually get the variations as far as I can tell?
getFeatureSettings()
has been added to juce::Font
- not sure whether that supports variable fonts though.
Hmm, looks like it could be actually.
I use Google Material Symbols in web views and the properties there are things like:
'FILL' 0,
'wght' 300,
'GRAD' 0,
'opsz' 24
so looks like these 4-char settings you’d see if the typeface supports and then set them on the Font
. Cool stuff. I’ll have to see if it works at some point soon.
We added Font Feature support awhile back. Variable font support is currently being explored.