+16 votes

I have tried to find an explanation on how to do this but can't find one anywhere and have not managed to figure it out myself. Previously, I imported the fonts at a particular size for a TTF font. However, that doesn't seem to be an option in Godot 3.0.

Thanks in advance for the explanation.

in Engine by (293 points)

3 Answers

+30 votes
Best answer

1) Copy your TTF into your project folder
2) You will see Godot import it as a DynamicFontData in the file browser
3) In the inspector click on the "new resource" icon and create a new DynamicFont.
4) In the Font category, click on Font data and choose your TTF
5) Save the DynamicFont under the name you want (optional)
6) You can now use this dynamic font where you want, change its size, spacing etc (without altering the original font).

by (28,833 points)
selected by

Note that the default size when you create a DynamicFont is 0, so your text is just a few dots if you don't set the size!

wow, thanks for that extra comment about the default size - that was driving me bonkers!

Note that since Godot 3.1, the default font size is now 16 so you no longer have to set it manually.

+3 votes

I don't know how you would do this with a BitmapFont, but for a dynamic font:

  1. Add a .ttf file to your project, and godot will classify it as DynamicFontData
  2. Create a new DynamicFont (from the inspector), and edit it
  3. Under the "Font" subcategory, assign the ttf file you previously copied
by (25 points)
0 votes
var dynamic_font = DynamicFont.new()
dynamic_font.font_data = load(font_path)

var label = RichTextLabel.new()
label.bbcode_enabled = true
label.set("custom_fonts/normal_font", font)
by (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.