Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

TextMesh Pro Chinese Traditional, Simplified and English text looks blurred

Discussion in 'UGUI & TextMesh Pro' started by climber91, Dec 5, 2018.

  1. climber91

    climber91

    Joined:
    Nov 6, 2017
    Posts:
    3
    Hi,

    I'm trying to make Chinese Traditional, Simplified and English characters look sharp at the same time. I'm using NotoSansCJKtc-Bold and NotoSansCJKtc-Regular font, as bold and normal text (also no other font seems to all character sets).

    Character Hex range:
    0020-007E,02B0-038F,02C0-0320,0550-05C0,2160-217F,2E80-2FDF,3020-31FF,3400-4DBF,4E00-9FEF,AC00-D7AF

    Problems:
    1. No other font seems to have all character sets, which I want to include. Yes, the range is too big. Do you know any other font, do suggest
    2. Atlas with 8192 results in filled box letters, so somehow I have to use 4096 resolution for the atlas which can't include all the letters from the specified range
    3. Packing method 'optimum' don't work on such big resolution even I spent nights to let it generate, with no success
    My results:

    Screen Shot 2018-12-05 at 12.35.49 PM.png

    TextMeshPro-Font Settings.png

    With same font style
    TextMeshPro-Test.png

    Thanks very much in advance for any help!
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Take a look at this post which describes the strategy for splitting all these characters into a Primary Font Asset with a few fallbacks thus allowing you to have small atlas textures and higher sampling point size.

    For CJK characters, try to aim for about 32 to 48 sampling point size with padding value of about 10% of sampling point size. Ie. if the sampling is 40 then padding of 4.

    In terms of the blurriness, make sure the softness value is set to zero in the Face section of the material inspector.

    The blurriness could also be cause be incorrect scaling / non uniform scale on the text object. For testing scale should be (1, 1, 1).

    If you are using a CanvasScaler with Canvas in Screen Space - Camera or World Space that you do have a camera assigned to it.

    Rest assured the text should be clean and sharp so we just need to figure what is causing this in this case.
     
  3. climber91

    climber91

    Joined:
    Nov 6, 2017
    Posts:
    3
    Thanks for the link.
    Just a confirmation, do I duplicate the same font and split character set between them and at the end, I add them in TMP Settings as fallback font assets, right? Like i did in the following image
    Screen Shot 2018-12-05 at 6.01.43 PM.png

    The material used is default created by Font Asset generator which is TextMeshPro/Bitmap and it doesn't have softness in its Face section.

    Yes, I'm not using any scale, it is (1, 1, 1).

    Yes, I'm using CanvasScaler with Canvas in Screen Space - Overlay.

    Font property is Dynamic and in Unity Text component it is clean and sharp which I suppose that after creating Font asset properly it will be clean and sharp too


    Also, do you know any font which has all the Chinese character set? As my current font miss the Chinese punctuation like Chinese full-stop, Chinese comma etc. when generated from the Font Asset Creator.
     
    Last edited: Dec 5, 2018
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    You select the same font in the Font Asset Creator and create one primary font asset that will contain all the known / used Chinese characters in the project. Then you create additional font assets (from the same selected) font file and include the rest of the Chinese characters from the Table of General Standard Chinese characters. Basically, you are splitting the characters from the same font file between several font assets.

    These fallbacks can be assigned to the primary font asset or to the general fallback list in the TMP Settings. Since these fallbacks are all created from the same font file, it makes sense to assign them to the primary font asset. By contrast if you want to be able to access icons and symbols with any font asset, it makes sense to assign that one to the TMP Settings so that all font asset can use it.

    Any reason you are using bitmap font instead of Signed Distance Field?

    I didn't pick up on the fact you were using bitmap. In order for bitmap text to render correctly, the glyphs need to be displayed at 1:1. So if the sampling point size is 19 then in order to render correctly, it has to be displayed at 19 points. Otherwise, scaling happens which will make it look fuzzy or harsher depending on whether you are below or above the sampling.

    When a font is set to dynamic, each glyph is rendered and added into the atlas texture for each of the point sizes used.

    Here is an example of this font sampled at 24 points and displayed at 24 points for the bitmap versions and then one that is SDF. The image shows the text at 5x and 1:1 zoom so you can compare them all.

    upload_2018-12-5_15-24-30.png

    BTW: One of the benefits of using SDF is that we only need to sample the glyph once for any point size and resolution. This allows us to save texture space but also provide all the benefits of being able to add outline / shadows, etc. still we great performance.

    I would have assumed that Google's fonts designated for CJK would include all the relevant glyphs.

    Having said that, one of the nice things about the fallback system is that you can find some other font that has those glyphs and create a small fallback font asset that only contains those glyphs and then assign it as a fallback to the primary that is missing those glyph. Provided the alternative font file has similar glyph design it should work nicely.
     
    Last edited: Dec 5, 2018
  5. climber91

    climber91

    Joined:
    Nov 6, 2017
    Posts:
    3
    No, Hex value: 2B0-35C and continue, as the report is truncated where the missing Chinese punctuation resides.

    Kindly can you tell exactly where is the path to TextMesh Pro/Glyph Report.txt (on mac)
    Screen Shot 2018-12-06 at 10.57.31 AM.png
    As I have searched in the project, directory and over the internet, couldn't find it.
     
    Last edited: Dec 6, 2018
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Using an external font view like BMFonts or High-Logic Font Creator, you can see the font file is missing many characters in the 2B0-2FF range. Same is true for the other ranges. The red arrows show the 2B0 - 2FF range.

    upload_2018-12-5_20-13-30.png

    The file is saved at "Assets/TextMesh Pro/Glyph Report.txt" and deleted when the Font Asset Creator is closed.