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. Dismiss Notice

Bug How to use resources from default theme stylesheet? (It doesn't work in build)

Discussion in 'UI Toolkit' started by Denis-535, Aug 18, 2023.

  1. Denis-535

    Denis-535

    Joined:
    Jun 26, 2022
    Posts:
    21
    Now I write:
    -unity-font-definition: resource('NotInter-Regular');
    But it works only in the editor. When I build my project, then no one resource is loaded. Looks like it doesn't included to addressable bundles.

    I can see in default stylesheet the next code:
    --current-font: url("/Packages/com.unity.ui/PackageResources/Fonts/NotInter/NotInter-Regular.ttf");
    -unity-font-definition: env(--current-font);

    But it also doesn't work for me((

    So, what the hell? How I can use resources from standard ui toolkit package?
     
    Last edited: Aug 18, 2023
  2. Denis-535

    Denis-535

    Joined:
    Jun 26, 2022
    Posts:
    21
    Where are UI Toolkit resources stored?
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    711
    Id be surprised if /Packages/com.unity.ui/PackageResources/Fonts/NotInter/NotInter-Regular.ttf was part of your build structure..
     
  4. Denis-535

    Denis-535

    Joined:
    Jun 26, 2022
    Posts:
    21
    If I import default stylesheet then it includes default resources to my project.
    Code (CSharp):
    1. @import url("unity-theme://default")
    But I can not include those resources to my project myself.
     
    Last edited: Aug 20, 2023