+1 vote

This is either trivially easy or not possible, and I can't tell which after tracking down about a dozen Q&A posts here, GitHub issues, or other random google sources. (Sorry for the tone of exasperation...)

If it matters, I'm working on a Button. One answer I saw was to change rect_scale. This DOES change the font size in the editor, but does NOT change font size in my running game. I can tell by print(my_button.rect_scale) that my change "sticks". Other threads offer other solutions but these all seem to involve custom fonts even when the question was "without loading custom fonts".

I realize I may want a custom font someday. But I'm just prototyping ideas now.

If the answer really is "not possible", I would greatly appreciate a tip on where to find one without entering the malware storm that threatens when I google "free font".

in Engine by (103 points)
edited by

3 Answers

0 votes

In answer to the second part of your question, I use Google Fonts - free and no malware


by (138 points)
+3 votes

It is not currently possible to change the size of a font without importing a custom font. However, it is easy to import custom fonts by creating one or several DynamicFont resources which can load TTF or OTF font files into them – the only prerequisite is to drop a font file into the project folder.

Many websites distribute open source fonts that can be freely used in personal and commercial projects, such as Google Fonts or Font Library (which offers hundreds of fonts that are not provided by Google Fonts).

For information, the default fonts used in Godot are:

  • in Godot 3.0: Noto Sans in the editor, Droid Sans in projects, Hack in the script editor,
  • in Godot 2.1: Droid Sans in the editor and projects, Source Code Pro in the script editor.
by (10,261 points)

Thanks! I have my answer now!

0 votes

I know, 3 years late but still for a quick (kind of hacky solution) for anyone in the future looking up this thread. if you only need this for buttons you might just use images instead.

by (251 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 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.