> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/bitmap-font-generator-.fnt.md).

# Bitmap font generator (.fnt)

## Introduction

Gum renders rasterized fonts using `.fnt` and `.png` files in the BMFont format. Gum bakes these files automatically using the project's configured **Font Generator** — either KernSmith (the default for new projects) or BMFont. See [Font Generator](/gum/gum-tool/settings-window/fonts.md#font-generator) for the differences between the two and how to switch.

This page describes the `.fnt` file format itself and how to author one by hand. Manually creating `.fnt` files allows for customization beyond what either generator produces from the Gum tool.

If you want to hand-author a font, the original [Bitmap font generator](https://angelcode.com/products/bmfont/) (BMFont, Windows-only) is the tool the format was designed around and remains a good choice. The steps below describe its UI.

## Creating a .fnt file

Each font file is represented by a single .fnt file. When a .fnt is created, it creates one or more accompanying .png files, also known as *pages*.

To create a font:

1. Open Bitmap font generator
2. Select Options -> Font Settings
3. Change your settings to the desired values - these values will be discussed later in this document. If you would like your exported font sizes to match Gum, be sure to check **Match char height**
4. Click OK to apply the changes
5. Select which characters to include in your font - notice that by default they are unchecked so your font will not include any characters
6. Select Options->Export Options to
7. Select a Bit depth of 32
8. Select the texture width and height. For best performance, select a size which will contain all of the characters you have selected. Also, many game engines prefer textures which are *power of two* such as 256, 512, 1024, or 2048. Sizes larger than 2048 may not render properly on some hardware.
9. Change the **Textures** option to **png – Portable Network Graphics**
10. Be sure to keep the F**ont descriptor** as **Text**.
11. Press **OK** to apply the changes
12. Select **Options**->**Save bitmap font as…** to save your .fnt and .png files.

## .fnt File Format

Bitmap font generator automatically produces .fnt files based on the values set in the application. Since .fnt files are text files, they can be modified manually to adjust font behavior. Keep in mind that a modified .fnt file may be overwritten by Bitmap font generator if you export the font again.

### lineHeight

The lineHeight value controls the height of each individual line in rendered text. Gum uses this value when determining the size of a font when using `Height Units` of `Relative to Children`.

For example, the following Text instance has 3 lines of text and is using a .fnt file with a lineHeight of 18, resulting in a height of 18\*3=54.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-dae569b3d23281262c0d375e6197f2f3d1e725a8%2F16_08%2012%2051.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/gum-tool/bitmap-font-generator-.fnt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
