As you may or may not know WebGL has no access to system fonts, which means for languages that are not roman there is nothing to fall back onto when a character does not exist and instead it will draw nothing.
We are in the process of translating our game into simplified chinese, but every font file we find is 3+ MB’s (uncompressed), This adds a lot to our game for iOS and Android, were on iOS we are sitting just below the 100 MB air download cap, Android is fine, but smaller downloads are better.
We require this font for WebGL for the previously stated reason, but we want to exclude this font from our iOS builds mainly because I do not think we need this for iOS or Android, or legacy WebPlayer.
There are some obvious choices, like removing the font by hand or opening a separate branch for git and we have looked at those but they are not ideal for a number of reasons.
We have considered that, I am not sure how that will work as a fallback font for our main game font. Since players can change their language on the fly.
Just download the assetbundle/font when selected (or preload it), but only for WebGL builds. Or maybe Im not understanding your exact case requirements.
All of our UI points at a particular font, when we select that font in the Project window, it brings up the font import settings. We set the Font Names up for the Fallback fonts. However what I am unsure of is will this actually work if the font is coming in through an Asset Bundle and it is set as a fallback font.
I honestly don’t know if the downloaded font would automatically register as a fallback if the name is included in the list; that would have to be tested. It’s possible that as long as the font is in the project but not referenced by default in your UI, that once it is loaded via assetbundle the reference could be found as a fallback.
I don’t really think this will work. Here’s an example of a font that has “fallbacks”:
Note that no only the font names are taken into consideration. Based on the name, a list of referenced font assets is populated (see below - Element 0).
In your case, let’s say all of the Text components in your game reference Font A, and inside it, it has a fallback to Font B, this font will automatically be included in the game (for all platforms).
What was the resolution for this? I am having the same issue. Were you able to do this through the Asset Bundle system, or did you have to find a different solution