I am currently migrating one of my Android applications from JUCE 7 to JUCE 8 and have encountered an issue where font styles are not being applied correctly on Android.
Just following up in case this got buried. We rely heavily on font styling in our UI, and this is currently blocking our migration to JUCE 8 on Android.
Any guidance would be greatly appreciated. Happy to provide more details or help test potential fixes if needed.
My workaround has been to not rely on system fonts or on JUCE to apply styles such as bold or italic. Instead I bundle my own typefaces as binary data, for example RobotoRegular, RobotoBold, RobotoItalic, etc. and have my own functions to select them. It’s not ideal but this makes sure that Android or iOS updtates can’t cause unexpected changes.
I think what’s going on is that newer Android versions may supply a single font with multiple variable axes to specify weight/italics/spacing, whereas older Android versions were more likely to supply multiple typeface files, one for each distinct style. At the moment, JUCE doesn’t provide an API to modify settings of variable fonts, so the best workaround for the time being is to bundle your own typefaces, as mentioned above. We’re planning to add support for variable fonts in the next major version of JUCE.
We’ve pushed a partial fix, which will improve built-in typeface selection for older devices that use non-variable fonts (single-file-per-style).
As I mentioned above, we’re planning to add variable font support in the next major version of JUCE, so the “full” fix will be included in that work.