> 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/gum-elements/text/font-size.md). Agents can also search and read this documentation through its [MCP server](https://docs.flatredball.com/gum/~gitbook/mcp).

# Font Size

### Introduction

Font Size controls how large a font appears on screen. Each font size and Font combination creates its own rasterized font, so using a lot of different font sizes will increase the amount of texture memory your game needs.

### Example

The Font Size property can be set in Gum to make a text object's font larger or smaller. For example, the following shows a Text object with a font size of 18:

![](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-ed30635cb81af672c3588ce5f1d89a77e9eb14e5%2FFontSize18.png?alt=media\&token=f096f372-66ee-47f4-af0c-7f655430e3e7)

Changing the font size will increase the size of the Text object. For example, here is the same Text object with a Font Size of 36:

![](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-4a050b6056f2be70c8d6bb874eec1953ec966653%2FFontSize36.png?alt=media\&token=b8ccae03-783b-4e0e-8f35-b549beda9dd1)

### Font Cache

The first time a Font and Font Size combination are referenced, Gum creates a file in the FontCache folder. You may notice a small pause in Gum when setting Font and Font Size combinations for the first time as the file is created, but subsequent changes will be fast.

The FontCache folder is located in the following location:

/FontCache/

![](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8400682a1473bf19532e2cba5c698b27cfb1d6e2%2FFontCacheFolder.png?alt=media\&token=ff2c140c-0938-4964-a254-5f5ed93fc0ea)

### Font Size and Pixel Fonts

Games which are using fonts that are intentionally pixelated should avoid setting Font Size in-between the intended font size multiples for the given font. These sizes depend on the specific font used, and may require some trial and error.

For example, consider the font Press Start 2P which can be installed from <https://fonts.google.com/specimen/Press+Start+2P>

Font Size can be set to any value, but this font only looks good if Font Size is set to 8.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-934c00811f43e83dc6972046552ca548f68e3994%2Fimage.png?alt=media" alt=""><figcaption><p>Font Size 8 through 15 with Press Start 2P Font</p></figcaption></figure>

The rendering artifacts are more obvious when zooming in, as shown in the following image:

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-fa2e4f3e0feaffd2be4ab0e1d775fd2f3d10ce1b%2FFontSizeArtifacts.png?alt=media" alt=""><figcaption><p>Rendering artifacts on font sizes which are not multiples of the intended font size for Press Start 2P font</p></figcaption></figure>

Of course, we could also set the Font Size to 16, but this is unnecessary. Since text instances using pixelated fonts usually have [Use Font Smoothing](https://docs.flatredball.com/gum/gum-tool/gum-elements/text/use-font-smoothing.md) set to false, then the Text can use its [Font Scale](https://docs.flatredball.com/gum/gum-tool/gum-elements/text/font-scale.md) to adjust its size.


---

# 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/gum-elements/text/font-size.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.
