Page 2 of 2

Re: System fonts in Android

Posted: 01 Apr 2019, 08:20
by ivan_b
Hi jsantos,

I apologise for being bothersome but we need support chinese in our app and I am trying to find the best solution.
In order to choose the best solution I am trying to understand how the fonts are working.
On android when I use the Noto Sans CJK SC font which are inside the unity project the memory usage on startup is 280 MB but when i switch to Droid Sans Fallback font which is intsalled on my android device the memory usage is 180 MB.
Such a case is also with the windows version of the app (but with another CJK system font).
So I wanted to know why the memory usage of the system fonts are so much lower?

Re: System fonts in Android

Posted: 03 Apr 2019, 02:21
by jsantos
No worries, we are here to help. Local fonts are more inefficient in Unity because the asset system of unity is really inefficient. Assets in Unity cannot be streamed from disk, they need to be fully loaded even if only a small portion of the file is needed. In case of fonts, only a small subset is really needed. That's the reason system fonts are more efficient, because we don't use Unity to load them. A solution to avoid this would be putting fonts in /StreamingAssets folders and load them from there. But for now this is not supported and not planned at this moment.

Re: System fonts in Android

Posted: 03 Apr 2019, 21:26
by ivan_b
Thank you for your help.
It made my decision a lot more easier.

Re: System fonts in Android

Posted: 05 Apr 2019, 21:02
by jsantos
My advice, use system fonts as much as possible with fallbacks for each version of operating system supported. We have plans in future version of Noesis to automatically configure fallbacks to operating system fonts.