Search Unity

TextMesh Pro Does Text Mesh Pro support Simplified Chinese?

Discussion in 'UGUI & TextMesh Pro' started by Rich_A, Oct 11, 2018.

  1. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Hi all,

    I've searched the FAQs and cannot see an answer to this question.

    Does TMP support Asian characters such as Simplified Chinese?

    In my experiments with the asset, I cannot get it to display any characters, with either the inbuilt fonts or my own font which includes the characters.

    With simplified Chinese being such a critical language to support now in 2018 (second most popular language behind English on Steam) - TMP being unable to support the language would significantly diminish the usefulness of the asset.

    Any ideas? Do the built-in TMP fonts just not include these characters, and maybe I'm importing my chinese font incorrectly?
     
    Last edited: Oct 11, 2018
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    TextMesh Pro does support CJK including proper word wrapping for East Asian languages.

    The font asset included with TextMesh Pro (Liberation Sans SDF) does not include CJK characters.

    See the following post. There are also several additional posts related to this.
     
    Rich_A likes this.
  3. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Thanks for that. Yes, I figured it was because the inbuilt 'starter' fonts didn't include the thousands of Chinese characters.

    I tried searching, but nothing showed up for 'text mesh pro chinese'. Now, this thread will help direct people using that search term :)

    Follow-up question: what is the best practice for getting a 'Chinese' font into TMP? What do I enter into the 'character set?' section of the Font Asset Creator?

    Edit2: It seems like the best practice for CJK is to wait for the translations to be finalised, and then import only the set of characters being used in the game. Otherwise I will blow out the output texture.
     
    Last edited: Oct 11, 2018
  4. Creta_Park

    Creta_Park

    Joined:
    Mar 11, 2016
    Posts:
    76
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    P.S. This process will be getting easier soon. Be sure to tune in to TMP presentation at Unite LA :)
     
    Rich_A and Creta_Park like this.
  6. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Thanks. I'm strictly stuck with 2017.4 for my project - will these future changes be compatible with that version?
    Would the changes/TMP asset update be released in year 2018? :)

    I only have about 700 words total, English, Russian, Simplified Chinese, Spanish, German. So once the translations are finalised, I can just populate all the European characters, then get a character list from the Chinese translator of which of the 3000 total Chinese characters I'm using. For simplicity I'd like to just have these in a mega-font file, target is PC/Console anyway so the large resultant texture is fine.

    So if these upgrades are a few months away, I might just delay the UI until then.


    Edit: Is there a TMP font file that I can download from somewhere which includes the characters from all languages, just for testing purposes?
     
  7. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Has this presentation taken place?
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Indeed it has.However, I don't think presentations in the Exhibit area were recorded.

    Having said that, I'll create and upload a demo this weekend.
     
  9. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Thanks for the response. Is there anywhere I can read about what the changes actually are? Its all still very mysterious.
     
    AcidArrow likes this.
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Indeed it is ;)

    I'll do my best to get this video done / uploaded tonight (ie. sometime between 2:00 ~ 4:00 am). If not tomorrow for certain.
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    If this was some sort of an attempt at viral marketing, well... it worked! :p My interest has piqued. Any chance we get a TL;DR before the video?

    Also, will the video go on Unity's youtube channel?
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Just letting everyone know that I am working on the video which will be available later today.

    At first, it will be on my YouTube Channel but I'll ask and see if we can also make it available on the Unity YouTube Channel.

    Update
    Here is a link to the first draft / rough version of the video.
     
    Last edited: Oct 28, 2018
    zIyaGtVm, cxode and AcidArrow like this.
  13. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Is it possible to receive a summary of the changes please? The video is 24 minutes long.

    At this point I think its simplest to just use two materials/fonts, one for European+Russian, another for Chinese based on the characters from my finalised translations, and just manage it via the L2 Localisation app. Fortunately I only have about 800 words in game to worry about.

    Its a shame that all of the updates are tied to 2018.3. 2017.4 remains the only LTS version available. Will any updates to TMP be ported to that version, or is it the end?
     
  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The core functionality used by the dynamic system is now contained in Unity itself as opposed to the package. The new Font Engine could be back ported to Unity 2017.4 but it will be up to release management to access the risk from their perspective and to decide whether or not to allow it. So no promised on back port to Unity 2017.4.
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,716
    I like the new system. But I have a question, what happens when the dynamically created atlas fills up at runtime? Does it start a new one? Does it start replacing currently unused glyphs?
     
  16. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Currently the system behaves as it does today where if it fails to add / find a glyph searching through the primary and all fallbacks, it will display the missing glyph symbol. So you just need to make sure that your dynamic fallback(s) have enough room to catch / add any glyphs not already contained in your primary and static font assets.

    Having said that, the glyph data structure already contains a field for the atlas index and the font atlas texture is already contained in an array of potential atlas textures. So in the future (some subsequent package release), new atlas textures will be created as necessary.
     
    AcidArrow likes this.
  17. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    773
    It ok with different language But it will no properly sorting if you not use english I don’t know why.
     
  18. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What do you mean?
     
  19. Allthebees

    Allthebees

    Joined:
    Apr 22, 2017
    Posts:
    18
    Wrapping does not seem to work correctly for me. I checked the LineBreaking Following/Leading Characters document and everything seems to be there.

    This example phrase: upload_2021-2-25_14-59-39.png

    (I can't add the phrase into the text of this message as I get a banned message)

    Looks like this with wrapping enabled:

    upload_2021-2-25_14-57-43.png

    Clearly it is not being broken at the commas?
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you post a .txt file with the text in it?

    P.S. I have asked our forum folks to look into this.

    Having said that, unless you edited the line breaking rules, it is legal to break on most of these characters. Please test the above text in MS Word or Google Docs or even Chrome to see if they behave any differently.

    Let me know what the results are.
     
  21. Allthebees

    Allthebees

    Joined:
    Apr 22, 2017
    Posts:
    18
    Thanks for the quick response! Really smart idea! I tested the phrase in multiple word processors and they all behave the same as TextMeshPro.

    I tripped myself up a bit as I had a script that was changing the spacing options of the textbox based on the font being used which meant I was seeing different results for different fonts :S

    Thanks again for the help!
     
    Stephan_B likes this.
  22. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You are most welcome and thank you for the following and confirming that we are doing it right :)
     
    Allthebees likes this.