Hi, is there a way to use a custom font in a game so that it works even if the person playing the game doesn't have that font installed on their computer? Thanks.
Custom font
● ARCHIVED · READ-ONLY
-
-
I'm pretty sure you have to have a copy of the font packaged with the game.Hi, is there a way to use a custom font in a game so that it works even if the person playing the game doesn't have that font installed on their computer? Thanks.
-
You'll need to create a folder named "Fonts" with the custom font inside. This will allow the game to draw from the folder without any installation needed on the player's part. You will also need to change the font in game as well via a script snippet somewhere above Main :Hi, is there a way to use a custom font in a game so that it works even if the person playing the game doesn't have that font installed on their computer? Thanks.
Font.default_name = ["CustomFontName"]
Font.default_size = Number Where Number is a positive integer
@ Iron Croc Yes

I believe you need the brackets though. I could be mistaken. -
Kinda like this?You'll need to create a folder named "Fonts" with the custom font inside. This will allow the game to draw from the folder without any installation needed on the player's part. You will also need to change the font in game as well via a script snippet somewhere above Main :
Font.default_name = ["CustomFontName"]
Font.default_size = Number Where Number is a positive integer
Code:Font.default_name = "Font Name"Font.default_size = 28 -
I already did that. I had a folder called Fonts with the correct font there, and the Main script was properly modified. But still people are having problems with the font if it's not installed to their computers.
-
-
If it were properly modified, then it would work - if it doesn't work, then it's not properly modified.the Main script was properly modified.
The most commonly error is that a lot of people place the font's filename into the script - but as the poster above stated, it needs the font name, NOT the font filename... -
Ah, that makes sense. How about when copying a font file creates several separate files? For example in my game I copied a font and it actually produced a whole set of different font files. How should I rename the rest? Do I only need the main one?
-
you never rename fontfiles - why do you ask?
And the fonts with multiple files are exactly why you need to use the font name and not the filename
Which one you need depends on which exact font variant you want - if you open the font files in a font viewer, you'll see that they have different font names. -
That's exactly what I did. I had the font name in the script, not the file name. Even so, I still encounter the problem.
-
show us how you typed the font name and link us to the font file, then we can check what you made wrong.
-
I don't know how to link to a font file. The font I used was Bradley Hand ITC, and that's the name in the Main script I used. The filename is ITCBLKAD and it involves many other seemingly unimportant files that were transferred with it.
-
You need to upload the font file somewhere if you don't have any link ready from where you got the font, and then provide a link to it.
And I asked you to tell us how exactly you wrote the line in the script, like this:
Code:Spaces, capitalisation, where you placed the " - all that can be the error, and because of that we need the exact code you used, down to the last letter, and not you simply telling us what you guess how you wrote that line...Font.default_name = "Font Name" -
-
somehow you mixed up your fontfiles, because when I opened that fontfile ITCBLKAD.TTF that you linked, I got a font named "Blackadder ITC".
Please check for the correct font file, you need not only have the correct name for the font, it also needs to have the file with that fontname in the project font directory... -
Sorry, I made a mistake. Here is the right font.
-
Sorry, I didn't realized it beforeWhere do the brackets come from?This is my code: Font.default_name = ["Bradley Hand ITC"]
all the posters above told you to use a command like
Font.default_name = "Bradley Hand ITC"No one ever told you to place that in brackets...Check if it works if you remove the brackets -
Wrong. Not all posters said that! But yeah, omit the square brackets. It won't make a real difference here. (The reason that they can be used here is actually a misfeature which is documented in the help file, if anyone cares.)
Here's a sample project. It works on my computer and I don't see a reason why it shouldn't on yours, too. Please check it.

