S&box Wiki

Revision Difference

Fonts#544221

<cat>Code.Misc</cat>⤶ <title>Adding custom fonts</title>⤶ ⤶ To use a custom font add a new font to `addons/your-addon/fonts` where `your-addon` is the name of your addon. It can then be used in your stylesheet using `font-family: FontName`. Note that you do not include the file extension. For clarification; in this example the font would be called `FontName.ttf`.⤶ ⤶ Note: If you load your stylesheet using `StyleSheet.Load("ui/your-stylesheet.scss");` fonts do not hotload and therefore you will need to restart your game before you can use the font in your addon. Append a slash to the path to enable hotloading like this `StyleSheet.Load("/ui/your-stylesheet.scss");`