surface.CreateFont

Are you able to create a font from .fnt or .tff files?
I’d like to use the razer one but i’m not sure if it’s possible.

Yes you can. But you should first create it using surface.CreateFont

Ok, so how would it be setup?



surface.CreateFont( "CustomFontNameGoesHere", {
	font = "FONTFILENAMEGOESHERE",
	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,
} )


Small note: DO NOT put CreateFont call into a HUDPaint hook or Think hook or whatever hook that runs a lot.

Yeah mijyuoon thanks for the helpful advice for him :slight_smile:

that crashed my game cause fonts are static :frown:

So…



surface.CreateFont( "Razer", {
	font = "razer_regular",
	size = 24,
	weight = 500,
	blursize = 0,
	scanlines = 0,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = false,
	outline = false,
} )


Where it’s used



draw.DrawText(DarkRP.formatMoney(GetMoney),"Razer",ScrW()-ScrW()/1.15,ScrH()-ScrH()/5,Color(0,255,0,255),2)


And for some reason it doesn’t use the actual font i put in, it’s in both the servers resource/font folder and my game folder…

Are you sure you’re supplying font NAME to CreateFont function? It must be the font NAME and not the file name, you can get font name by opening the font in windows font viewer.