For your case, instead of using an environmental variable, I suggest you just specify the full font path name, like:
Note that the path name is a file system path name. It is not a URL. The leading slash '/' refers to the root of the hard disk, not the root of the web document directory. If it is a relative path (like "lib/font/..."), it is relative to the current working directory, which may not be the current URL directory or the current directory of the script.
To avoid confusion, I suggest to use the full absolute path name. You can include code to detect the full path name of your project, then append "lib/font/BlackoakStd.otf" to the path.