Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro [ BUG ] Font Asset Creator

Discussion in 'UGUI & TextMesh Pro' started by KarlKarl2000, Jan 26, 2020.

  1. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Has anyone tried to make their own Asian fonts using Font Asset Creator... I tried to create CJK (Chinese\ japanese \Korean) fonts using the NotoSans font ... now I'm getting these errors. :(

    I followed these steps
    https://forum.unity.com/threads/table-of-general-standard-chinese-characters.559882/

    Code (CSharp):
    1. Mesh.vertices is too small. The supplied vertex array has less vertices than are referenced by the triangles array.
    2.  
    3. Mesh.uv is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    4.  
    5. Mesh.uv2 is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    6.  
    7. Mesh.colors is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    8.  
    I uninstalled Textmeshpro and reinstalled it, but the errors are still there. Has anyone had luck making their own CJK fonts?

    I'm pulling my hair out ! :eek:
     
    Last edited: Jan 26, 2020
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    With the added support for Dynamic SDF which was added to TMP over a year ago, the process for handling localization including CJK has been simplified. See the following post.

    In terms of the errors above, those are geometry related and not related to the Font Asset Creator directly. These could be the result of the Output of the Font Asset Creator where the missing glyph report and resulting string contains more than 65,535 vertices which is a limitation of the Unity Editor. I believe this limitation was eventually lifted in newer version of Unity but I would not recommend upgrading for that reason alone.

    Again those errors are most likely related to the missing glyph report. This list is likely very long because you might not be using the NotoSansCJK version of the NotoSans font where the font you are using doesn't contain the CJK characters and as such results in a long list of missing glyphs. So make sure you are using the NotoSansCJK font. Also review the post I linked above.
     
  3. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29
    Hi Stephan!
    While doing localization of one of screen, I am facing same issue. I am using NotoSans font family for Chines, Japanese, Korean, Thai, Arabic and Greek fonts as a fall back asset.
    But it behave abnormal some time.
    Normally its work fine in start, but when that error appear (blow)
    Mesh.vertices is too small.
    Mesh.uv is out of bounds.
    Mesh.uv2 is out of bounds.
    Mesh.colors is out of bounds.

    Mostly the fonts Chines, Japanese, Korean, Thai, Arabic and Greek start missing in Unity Scene & Game Mode.
    If I looked it inside the inspector of Text_Mesh_UI text box, they look fine there, but inside the canvas they start missing

    upload_2021-1-21_13-27-17.png

    But inside the inspecter they looks fine

    upload_2021-1-21_13-27-55.png


    That only happen when I receive the error.
    In start it works fine, but with the passage of time it start missing.

    I am using Unity 2019.4.16f and text mesh version is below
    upload_2021-1-21_13-33-16.png
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Version 2.0.1 is pretty old. The latest release for 2019.4 is version 2.1.3.

    Please test with the latest release. Be sure to review the release notes first as there have been a lot of changes since version 2.0.1. As usual be sure to backup the project before the update.
     
  5. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29
    It is still missing

    In inspector showing perfect
    upload_2021-1-21_23-24-58.png

    Game Mode
    upload_2021-1-21_23-25-56.png


    I am now using latest release of textmesh pro
    upload_2021-1-21_23-26-44.png
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The NotoSans font file may not include all characters but in order for me to confirm, can you copy / paste those characters / the raw text in the Text Input Box for me to test.

    Is your font asset static or dynamic? If static, please test using a dynamic font asset using the same font file.

    Are the errors gone when using the newer release?
     
  7. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29


    After updating the TextMeshPro I did not receive any error


    I tried to add Korean text, but pop up error appears.

    upload_2021-1-22_9-58-36.png


    In English
    Deliver cargo and earn coins!



    Missing text screenshot
    upload_2021-1-22_9-57-29.png


    In inspector it is
    upload_2021-1-22_9-57-39.png



    I am using NotoSans family + some other google fonts as fall back asset to support different languages.
    For Korean I am using "NotoSansKR Regular SDF"
    upload_2021-1-22_9-58-1.png




    All font asset are dynamic
    upload_2021-1-22_9-58-12.png
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See if you can private message me the text.
     
  9. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29

    I have attached a text file containing the Korean Text.
    Please note, not only that string showing the missing text, there are other words and lines behaving like that
     

    Attached Files:

    Last edited: Jan 22, 2021
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I just got around to testing the above with both NotoSansCJK and NotoSansKR and those glyphs do show up as expected as seen below.

    upload_2021-1-25_15-17-56.png

    Can you post an image of the Atlas Texture of your font asset?

    Does enabling Multi Atlas Texture make those glyphs show up?
     
  11. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29
    Hi Stephan_B, Sorry for late response,

    After enabling multi-Atlas texture, same thing happening.

    Inspector side

    upload_2021-2-8_16-4-37.png

    Game tab View

    upload_2021-2-8_16-5-36.png


    Here is the text string




    Here is my font asset
    upload_2021-2-8_16-8-2.png

    upload_2021-2-8_16-8-32.png
     

    Attached Files:

  12. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29

    Here is Atlas texture
    upload_2021-2-8_16-12-16.png

    upload_2021-2-8_16-12-28.png
     
  13. AsifNaeem

    AsifNaeem

    Joined:
    Apr 12, 2016
    Posts:
    29
    One more important thing I want to discuss with you.
    I observed that in the start all font assets works fine, but when I try to test different localization languages, It start showing these glyphs, I have no idea either that issue is somewhere inside Unity editor cache or in font assets.

    It does not happen in the first time, but 2nd, 3rd, 4th time it starts showing more & more glyphs.

    I find a workaround for that problem,
    I remove all the font assets & create again by using CTRL+ SHIFT+ F12,
    Then I assign all deleted fall back assets,
    They work fine in the start, and after some times, the same glyphs start appearing again.
     
  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you submit a bug report with project and steps to reproduce this?

    Something strange is going on and I would like to figure it out. If you are able to submit the bug report please provide me with the Case # once you get it via email from Unity.