Search Unity

Japanese Character Issues

Discussion in 'UGUI & TextMesh Pro' started by FinlayMcGrath, Jul 12, 2018.

  1. FinlayMcGrath

    FinlayMcGrath

    Joined:
    Apr 23, 2018
    Posts:
    4
    I'm adding Japanese text to the game I'm working on and I'm using the Noto font from Google to do so. I've been using the font creator to get my font asset and for anything below an 8k texture it cuts off a number of the characters ie only 10k/20k or so. When I use an 8K texture it just creates a completely white texture. Not sure what is going wrong, any suggestions?
    That's the settings I'm using:

    upload_2018-7-12_10-59-1.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    I'll try to reproduce this on my end and should be able to provide feedback later today.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    I just had a chance to look into this and got the following results using the same font and settings.

    upload_2018-7-12_11-31-31.png

    What version of Unity and TextMesh Pro are you using?

    If you are using the free version of TMP, what is the name of the dll located in "TextMesh Pro/Plugins/Runtime/..."?

    BTW: I would recommend breaking this up into a few 2048 x 2048 textures where the Primary (first) font asset contains all the Japanese text known / used in the project. Then each additional font asset would contains the balance of the characters in the range and assigned as fallback to the Primary font asset.
     
  4. FinlayMcGrath

    FinlayMcGrath

    Joined:
    Apr 23, 2018
    Posts:
    4
    Thanks for the response, I'm using Unity 2018.2 with TMP version 1.2.4 pulled from the package manager. I imported the "TMP Essential Resources" as you've described in past posts. I don't appear to have a TextMesh Pro/Plugins/Runtime/ folder anywhere in my project (including the Packages folder) though I should point out that I'm perfectly able to create other font assets of smaller sizes.

    I'm not sure what you're suggesting by splitting up the texture into smaller textures. The game has a chat function so my understanding would be that all characters would be required by the game.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Take a look at the Fallback system which allows you to use and assign a list of font assets to another font asset where these fallback font assets will be searched in the event the first font asset doesn't include the requested characters. See the following video which although old by now should still provide a good overview of the system. Watch this other video as well.

    Note, that fallbacks can now be assigned per font asset as well as in the TMP Settings. Sprite Assets are also part of the fallback chain now and sprite assets can also have fallback of their own.

    So instead of having a gigantic font atlas texture, you can instead have a smaller one that only contains the characters known / used in the project (excludes user input). Then to handle user input and those unknown characters, you can create additional font assets which are assigned as fallback to the primary one.

    One of the nice benefits of the system is that your primary can have a different resolution and settings vs. the fallbacks.

    For instance, you might chose to use a higher sampling quality on the characters the are known in the project which using a lower sampling quality for characters that will come from user input which are likely to be smaller on screen.

    The key part here to pay attention to is making sure the sampling ratio to padding is the same for all font assets. For example, if the primary has a sampling of 80 point size with padding of 8 then the fallbacks can have a sampling of 40 with padding of 4.

    Maintaining the same ratio of sampling to padding will ensure that visual styles like outline or shadow look the same across the primary and fallbacks.
     
  6. FinlayMcGrath

    FinlayMcGrath

    Joined:
    Apr 23, 2018
    Posts:
    4
    I'll take a look at that system, I had no idea it existed but it sounds like it'll solve my issues. Thank you very much for your time.
     
    Stephan_B likes this.
  7. Vismox

    Vismox

    Joined:
    Oct 16, 2018
    Posts:
    1
    Hello there. I am trying to add Japanese language support to my game. Does anyone have the split list of hex codes for it?
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    The list of Unicode for any given language can be found here.

    Since the release of the new Dynamic SDF system which is part of TMP version 1.4.0 for Unity 2018.3, this process should be much easier since characters and glyphs can now be added dynamically to font assets. See the following post for details.