Custom Fonts

How do you add a custom font you have downloaded to a derma label, any help would be appreciated


But first I think you have to create the font by doing


Also, you might want to do

resource.AddFile to send the font to other clients so it actually exists on their side

[editline]3rd March 2016[/editline]


-- serverside
resource.AddFile( 'resource/fonts/somefont.ttf' )

-- clientside
surface.CreateFont( "YourFont", {
	font = "somefont", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
	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,
} )

somelabel:SetFont( "YourFont" )

[editline]3rd March 2016[/editline]

I usually put fonts I want to work in GMod in

C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\resource\fonts

I think it works without doing that though

thanks it worked but players joining cant see it, ive tried putting

resource.AddFile( ‘myfont’ )

in both client-side files and serverside files but nothing works.
players that have installed the file directly from its origin can see it but not those who haven’t.
does the font have to be ttf? any help with this would be greatly appreciated

Players joining? Is this for a loading screen or something?

No, its a derma panel but when players have joined the game and haven’t download the font from google, they cant see it

I think you used AddFile wrong. Copy-paste the whole code here in [lua] tags.