Unload unused font assets

Hey @Stephan_B I was wondering if you ever got around to implement what you talked about here?
http://digitalnativestudios.com/forum/index.php?topic=1585.msg11750#msg11750

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.

Any tips on this would be highly welcomed!

Maybe someone other than Stephan knows how to do this?

Can you provide some insight on the structure of your font assets and fallbacks? Just to give me an idea of your setup / potential complexity of it.

Please indicate which of these are static vs, dynamic?

Yes of course.

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). 6411636--716127--Screen Shot 2020-10-12 at 10.49.01 PM.png

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)

Then the localization of the app is handled “automatically” by the Localization package through addressables: https://docs.unity3d.com/Packages/com.unity.localization@0.8/manual/index.html

Here as an example of a TextMeshPro - Text object, which has the Roboto-Medium font selected. And the LozalizeStringEvent script.
6411636--716130--Screen Shot 2020-10-12 at 10.52.18 PM.png

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:
6411636--716133--Screen Shot 2020-10-12 at 10.55.22 PM.png

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!!

I would also like to solve that problem, any news?