Or maybe there is another way to handle this nowadays?
Basically the issue is that all font assets seem to be loading at once (probably because they are being used as fallback assets) even if they are not being used. Which is creating a huge delay in loading, specifically on mobile devices.
The main font in my game is Roboto-Medium (which handles all my latin characters). And then I have the NotoSansSC-Medium as Fallback (which handles the Chinese translations).
They are both Static fonts. The chinese one used to be dynamic, but I made it static now so that I can get rid of including the actual font file (which is huge) and just use the atlas (which is still very big)
Here as an example of a TextMeshPro - Text object, which has the Roboto-Medium font selected. And the LozalizeStringEvent script.
It automatically detects the current language of the device, and loads the string that corresponds to that Reference. In the previous example, here are the options of the localization table:
The localization and Font changing works great, but as it stands, it is loading both atlases no matter the language, which is consuming a lot more memory than it should.
So, my hope is that the NotoSansSC-Medium font atlas (which is even bigger in size than the Roboto-Medium atlas) would not be loaded unless the device has the zh-Hans locale.
Hope it makes sense and it’s an easy fix!
Thank you!!