Finding the Font Name
To use your font in game you need to know the name of your font. This is required for surface.CreateFont.
The font name is not a file name of that font. Your file can have any name, GMod finds the font only by its real name.
Make sure your font is .ttf, it's in your resource/fonts/
folder and it's included for downloading.
It's generally good practice to keep file paths lowercase using underscores(
_
) or hyphens(-
) for spaces, especially on Linux. Example: resource/fonts/arial_bold.ttf
Windows
- Right click on your font and click
Preview
or double click it
- In opened window find
Font name:
line
- The name goes after
Font name:
(In this example, it'sDigital-7 Mono
)
Example surface.CreateFont:
MacOS
Linux
GNOME Font Viewer
Package name: gnome-font-viewer
Open the font
Find the label at the center of the top menu (In this example, it's
Arial
, style is not a part of the font here)Additionally you can check the font name by click
Info
on the top menu and findName:
Example surface.CreateFont: