Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

TextMesh Pro CJK font asset

Discussion in 'UGUI & TextMesh Pro' started by NorLesny, Feb 27, 2019.

  1. NorLesny

    NorLesny

    Joined:
    Jan 3, 2018
    Posts:
    5
    Hey,
    I'm currently adding support for CJK languages and was wondering what is the best way to create font assets for such languages.
    I don't have predefined characters that will be used so I need to include all of them.
    In Unicode, there are around 20k characters for CJK. I can put them all on one texture but the resulting asset is really big. Is there a limit for the font asset size? I'm working on an app for VR so the computers using the app should be rather good.
    Also, for such a big texture, would it make sense to split it into a few smaller fonts with a fallback system configured?
    Is there maybe some other way of dealing with the problem of CJK languages that I don't know about??
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,289
    With the release of the new Dynamic SDF system which is available in the TMP package release version 1.4.0-preview.2a for Unity 2018.3, the strategy has changed slightly from my previous recommendations.

    See the following post in the top sticky thread in this forum section which outlines my recommendations for handling CJK with the new Dynamic SDF system.

    Also take the time to review the first post in that thread and watch the video to get better insight on what to expect as you migrate to this new release.
     
  3. NorLesny

    NorLesny

    Joined:
    Jan 3, 2018
    Posts:
    5
    Thanks for your answer.
    When I was reading about the Dynamic system before, the way I understood it was that the 'dynamic' part was only working in the editor - so it'd get all the texts you have on the Text component. In the post that you linked, it mentions user input. So, the Dynamic SDF system will work at runtime?
    Is the dynamically generated asset saved somehow between the app sessions?
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    4,289
    The Dynamic SDF system is runtime.

    In the Editor the changes are persistent but as assets cannot be modified on devices, changes are not persistent between play sessions. This part is not specific to TMP but to Unity.

    This is why I still recommend, creating static font assets that contains the known text / characters for each languages / groups of languages in the project. By known characters, I mean text contained in your menu, titles, etc.

    Then use dynamic font assets to handle all user input which is likely to be a small number of characters. These dynamic font assets could be created ahead of time and assigned as fallbacks to the appropriate primary / static font asset or even created at runtime and then assigned as fallback where needed.
     
  5. NorLesny

    NorLesny

    Joined:
    Jan 3, 2018
    Posts:
    5
    That explains a lot, thanks for your answer :)
     
unityunity