Skip to content

Commit

Permalink
Add a page on using fonts in Godot
Browse files Browse the repository at this point in the history
  • Loading branch information
skyace65 committed Aug 24, 2021
1 parent 3f8a6bf commit 116c565
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tutorials/ui/gui_using_fonts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _doc_gui_using_fonts:

Using Fonts
===========

Godot allows you to set specific fonts for different UI nodes.

There are 3 places you can setup font usage. The first is the
theme editor. choose the node you want to set the font for
and select the font tab. The second is in the inspector for
control nodes under **Theme Overrides > Fonts**. And lastly in
the inspector settings for themes under **Default Font**

Regardless of where you are creating the font the process is
the same. Click on the font setting you want to add a font to
and a dropdown will appear with two choices **New Bitmap Font**
and **New Dynamic Font**.

.. image:: img/new_font.png

If you have a bitmap font file (.fnt) do not select New Bitmap
Font. Instead, drag the file from the file system panel to the
font slot. Selecting the font after adding it to the font slot
gives you 3 settings that can be changed. Height, ascent and
Distance Field. Distance field fonts were never reimplemented
for Godot 3.0 and do not work.

If you are using a true type font file (.ttf) select **New Dynamic
Font**. From here select **Font** and drag your .ttf file to the
Font Data slot. The dynamic font resource is now using the font
you selected.

There are several options you can adjust. **Extra Spacing** options
control the spacing of characters. **Settings** control the general
settings of the font.

.. image:: img/dynamic_font_options.png

If you want to use the same font again but with different settings,
such as a larger size or an outline, create another dynamic font
resource, add the same .ttf file, and make the adjustments that you
want.
Binary file added tutorials/ui/img/dynamic_font_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutorials/ui/img/new_font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tutorials/ui/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ explain the benefits of that system and how to set it up in your projects.

gui_skinning
gui_using_theme_editor
gui_using_fonts

Control node tutorials
----------------------
Expand Down

0 comments on commit 116c565

Please sign in to comment.