Author Topic: Using a custom font in a defined path?  (Read 2576 times)

I was messing around with font on a server, and it made me think. Could I use custom font in a defined path cliently that I would be able to use? If I can, what would be a good example cuz I have no experience in client-sided stuff?

I'm pretty sure the only fonts Blockland can use are the ones installed in the Windows Fonts folder
Anyone correct me if I'm wrong.

Any font that is installed on the rendering client's computer should work.

I'm pretty sure the only fonts Blockland can use are the ones installed in the Windows Fonts folder
Anyone correct me if I'm wrong.
To find the fonts on your client, it's in base/client/ui/cache

To find the fonts on your client, it's in base/client/ui/cache
Note necessarily, those are only the fonts that the game tried to "convert" for game use.
e.g. for me there is a file called rockwell_25.gft which is EXACTLY the same as arial_25.gft because I don't have a font called rockwell.

does this mean we can download fonts to that folder and use them in-game then?

Wow, the .gft files contain a rendered PNG of the font...
Weird, I guess you probably can get custom fonts into the game by copying the .gft

EDIT: It can contain several PNGs depending on the size of the font, max chunked up size is 256x256
« Last Edit: September 19, 2015, 02:17:31 AM by ZSNO »

does this mean we can download fonts to that folder and use them in-game then?
Not sure, someone should try it out!

does this mean we can download fonts to that folder and use them in-game then?
Yes. But make sure you put the font in the folder before you use it! Otherwise blockland will generate a .gft that is completely useless.

You'd install the font on your computer, use them in blockland, copy the .gft file from the folder, and put it in the folder on the client that doesn't have the font.
« Last Edit: September 19, 2015, 06:23:10 AM by Zeblote »

doesnt this mean someone could spam your cache folder with thousands of random font names that dont even exist?

doesnt this mean someone could spam your cache folder with thousands of random font names that dont even exist?
Yes, and you could make it worse by doing it in the largest font size because it would render Arial at that size.

Badspot plz fix

doesnt this mean someone could spam your cache folder with thousands of random font names that dont even exist?
Maybe.
« Last Edit: September 20, 2015, 05:26:20 AM by Zeblote »

Yea, just tested <font:asdf:20> and it created a cache font in my folder.

Yes. But make sure you put the font in the folder before you use it! Otherwise blockland will generate a .gft that is completely useless.

You'd install the font on your computer, use them in blockland, copy the .gft file from the folder, and put it in the folder on the client that doesn't have the font.
To find the fonts on your client, it's in base/client/ui/cache

Ok, so, all I would need to do is put the custom font in that path?

Ok, so, all I would need to do is put the custom font in that path?
Yeah.

If you want it to all be done by an add-on you could probably download the font with a TCPObject and save it to the path, fileCopy doesn't work from zip files.