> For the complete documentation index, see [llms.txt](https://cardstock-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/layers/text-layer.md).

# Text Layer

<figure><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FCRQiH6qEBYKkMvnmOI5b%2FScreenshot%202026-05-20%20at%207.02.44%E2%80%AFPM.png?alt=media&amp;token=f5d90037-3e63-443c-937a-9bb92e685b6a" alt="" width="495"><figcaption></figcaption></figure>

Text layers allow you to put...text on your cards!

***

## Font Styling

You can use any of the Fonts in your system — and the "Fonts" list includes a "favorite" option so you can see your favorite Fonts at the top of the list.

Standard options will apply to the entire text block like "Bold", "Italics", the font size, and the wrap mode.

<figure><picture><source srcset="/files/4Lvo23urNM2UelzBx6mV" media="(prefers-color-scheme: dark)"><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FhJSmI6yHxcI5l0RFcmuy%2FScreenshot%202026-05-19%20at%2010.10.13%E2%80%AFPM.png?alt=media&amp;token=a53d67e5-88e1-490c-813f-34efdeedb7a8" alt="" width="302"></picture><figcaption></figcaption></figure>

{% hint style="warning" %}

## Text layers will not be visible without a *Fill*, *Gradient Fill*, or *Image Fill* Component.

{% endhint %}

***

## Additional Options

### Scale to Fit

Use the [Text Scale to Fit](/docs/design/templates-design-your-cards/components/text-scale-to-fit.md) component to automatically scale text up or down to fill the layer area.

### Fit to Text

Use the [Fit Layer to Text](/docs/design/templates-design-your-cards/components/fit-layer-to-text.md) component to automatically grow and shrink the area based on the text.

<figure><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FiwtfSYMJos8zKEKqWtgf%2FScreen%20Recording%202026-05-20%20at%2010.43.26%E2%80%AFPM.gif?alt=media&amp;token=c7d63273-4770-4bcc-8b0f-f89eb2f62698" alt=""><figcaption><p>This is combined with <strong>Content Size Fitter</strong> to keep the background growing too.</p></figcaption></figure>

### Letter & Line

These will determine the letter spacing and line spacing for the Text.

### Align & V-Align

This controls the horizontal and vertical alignment for the Text.

***

## In-Line Font Formatting

Want a word in **bold**, a phrase in <mark style="color:$danger;">red</mark>, or a footnote-sized <sup>superscript</sup>? Two routes — pick based on how often the same look recurs.

### One-off: simple tags inline

For a single span you don't expect to reuse, drop the formatting straight into the text. Each tag wraps the chunk you want styled and closes with `</...>`:

{% code overflow="wrap" %}

```
This is <b>important</b> and <i>nuanced</i>.An <u>underlined</u> phrase. <s>Crossed out.</s>
```

{% endcode %}

That covers the four basics. The full set:

| Tag                                | Effect                                              | Example                                                  |
| ---------------------------------- | --------------------------------------------------- | -------------------------------------------------------- |
| `<b>`   `</b>`                     | Bold                                                | `<b>+1</b>`                                              |
| `<i>`   `</i>`                     | Italic                                              | `<i>flavor text</i>`                                     |
| `<u>`   `</u>`                     | Underline                                           | `<u>linked phrase</u>`                                   |
| `<s>`   `</s>`                     | Strikethrough                                       | `<s>old price</s>`                                       |
| `<color=#hex>`   `</color>`        | Text color (any CSS color)                          | `<color=#d00000>red</color>`, `<color=blue>blue</color>` |
| `<color=globalValue>`   `</color>` | Text color by Global Value                          | `<color=redColor><img=apple.shape></color>`              |
| `<size=N>`   `</size>`             | Absolute pixel size                                 | `<size=12>small</size>`                                  |
| `<size=Nem>`   `.</size>`          | Relative to the active font                         | `<size=1.4em>BIG</size>`                                 |
| `<size=N%>`   `</size>`            | Same idea — 140% ≡ 1.4em                            | `<size=120%>bigger</size>`                               |
| `<small>`   `</small>`             | 0.85× shorthand                                     | `<small>fine print</small>`                              |
| `<big>`   `</big>`                 | 1.15× shorthand                                     | `<big>HEADLINE</big>`                                    |
| `<font=Family>`   `</font>`        | Font family override                                | `<font=Helvetica>aside</font>`                           |
| `<bg=#hex>`   `</bg>`              | Solid background highlight                          | `<bg=#fff8a0>watch out</bg>`                             |
| `<sup>`   `</sup>`                 | Superscript (0.65× size, shifted up)                | `HP<sup>+1</sup>`                                        |
| `<sub>`   `</sub>`                 | Subscript (0.65× size, shifted down)                | `H<sub>2</sub>O`                                         |
| `<br>`                             | Hard line break (also accepts `<br/>` and `<br />`) | `Line one<br>Line two`                                   |

Tags **nest freely** and combine with each other and with the inline `<img=...>` and `<varName>` forms:

{% code overflow="wrap" %}

```
On <b>turn 3</b>, roll a <color=#d00000>red</color> die.Each <i>face</i> gives <big>+1</big> <img=goldIcon w=1em>.<small>See p.<sup>14</sup> for details.</small>
```

{% endcode %}

{% hint style="warning" %}
**One nesting rule:** close in reverse open order. `<b>foo<i>bar</i>baz</b>` is fine; `<b>foo<i>bar</b>baz</i>` is not — the renderer will close whichever tag was opened last regardless of which closer it sees. Stick to balanced nesting and you'll be fine.
{% endhint %}

***

### Recurring looks: a Text Style Preset

If the same combination shows up on many cards — say, "every keyword is bold magenta with a yellow halo" — defining it once as a <mark style="color:$success;">**Text Style Preset**</mark> is cleaner than retyping the same chain of tags everywhere.

Visit  [Text Style Presets](/docs/design/text-style-presets.md)  for more details. Presets and inline tags compose freely in either direction:

{% code overflow="wrap" %}

```
<style=Callout>This is important: <b>do not lose this card</b>.</style>
```

{% endcode %}

Inside the `<b>`, the surrounding `Callout` preset's font / color / background still apply unless `<b>` overrides them.

### Notes

* **Color values** accept anything CSS understands: `#rgb`, `#rrggbb`, `rgb(...)`, `rgba(...)`, named keywords (`tomato`, `rebeccapurple`).
* **`<size>` units** — bare number is pixels, `em` and `%` are relative to whatever font size is active where the tag opens (so a `<size=1.2em>` inside a `<big>` compounds with it).
* **`<sup>` / `<sub>` shifts** are relative to the parent font size, not the post-shrink size — they keep their position correct even when nested inside a `<small>` or another sized span.
* **`<br>`** is identical to a hard newline (`\n`) text. Use whichever reads cleaner.
* **`<font=...>`** uses the same family-name format as the Font dropdown in the properties panel. Misspell the family and the renderer falls back to the platform default.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/layers/text-layer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
