Adding Custom Fonts - rbjaxter/budhud GitHub Wiki

Prerequisites

  • A font of your choice
  • A decent amount of HUD experience
  • Notepad or Notepad++ (Notepad++ preferred)

Please note, this will replace the default HUD's font everywhere it is used. Though this process is actually really easy once you've done it once or twice, it does still have a lengthy initial explanation.

In addition to this, finding fonts that have both good numbers as well as letters can be quite tricky, so be sure to look at both when selecting a new font!

Important Directories

The following are the three main directories and/or files you'll need to be concerned with:

  1. ../budhud/resource/fonts - Contains the actual font file
  2. ../budhud/resource/clientscheme.res - Points to the custom font definition file
  3. ../budhud/_budhud/resource/clientscheme_fontentries.res - Defines and loads the custom font file
  4. ../budhud/_budhud/resource/clientscheme_lato.res - Defines the font definitions

Steps

For this example, I'll be adding a font called Product Sans.

  1. Place your font file (.ttf or .otf) in ../budhud/resource/fonts.

  2. Right click the font and go to properties. Then, swap over to the Details tab and note the Title. The title may not always match the name of the font exactly, so it's important to check this.

Figure 1

  1. Navigate to ../budhud/resource/clientscheme.res and open the file.

  2. Comment out #base "../budhud/_budhud/resource/clientscheme_lato.res". Then, add a new line below it containing #base "bh_product_sans.res". This can be named whatever you want; it'll just need to match the name you will use for the file in Step 6.

  3. Navigate to ../budhud/_budhud/resource/clientscheme_fontentries.res and open the file.

  4. Scroll to the bottom of the file and add a new entry as shown in the image below. For the "name" field, use the name you found in the Details tab of the font in step 2. For the number, just increment the last value used by one.

Figure 3

  1. Navigate to ../_budhud/resource and duplicate the file clientscheme_lato.res. Rename your new file to whatever name you used in Step 4. In this case, we'll be renaming ours to bh_product_sans.res.

  2. Open your new file. Assuming you have Notepad++ or VSCode installed, hit CTRL + F on Windows to open up the Find window. Next, switch to the Replace tab. Under Find what:, set it to "Lato Semibold". Under Replace with:, set it to the name you found in the Details tab of the font in step 2 and hit Replace All.

Figure 4

The HUD should now work properly with the new font.

Troubleshooting

Problem: My screen is white.

Solution: In your modified clientscheme, verify that there isn't a space between the # and base in #base.

  • Correct: #base "fonts/bh_lato.res"
  • Incorrect: # base "fonts/bh_lato.res"

YouTube Tutorial - Outdated, last updated 4/14/19