Search Unity

TextMesh Pro Material setting not working properly after creating my own font asset.

Discussion in 'UGUI & TextMesh Pro' started by RaymingW, Nov 1, 2019.

  1. RaymingW

    RaymingW

    Joined:
    Nov 11, 2017
    Posts:
    36
    Hi,

    I've ported some font I want to use with font asset creator. The result looks great until I started using settings like an outline, Dilate.

    For example, when the outline is set to 1, the outline is so big that it engulfed the whole text. On mine, I can barely see the outline.

    When Dilate is set to -1, the text should disappear. But it barely affects the look of my font asset.

    Is there anything I'm missing when I'm creating the asset?

    Cheers!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I am traveling right now and can’t link stuff but look for the video that covers font asset creation and material preset.

    More importantly the part about the role Sampling Point Size and Padding play and specifically the Ratio of Sampling Point Size to Padding.This ratio is what determines the effective range of material properties.
     
    RaymingW likes this.
  3. RaymingW

    RaymingW

    Joined:
    Nov 11, 2017
    Posts:
    36
    Hi, Stephan!
    Thank you for the swift reply! I've been playing with the ratio of padding and Sampling point Size. The best result I can get right now is:

    Sampling:10 and padding 5

    However, the behavior of the material setting is not working as the default sample, there is still face area covered by outline when the outline is set to 1. the text itself looks funny as well.

    I tried scaling up two parameters, but the behavior of the material setting is not consistent. And some character was replaced by the default font. I tried to bump up Atlas Resolution but it didn't help much.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Sampling point size of 10 is way too small. Padding of 5 for sampling of 10 for a ratio of 50% is too large.

    A good target Sampling point size is between 72 to 100. The default is 90 for dynamic font assets. The padding should be 10% of the sampling point size or in the default case 9. So target Sampling of 90 with padding of 9.

    The atlas texture size is a function of the number of glyphs you are trying to fit in it. Typically 1024 x 1024 is good.

    See the following video about the Dynamic System. See the links to the Font Asset Creation video and Working with Material Presets in the following sticky thread.
     
    RaymingW likes this.
  5. RaymingW

    RaymingW

    Joined:
    Nov 11, 2017
    Posts:
    36
    Thank you so much for the explanation. I'll look into it after I got home.
     
  6. RaymingW

    RaymingW

    Joined:
    Nov 11, 2017
    Posts:
    36
    Hi,

    I finally got it working. I changed the render mode from SMOOTH to SDF and it worked perfectly.