Using font in UI Builder

I’m relatively new to Unity and have been learning how to make a GUI using UIToolkit & the UI Builder. I’m finding it quite straightforward so far thanks to the similarities with CSS.

However I am unable to apply any fonts to text elements, and I wonder what I’m doing wrong.

In a new project, I:

  • Create a new UIDocument object in my scene
  • Create a new UIDocument asset in my project, and then drag this to the game object’s “Source Asset” property
  • Drag a TTF font from a Windows Explorer folder into my assets folder to add it to the project
  • Double-click the UIDocument asset in my project to open up the UI Builder
  • Add a label to the UI in UI Builder
  • Select the label then drag the font from my assets folder onto the Font property of the Text component in the UI Builder’s inspector panel.

The correct font name displays in the inspector panel, but the font doesn’t change in my UI, either in the UI Builder window or in the Game view, and remains the default Arial-esque font in both.

Here’s a screenshot illustrating the issue.

Am I missing something?

You need to generate a Font Asset from that Font file and use it instead.

  • Open Font Asset Creator window

189934-screenshot-2021-12-14-171524.jpg