@using Sandbox;
@using Sandbox.UI;
@inherits PanelComponent
@namespace Sandbox
<style>
.test{
font-family: "Departure Mono"; /* Your font name (not the file name) */
}
</style>
<root>
<div class="test">This text will use your custom font</div>
</root>
@code
{
[Property, TextArea] public string MyStringValue { get; set; } = "Hello World!";
/// <summary>
/// the hash determines if the system should be rebuilt. If it changes, it will be rebuilt
/// </summary>
protected override int BuildHash() => System.HashCode.Combine( MyStringValue );
}
https://sbox.game/dev/doc/ui/styling-panels/style-properties
Specify a single font, based on the name of the font itself, not the filename.
Double click to install your font to open the windows font installer

Make sure your font family name is exactly the name of the Font name: line in the windows font viewer NOT THE FILE NAME
Make sure your font file is in Assets/fonts/
