Font into a gamemode?

Hey guys, Stupid question but Im making a gamemode but do not know how to add a font to the gamemode, Any ideas? Thanks

  1. Create “content” folder in your gamemode’s directory (gamemodes/MyGM).
  2. Create “resource” in it.
  3. Create “fonts” in this.
  4. Place your font file (e.g. “webdings.ttf”) in “fonts”.
  5. Don’t forget to create surface equivalent:

surface.CreateFont("Webdings", {font = "webdings", size = 20})

Thankyou so much <3, Will you marry me?

[editline]20th February 2015[/editline]

This did not acctually work

surface.CreateFont("VisleRPFontNot", {
	font = "vislerp", 
	size = 13, 
	weight = 500, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 

When ever I use the font it is just the defualt font :frowning: You know why?

If i recall, you have to call resource.AddFile or something to do with that.

I cant remember the library

Hmm, I tought just adding it to fastDL would work, Got any infomation on how I would do that?

As I said, i cant remeber much, But I know you have to load the font first, before you remake it with surface.CreateFont

I could be wrong.

I Will look it up but does anyone else have any suggestions?

OK, try to add resource, as Exploderguy suggested:


It’s a shared method. So, you’re making gamemode - you needed to do it serverside to force resource to be loaded to client.

Could I just do this in the sever side file of my gamemode?

[editline]20th February 2015[/editline]


Did not work, Still using the defualt dont and I dont know why :suicide:

Make sure you have typed right name of font. It works like a sharm for me also without resource.Add*.

surface.CreateFont("MyFont", {font = "SplinterWood", size = 24})

File “SplinterWood.ttf” is situated in gamemodes/MyGM/content/resource/fonts, works fine.

Hm… Yep, it’s very strange. :pwn:

The font name is correct, COuld you double type the name of the content folder directory, But imsure everything is right

[editline]20th February 2015[/editline]

I Have restarted multiple times, Here is the code I used to draw it


The font creation code

surface.CreateFont("VisleRPFontNot", {
	font = "vislerp", 
	size = 13, 

And directory of the font


oop… (wrong answer)

Yeh i know, But its correct, Trust me, i copy and pasted the font name

Can you please share your gamemode?

Which part, Or all of it?

This is the part that acctually draws the text(Ignor the messy code, Its mainly just proto

local _notifications = {}

local _types = {"error","info","other"}

surface.CreateFont("VisleRPFontNot", {
	font = "vislerp", 
	size = 13, 

local erroricon = Material( "icon16/exclamation.png", "smooth" )
local infoicon = Material( "icon16/star.png", "smooth" )
local othericon = Material( "icon16/check_on.png", "smooth" )

local _icons = {erroricon,infoicon,othericon}

local function drawNotifications()

	if(table.Count(_notifications)>0) then
		local pos = ScrH()-( ScrH()/4)

		for k,v in pairs(table.Reverse(_notifications)) do
			local size = surface.GetTextSize(v.text)

			if(v.isRemoving==true) then
				v.localXPos = v.localXPos+(150*FrameTime())

				v.localXPos = v.localXPos - (600*FrameTime())

					v.isEntering = false




			surface.SetMaterial( v.icon )

			pos = pos - 45





I Just saw what I did, Im a dumbass, Slap me silly with all them dumbs, But thanks for you help

The name of the font is in the black circle.

I do this in my init.lua file for my gamemodes:


I think you’re trying to give the full directory of the gamemode resource when it’s already by default getting content from the gamemode; in other words you’re making it go to a directory that doesn’t exist.

I could be wrong but I’m fairly certain I’m not because the above method works fine for me on both my client and on my servers.

It’s not the name of the file that matters, it’s the actual name of the font in font viewer.

No I was replying to the guy who was pointing out a different name within the custom font structure not your reply; I was making my reply when you made yours haha.

surface.CreateFont(“VisleRPFontNot”, {
font = “vislerp”,
size = 13,
Will look for a font with the name “vislerp”. However this:
surface.CreateFont(“VisleRPFontNot”, {
font = “Roboto Cn”,
size = 13,
Will load roboto from your fonts folder.

[editline]20th February 2015[/editline]

Oh, lol