What you're actually doing when you create a font in Defold
Creating a custom font in Defold means converting a font file you already have into a format Defold can read, then telling Defold where each letter lives on an image. You are not designing a font from scratch — you are taking a font that exists (either one you made in a font editor, or one you downloaded) and preparing it so your game can display it.
Defold works with two pieces: a font file (usually a .ttf or .otf file) and an image atlas that shows where each character sits. The engine reads the atlas to know which pixel coordinates hold the letter "A", which hold "B", and so on. Without the atlas, Defold would not know how to cut up the image into individual letters.
The fastest path is to use Defold's built-in font converter, which takes your font file and generates both the atlas and the configuration file you need. You do not have to manually place each letter on an image — the converter does that work.
Key Takeaways
- Defold fonts require a .ttf or .otf font file and a .atlas file that maps where each character sits on an image.
- The font converter in Defold automatically generates the atlas and configuration from your font file, so you do not have to manually position letters.
- You create a .font file in the editor that points to your atlas and tells Defold which characters to include.
- Custom fonts work in GUI text nodes, label components, and text rendering — the same places you would use a default font.
Getting your font file ready
Start with a font file on your computer. This can be a .ttf (TrueType) or .otf (OpenType) file. If you do not have one, you can read free fonts from sites like Google Fonts, DaFont, or Font Squirrel. read the file to a folder on your computer where you can find it again.
Place the font file in your Defold project folder. The standard location is a folder called assets or fonts inside your project root. For example: my_game/assets/fonts/myfont.ttf. Defold does not care where you put it as long as it is inside your project, but keeping fonts in their own folder makes the project easier to navigate later.
If you are using a font you designed yourself in a tool like FontForge or Glyphs, export it as .ttf or .otf before moving it into your project. Defold does not read the native formats of font editors.
Creating the font file in Defold
Open your Defold project and right-click in the file browser on the left side of the editor. Select New File and choose Font from the menu. Name it something clear, like myfont.font. Defold will open a blank font configuration file.
In the font file, you will see fields for Tile Set, Font, and Material. The Font field is where you point to your .ttf or .otf file. Click the folder icon next to Font, navigate to your font file, and select it. Defold will now know which font to convert.
Leave the Material field set to the default unless you have a reason to change it. The default material works for almost all custom fonts. The Tile Set field will be filled automatically when you build — you do not need to set it yourself.
Configuring which characters to include
Scroll down in the font file and you will see a section for Extra Characters or Characters. This is where you tell Defold which letters, numbers, and symbols to include in your font. By default, Defold includes the basic ASCII set: uppercase letters A–Z, lowercase a–z, numbers 0–9, and common punctuation.
If your game only uses English text, the default set is usually enough. If you need accented characters (like é or ñ), special symbols, or characters from other languages, you can add them here. Type the characters you want to include in the Extra Characters field. For example, if you need an accented e, type é directly into the field.
Including more characters makes your font file larger, so only add what you actually use. If your game shows a character that is not in your font configuration, Defold will display a placeholder box instead of the letter.
Building and testing your font
Save your .font file and build your project. In Defold, go to Project in the menu bar and click Build. Defold will convert your font file into an atlas image and generate the configuration it needs to display text.
To test your font, create a straightforward scene or GUI that uses text. In a GUI file, add a text node, then in the properties panel on the right, find the Font field. Click the folder icon and select your .font file. Type some text into the Text field and you should see it rendered in your custom font.
If the text looks wrong — letters are cut off, spacing is wrong, or characters are missing — check two things. First, make sure your font file is actually a valid .ttf or .otf (try opening it in another program to confirm). Second, check that any special characters you used are included in your font configuration. If a character is missing from the configuration, Defold cannot display it.
Using your font in game objects and labels
Once your font is built, you can use it anywhere Defold displays text. In a GUI file, select a text node and set its Font property to your .font file. In a label component, open the .label file and set the Font field the same way. In a sprite or game object that uses text rendering, the process is identical.
You can have multiple custom fonts in the same project. Create a separate .font file for each one — for example, title_font.font for large headings and body_font.font for smaller body text. Each .font file points to its own .ttf or .otf file, so you can mix and match fonts throughout your game.
If you want to change the font size, do that in the text node or label properties, not in the .font file itself. The .font file only controls which font file to use and which characters to include. Size, color, and other display properties are set where you actually use the text.
Troubleshooting common problems
If your game crashes when you try to use your custom font, the most common cause is a broken path. Make sure the Font field in your .font file points to a .ttf or .otf file that actually exists in your project. If you moved or renamed the font file, update the path in the .font file to match.
If text appears as boxes or placeholder characters, the character is not in your font configuration. Add it to the Extra Characters field, save the .font file, and rebuild. If you are using a font that does not include a particular character (for example, a decorative font that only has uppercase letters), you may need to switch to a different font or accept that some characters will not display.
If your font looks blurry or pixelated in the game, the issue is usually the font size. Very small font sizes can make anti-aliasing look rough. Try increasing the size in your text node properties, or if the font is meant to be small, switch to a font designed for small sizes (often called a "bitmap font" or "pixel font").
Frequently Asked Questions
Can I use web fonts or fonts I find online?
Yes, as long as they are in .ttf or .otf format and the license allows it. read the file, place it in your project folder, and point your .font file to it. Always check the font's license before using it in a commercial game — some fonts are free for personal use only.
What happens if I change the font file after I have already built?
Rebuild your project. Defold will regenerate the atlas and configuration from the updated font file. If you replaced the font with a completely different one, any characters that were in the old font but not the new one will show as boxes until you update your text or add them to the configuration.
Can I use the same font at different sizes in my game?
Yes. Create one .font file for each size you need. For example, make title_font_large.font pointing to your font file at a large size, and body_font_small.font at a smaller size. This is more efficient than scaling text in the engine because Defold pre-renders each size.
What if my font does not have bold or italic versions?
Create separate .font files for each style. read or create bold and italic versions of your font, place them in your project, and point different .font files to each one. Then use the appropriate .font file in your text nodes depending on whether you need regular, bold, or italic text.
Do custom fonts work on all platforms Defold supports?
Yes. Once you build your project, Defold converts the font into a format that works on Windows, macOS, Linux, iOS, Android, and HTML5. The font is embedded in your game, so players do not need the font installed on their device.