Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Chinese language fallback constantly needs reset and incorrectly sizes sprites

Discussion in 'UGUI & TextMesh Pro' started by dtootill, Sep 9, 2023.

  1. dtootill

    dtootill

    Joined:
    Oct 9, 2020
    Posts:
    25
    My game is localized into French, German, and Chinese. I'm using a font called QBBetterComicSans, with fallbacks of LiberationSans (to handle accented French and German characters) and NotoSerifSC-Regular (to handle Chinese). Text fields using the font often reference sprite assets. English, French, and German are displayed correctly, but I'm having two problems with Chinese:

    1. Periodically, the font becomes corrupt, causing the entire game to fail with a null reference exception and an error message of the form:

    UnassignedReferenceException: The variable m_AtlasTexture of TMP_FontAsset has not been assigned.
    You probably need to assign the m_AtlasTexture variable of the TMP_FontAsset script in the inspector.​

    The workaround for this is to reset all three fonts, which gets things back to normal until the next random occurrence of this error.

    2. Glyphs in text are randomly resized in Chinese messages. For example, in the English message:
    upload_2023-9-9_11-34-29.png
    the two character graphics are the same size, but in the Chinese version:
    upload_2023-9-9_11-32-47.png

    the left character is slightly smaller and the right character is markedly larger. The workaround for this is to explicitly resize the glyphs. Modifying the Chinese text to specify the left glyph as <size=110%><sprite index=7></size> and the right as <size=80%><sprite index=8></size> makes the output similar to that of the other languages.

    Are there known issues? Are there better solutions than the somewhat kludgy workarounds noted above?

    I am using Unity 2021.3.30f1, the latest LTS version of Unity 2021
     

    Attached Files: