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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

2021.2 - new font properties

Discussion in 'UI Toolkit' started by jnhackleman_unity, Nov 2, 2021.

  1. jnhackleman_unity

    jnhackleman_unity

    Joined:
    Sep 16, 2021
    Posts:
    20
    I was excited to see the new font properties supported in the ui builder, but when I use them I get results like the following:


    (https://i.gyazo.com/fd09f0fb7c1d4d998d2fb1400b54e71b.png)

    Here it is zoomed in:


    (https://i.gyazo.com/921e5e8100b9117e67efdc0d59aeff76.png)

    The outline width is kind of all over the place. IT's not 1px. It's also not anti aliased or anythying.
    The text "blur-radius" doesn't seem to blur at all either.

    Am I missing some settings?

    Also - what is a the "Font" versus "Font Asset" ?

    "Font Asset": is not referenced in the documentation here: https://docs.unity3d.com/2021.2/Documentation/Manual/UIE-USS-Properties-Reference.html


    Thanks
     
    HugoBD-Unity likes this.
  2. sebastiend-unity

    sebastiend-unity

    Unity Technologies

    Joined:
    Nov 9, 2015
    Posts:
    184
    Hi, I am trying to repro with 2021.2.1f1 but I am not able to. I get something cleaner with the appropriate results:

    upload_2021-11-8_9-42-14.png

    Can you tell me what is your current workflow? Editor version, packages installed, Uxml and Uss contents. Thanks!
     
  3. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    443
    Hi @jnhackleman_unity !

    Our current goal text-wise for UI Toolkit is to achieve feature parity with TextMeshPro (the current text engine of UGUI). I know we are desperately lacking documentation on the UITK text features, but in the meantime, a lot of the existing TMP documentation is applicable. For instance, here's some documentation on FontAssets. This post may also be of interest.

    Now regarding your issue. Behind the scene, Fonts are dynamically converted to FontAssets with settings that match most use cases. Which is small to medium font size and a medium rendering quality to ensure characters can quickly be rasterized. For big font sizes and special use cases ( such as Pixel Perfect...) it is recommended to create a FontAsset. FontAsset can be assigned through the `-unity-font-definition` USS property. In your use case, you may want to increase the sampling point size and use a higher quality atlas rendering mode.

    Sorry for the lack of documentation. We are working hard to improve the situation.
    I hope this helps.
     

    Attached Files:

  4. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    443
    Hi @jnhackleman_unity !

    Could you share your project ? I'm having much better results than you when testing locally.
     
  5. jnhackleman_unity

    jnhackleman_unity

    Joined:
    Sep 16, 2021
    Posts:
    20
    Hi,
    I've been playing with the Text Asset creator, and the panel settings and what not and have managed to make it a bit better looking.

    However, I did find that the opacity of the outline, and the shadow are not respected when I set the opacity on the containing element via code, or even a parent element. The outlines remain visible.
    I have submitted a bug: 1379601

    See: https://gyazo.com/2a32ca6aede95bc1d0cb64fd3d2f867b
     
    HugoBD-Unity likes this.
  6. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    443
  7. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    443
    Hi @jnhackleman_unity, I opened your project, but I have much better results rendering-wise. Do you have other ideas on how we could replicate this locally?

    Also, we'll have a look at the opacity issue shortly.
     

    Attached Files:

    Last edited: Nov 16, 2021