Search Unity

Why 1056 characters missing?

Discussion in 'UGUI & TextMesh Pro' started by RakNet, May 18, 2021.

  1. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    The Windows font 'SimSun' can correctly display my Character File in Microsoft Word as you can see in the screenshot. So I took that font, plugged it into Font Asset Creator, along with the character file but get 1056 missing characters. I don't understand why since clearly the font contains all the characters or you wouldn't see it in Microsoft Word either.

    How do I fix this?

    upload_2021-5-18_9-40-16.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The reporting of the Font Asset Creator is accurate in the sense that if it is reporting missing characters then these will indeed be missing from the font file.

    So why do they show up in MS Word? MS Word has some internal / hidden fallback where it will use another font to display those missing characters. The problem is that it doesn't alert you to this fact which leads you to believe the characters are in this font file.

    To verify all of this, post / attach at text file that contains this text for me to verify and confirm?

    P.S. SimSun is a .TTC font file which includes "NSimSun - Regular" which may include additional characters. I can confirm this when you provide me with a text file that contains all those characters.
     
    Last edited: May 18, 2021
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thank you for providing the text file.

    I converted and re-saved your text file in Unicode format which I then used as input to the Font Asset Creator and got the following results.

    upload_2021-5-18_22-15-10.png

    I used the SimSun.ttc file that I have on my Windows system.

    Since we are only trying to figure out why you are missing those characters, try using the same settings that I used to see if you get the same or different result.
     
  4. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    Thank you. I had to use Encoding / UTF8 in Notepad ++ then it worked.

    My entire game has already reference a different font for English in like 100 places. Is there a way to use Chinese font as a fallback, so I don't have to go through the whole game and reassign fonts?
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Yes. You can assign this Chinese font asset as local fallback to your primary font asset.

    This assignment could be done in the Inspector where this fallback would always be referenced or you could do it in code only when the language selection changes to Chinese.