[Server Content] Downloading and activating custom font files

Hello, GMod Lua Community!

I have a question with which i’m trying to deal about half of year.

The sutiation.

I’m used to use special fonts for my work in coding.
So i have a few fonts - digital7mono and Helvetica Family. Format - ttf

The Goal

To make every client have these fonts on joining.

The Problem

Fonts couldn’t be loaded automatically.

My Ways

  1. If client will download (addon with fonts) by himself, the fonts will be loaded. (Let’s have a case without downloading manually)

  2. If i use

steamworks.Download ->

game.MountGMA it will throw an error:


Failed to load custom font file 'c:/program files (x86)/steam/steamapps/common/garrysmod/garrysmod/workshop/resource/fonts/digital7mono.ttf'

(Also error happends with other fonts, which exists in same folder)

  1. If i use

resource.AddFile nothing will be downloaded. (BUT if i add fonts in folder garrysmod/fonts it will download them, but font’s will not activate.)
3.1 The same with

resource.AddSingleFile

Info

By made addon:

fonts are in folder /resource/fonts/*

Trying by mounting on client:



steamworks.FileInfo( 949191667, function( result )
    steamworks.Download( result.fileid, true, function( name )
        game.MountGMA( name )
    end)
end)


Installing on server in garrysmod/resource/fonts by


resource.AddSingleFile("resource/fonts/digital7mono.ttf")

or


resource.AddFile("resource/fonts/digital7mono.ttf")

failed

Installing on server in garrysmod/fonts by


resource.AddSingleFile("fonts/digital7mono.ttf")

or


resource.AddFile("fonts/digital7mono.ttf")

download but not activated


I’ve tried to search topics about fonts but no solution found.

This is my question. Thanks.

Recourse? Shouldn’t it be Resources?

“resource”, actually.

The actual folder in GMod is “resource”.
In first post I wrote “resource”.

You wrote recource 3 times (2 times in code snippets) and resource - 1 time.

poor soul

Missed that. English is my second language and I had messed up c and s when typing this.

Now it’s


resource.AddSingleFile("resource/fonts/digital7mono.ttf")

I’ve tested. In download folder appears nothing.