Hi,
so, we have a fairly large project which up to now only used English. We’ve now added Localization with the new Unity Localization package, which worked fine so far. As part of our languages, we have Chinese, Korean and Japanese.
I’ve added the locales and the text. However, when I now switch the locale to Chinese, I get hundreds of errors about characters not being found. The errors look like this:
The character with Unicode value \u8865 was not found in the [ConthraxSb-Regular-Tweaked SDF dynamic] font asset or any potential fallbacks. It was replaced by Unicode character \u25A1 in text object [RegularTitle].
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
TMPro.TextMeshProUGUI:SetArraySizes (TMPro.TMP_Text/UnicodeChar[]) (at Library/PackageCache/com.unity.textmeshpro@2.1.4/Scripts/Runtime/TMPro_UGUI_Private.cs:1273)
TMPro.TMP_Text:ParseInputText () (at Library/PackageCache/com.unity.textmeshpro@2.1.4/Scripts/Runtime/TMP_Text.cs:1927)
TMPro.TextMeshProUGUI:OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@2.1.4/Scripts/Runtime/TMPro_UGUI_Private.cs:1634)
TMPro.TextMeshProUGUI:Rebuild (UnityEngine.UI.CanvasUpdate) (at Library/PackageCache/com.unity.textmeshpro@2.1.4/Scripts/Runtime/TextMeshProUGUI.cs:216)
UnityEngine.Canvas:SendWillRenderCanvases ()
The text setup is that we have a regular language (ConthraxSb) with Dynamic setup, and fallbacks to the entire Noto Sans family (CJK- sc, -jp, -kr). I’ve checked, the characters which can’t be found as per the above error message are definitely there in the font files (these are the original .otf files from Google). The funny thing is that some characters are found, but most are not.
I’ve tried finding out what the cause is:
-
I removed the ConthraxSb font and directly used the CJK-sc file (in a Dynamic font asset), which did not work either.
-
I changed the CJK-sc asset to “static”, used a non-localized TextMeshPro UI element and copied some characters in and rebuild the atlas, this did not work either (i.e. the characters were not added automatically to the list).
-
I then manually added the character hex codes to the table, rebuild the atlas, and now I get the character (so something seems to be going wrong even when not using a Dynamic Font, but also in the auto-detection of characters for static texture atlasing?).
I’ve then tried to re-create a small test project with the same errors and I was unable to; everything there worked flawlessly. I tried rebuilding the entire library on our big project, but this did not change anything. The error happens both when starting from the editor and when switching languages in the built version. We have multiple scenes and it happens in all of them.
It seems to me that somewhere, somehow, something goes wrong with the logic which should decide which characters to add the the map, both with Dynamic fonts and with Static-fonts-based-on-Text-In-Scene.
I know you’d like a small test project for checking what goes wrong here, but so far I wasn’t able to create one.
However, my questions are: Do you have any ideas/instructions on what I might do in my big project to somehow figure our where it’s going wrong? Are there any more caches/libs I might delete? Can I rebuild something else? I.e. how would I debug this?
Thank you,
Philip