When I load a FontAsset set in Addressables at runtime and register a fallback, it does not work correctly.
When the ‘Play Mode Script’ in Addressables is set to ‘Use Asset Database’, it is displayed correctly.
However, when it is set to ‘Use Existing Build’, it is not displayed correctly.
Specifically, the process is as follows.
-
Create a Base SDF (alphanumeric static font) as a fallback source and register it in Addressables.
-
Create JP Static SDF (static Japanese fonts) and JP Dynamic SDF (dynamic Japanese fonts) for fallback font, and register them in Addressables.
-
Change the Play Mode Script in Addressables to ‘Use Existing Build’ and run ‘Build → New Build → Default Build Script’.
-
Attach the Base SDF to the Default Font Asset in TMP Settings, and create a TMP_Text on the scene.
(it will leave the fallback list empty here.) -
Load Base SDF, JP Static SDF, and JP Dynamic SDF at the start of the scene, and register JP Static SDF and JP Dynamic SDF into the fallback list of Base SDF.
baseSDF.fallbackFontAssetTable.Add( staticSDF );
baseSDF.fallbackFontAssetTable.Add( dynamicSDF ); -
After setting the fallback, set alphanumeric and Japanese text for TMP_Text.
-
All Japanese characters except alphanumeric characters are not displayed and the following warning is displayed
“The character with Unicode value \u3042 was not found in the [Base SDF] font asset or any potential fallbacks.It was replaced by Unicode character \u25A1 in text object [Text (TMP)].”
I don’t think it’s a bug, but rather a problem with the references(depencencies) in the asset bundle.
I can’t think of a solution, but I’m having a hard time. Please Help…
Attached is a sample project that shows this problem.
OS:Windows 10
Unity: 2020.3.18f1
TextMeshPro:3.0.6
Addressables:1.18.16
7565152–936373–TMPWithAddressables.zip (3.66 MB)