Fonts

Fonts are located in the fonts directory in the base asset folder. They're stored as Walgelijk Fonts, or "wf" files. These are technically just zip files with an MSDF bitmap font in them. The included fonts are Oxanium, Toxigenesis, and Impact, and only support extended ASCII.

Custom fonts

You need to use Walgelijk.FontGenerator (wfont), installable as a dotnet tool:

dotnet tool install Walgelijk.FontGenerator -g

After this, in a terminal, navigate to a folder containing your font files (otf/ttf). Then run wfont without any parameters. Wait for a while, and you'll find a .wf file has been generated for each font file in the folder.

If you want to include characters outside the standard charset, you need to create a charset file (charset.txt) in this folder. This is a text file with every character you would like to be included in the font. Instead of passing no parameters, you run wfont --charset "charset.txt" to include the charset. Make sure the font files you're using support all characters in this set.

Drag these wf files into your mod asset folder and use them like this:

// provide path to your font inside your mod asset folder
var font = Asset.Load<Font>("fonts/papyrus.wf"); 
Draw.Font = font;
Draw.Text("Hello everyone!", Window.Size * 0.5f, Vector2.One);