Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Chinese language fallback constantly needs reset and incorrectly sizes sprites

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

  1. dtootill


    Oct 9, 2020
    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:
    the two character graphics are the same size, but in the Chinese version:

    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: