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

Question UI Toolkit Fonts, not allowing me to switch to a font in packages or any built in fonts

Discussion in 'UI Toolkit' started by unity_064C3DA77F549DEDE5E8, Jan 17, 2023.

  1. unity_064C3DA77F549DEDE5E8

    unity_064C3DA77F549DEDE5E8

    Joined:
    Jun 28, 2022
    Posts:
    2
    I have a custom editor window that I want to use mono space font in, but I can't reference any built in fonts or fonts from inside Packages, I've only been able to get it to work with custom fonts from within the Assets folder.

    Here's the stylesheet code example:
    Code (CSharp):
    1.  
    2. .monospace-font Label{
    3. unity-font: resource("Assets/SpaceMono-Regular.ttf");
    4. -unity-font-definition: resource("Assets/SpaceMono-RegularSDF.asset");
    5. }
    What I would like is to be able to point it to a file inside Packages or to use the built in unity fonts.
     
  2. jamie_xr

    jamie_xr

    Joined:
    Feb 28, 2020
    Posts:
    62
    Bump. This is actually really important and needs to work correctly
     
  3. Toby-XRG

    Toby-XRG

    Joined:
    Feb 20, 2023
    Posts:
    1
  4. unity_064C3DA77F549DEDE5E8

    unity_064C3DA77F549DEDE5E8

    Joined:
    Jun 28, 2022
    Posts:
    2