> For the complete documentation index, see [llms.txt](https://mkfont.gitbook.io/mkfont-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mkfont.gitbook.io/mkfont-docs/building-a-font/text-preview.md). Agents can also search and read this documentation through its [MCP server](https://mkfont.gitbook.io/mkfont-docs/~gitbook/mcp).

# Text Preview

The Text preview panel: the font as it stands set as running text, every control, and how selected text becomes a selection, a ligature or a kerning pair.

{% columns %}
{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-f5aebddd9be8b0d70b0bb65de2bcfc6937623133%2Ftext-preview-panel.png?alt=media" alt="STILL | id: text-preview-panel | SHOWS: The Text preview panel from top to bottom: the preview, the Ligature and Kern buttons, the alignment, direction and case toggles, the Size and Leading sliders, and the Text field with its three buttons | FRAME: Sidebar on the Text preview panel. Text field holding a short sentence the font has every glyph for. Every setting at its default: Align left, LTR, As typed, Size 40, Leading 1.25. Nothing selected, so the Ligature and Kern buttons show their disabled wording | CROP: sidebar | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>The preview takes the height the controls leave it.</p></figcaption></figure>
{% endcolumn %}

{% column %}
The glyph view shows one glyph at a time. The **Text preview** panel sets running text in the font as it stands, ligatures and kerning included, so spacing can be judged while the glyphs are still changing. Open it with **Text preview** in the activity bar, with **View › Text preview**, or with `Alt` + `2`.

{% endcolumn %}
{% endcolumns %}

## What the preview shows

*The open font, built by the rules of an export from the glyphs the text uses.*

The preview is set in a font built from the font in the active tab: final outlines, advances, ligatures and kerning pairs, as an export would write them. The pairs that accented letters take from their base letter apply too, while the font has that option on. Only the glyphs the text uses go into it, so a font with thousands of glyphs previews as quickly as a small one.

It is rebuilt a moment after each change to the font, undo and redo included, and whenever the text starts using a character it had not used before. Each open font keeps a preview of its own, and the panel shows the one for the active tab.

What a character of the text is drawn as depends on what the font has for it:

| The character                                                 | Is drawn                                                                                                     |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Has a glyph                                                   | In the font. An empty glyph is blank space as wide as its advance.                                           |
| Has no glyph                                                  | Faded, in a system font.                                                                                     |
| Has a glyph with **Export** off, or one that is out of bounds | In a system font, at full strength. The glyph is left out of the preview as it is left out of the font file. |
| Is part of a sequence the font has a ligature for             | As the ligature, when each character of the sequence also has a glyph of its own.                            |

{% columns %}
{% column valign="middle" %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-b69567afe6fc41f9b8709f6e19e5f79e672484b3%2Ftext-preview-missing-glyph.png?alt=media" alt="STILL | id: text-preview-missing-glyph | SHOWS: A character the font has no glyph for, drawn faded in a system font among letters set in the font | FRAME: Sidebar on the Text preview panel. Text field holding a short sentence in which one letter has no glyph and occurs at least twice. Preview at the default settings, that letter faded and visibly from another typeface, every other letter in the font. Nothing selected | CROP: region: the preview area of the Text preview panel | NEEDS: glyphs with outlines for every letter of a short sentence but one, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>Faded means the font has nothing for that character yet.</p></figcaption></figure>

{% hint style="warning" %}

## Give the font a space

A space with no glyph is set in the system font too, at that font's width, and a space has nothing to fade. The word spacing in the preview is the font's own once the space has a glyph.
{% endhint %}

{% endcolumn %}

{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-15a075f70f7612f55082d593a0bae1c196f4ec72%2Ftext-preview-ligature-applied.png?alt=media" alt="STILL | id: text-preview-ligature-applied | SHOWS: A ligature replacing its characters in the running text | FRAME: Sidebar on the Text preview panel. Text field holding one short word that contains the two characters of a ligature the font has. Preview at a Size large enough to read the joined shape, the two characters drawn as the single ligature glyph. Nothing selected | CROP: region: the preview area and the Text field of the Text preview panel | NEEDS: a ligature of two characters with an outline visibly different from its two letters side by side, and glyphs with outlines for the letters of a short word that contains those two characters | SOURCE: Sample font, browser build"><figcaption><p>Two characters in the field, one glyph in the preview.</p></figcaption></figure>

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-14bce4fa7ee874e20f34153f6a3a83660311fd27%2Ftext-preview-not-updating.png?alt=media" alt="STILL | id: text-preview-not-updating | SHOWS: The notice over the bottom edge of the preview while the font cannot be built, the text still set in the last font that was | FRAME: Sidebar on the Text preview panel. Text field holding a short sentence the font has every glyph for. A build of the preview font has failed, so the notice starting with The preview is not updating sits over the bottom edge of the preview with its warning icon, and the text above it is still set in the font | CROP: region: the header and the preview area of the Text preview panel | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build | NOTE: The notice only appears after a build that fails, so the scene has to force one after a first build has succeeded"><figcaption><p>The text stays readable. Only the latest edits are missing from it.</p></figcaption></figure>

{% endcolumn %}

{% column valign="middle" %}

### Rebuilding by hand

**Rebuild preview font**, in the header of the panel, builds the preview again on request. Its icon turns while a build is running. The preview follows the font by itself, so the button is there for a preview that has stopped following.

If the font cannot be built, the preview keeps the last font that could be, and a notice over its bottom edge reads **The preview is not updating:** followed by the reason. Each later edit tries again, and the notice goes once a build succeeds.

{% endcolumn %}
{% endcolumns %}

## The text

*Typed into the Text field, or taken from the selected glyphs.*

The **Text** field at the bottom of the panel holds what the preview sets, line breaks included. Until something is typed it holds the default text, a sentence that uses every letter of the alphabet, in the language of the interface. In English it is `By Jove, my quick study of lexicography won a prize!`.

The buttons above the field have no label. By their tooltips:

| Button                                                               | Does                                                                   |
| -------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| **Reset to the default text**                                        | Puts the default text back. Disabled while the field already holds it. |
| **Append the selected glyphs (Shift: separated by spaces)**          | Adds the characters of the selected glyphs after the text.             |
| **Use the selected glyphs as the text (Shift: separated by spaces)** | Replaces the text with the characters of the selected glyphs.          |

The last two are disabled while nothing is selected. The characters arrive in the order of the selection, a ligature as the characters it stands for, and control characters are left out. `Shift`-click either button to put a space between them; appending then also puts one between the text and what it adds. Afterwards the caret is at the end of the **Text** field, ready to type on.

Slots with no glyph count too. Select a whole range, use it as the text, and the faded characters are the ones the range is still missing.

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-240bd13eded4fac0c25b5bb0108e394317b54011%2Ftext-preview-use-selection.png?alt=media" alt="STILL | id: text-preview-use-selection | SHOWS: The selected glyphs used as the text, separated by spaces, each of them highlighted because it is still selected | FRAME: Several glyphs selected in the grid. Sidebar on the Text preview panel, where Use the selected glyphs as the text was clicked with Shift held: the Text field holds the characters of those glyphs with a space between each, the caret at the end, and the preview sets them in the font, each on its highlight | CROP: region: the sidebar and the first rows of the viewport | NEEDS: at least five letters with outlines next to each other in the grid | SOURCE: Sample font, browser build"><figcaption><p>A quick way to see a handful of glyphs side by side.</p></figcaption></figure>

## Settings

*How the text is laid out in the panel. The font is left as it is.*

| Control       | Sets                                                                               | Starts at      |
| ------------- | ---------------------------------------------------------------------------------- | -------------- |
| **Alignment** | How the lines sit between the edges of the preview.                                | **Align left** |
| **Direction** | The direction the text runs in: **LTR**, left to right, or **RTL**, right to left. | **LTR**        |
| **Text case** | The case the text is set in, whatever was typed.                                   | **As typed**   |
| **Size**      | The size of the text, from 8 to 160 pixels.                                        | `40`           |
| **Leading**   | The height of a line as a multiple of **Size**, from 0.6 to 3.                     | `1.25`         |

### Alignment

{% columns %}
{% column valign="middle" %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-a74431c30da03913640b6dfe41dceba4c5d90f6b%2Ftext-preview-justify.png?alt=media" alt="STILL | id: text-preview-justify | SHOWS: Justify: every line but the last reaches both edges of the preview | FRAME: Sidebar on the Text preview panel. Text field holding a sentence long enough to wrap onto at least three lines at the default Size. Alignment on Justify, the other settings at their defaults | CROP: region: the preview area and the row of alignment, direction and case toggles | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>The last line keeps the spacing of the font.</p></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}

<table data-card-size="large" data-view="cards"><thead><tr><th>Option</th><th>The lines</th></tr></thead><tbody><tr><td><strong>Align left</strong></td><td>Start at the left edge.</td></tr><tr><td><strong>Center</strong></td><td>Are centered.</td></tr><tr><td><strong>Align right</strong></td><td>End at the right edge.</td></tr><tr><td><strong>Justify</strong></td><td>Reach both edges, the spaces between words stretched to fit. The last line is left unstretched.</td></tr></tbody></table>
{% endcolumn %}
{% endcolumns %}

### Text case

The case is applied to the text before it is set, so it decides which glyphs the preview uses, which characters are highlighted and which are selected from it. A font that only has capitals previews in full under **Uppercase**.

{% columns %}
{% column valign="middle" %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-4dcc97e738f72ebcb540965b25c0c53f2a3cd41e%2Ftext-preview-uppercase.png?alt=media" alt="STILL | id: text-preview-uppercase | SHOWS: Uppercase: a sentence typed in lowercase set in the capitals of the font, the field unchanged | FRAME: Sidebar on the Text preview panel. Text field holding a short sentence typed in lowercase. Text case on Uppercase, the other settings at their defaults. Preview setting the sentence in capitals, all of them in the font | CROP: sidebar | NEEDS: uppercase and lowercase glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>The field keeps what was typed. Only the preview changes case.</p></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}

<table data-card-size="large" data-view="cards"><thead><tr><th>Option</th><th>The text is set</th></tr></thead><tbody><tr><td><strong>As typed</strong></td><td>As it is in the field.</td></tr><tr><td><strong>Uppercase</strong></td><td>With every letter as its capital.</td></tr><tr><td><strong>Lowercase</strong></td><td>With every letter as its lowercase.</td></tr><tr><td><strong>Capitalize words</strong></td><td>With the first letter of each word as a capital, the rest as typed.</td></tr></tbody></table>

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-a57be11f4dc479944ac6793882c4eb90354de1ae%2Ftext-preview-size-leading.png?alt=media" alt="STILL | id: text-preview-size-leading | SHOWS: A larger Size with a Leading under 1: fewer, bigger words, the lines close enough for descenders to reach the line below | FRAME: Sidebar on the Text preview panel. Text field holding a short sentence that wraps onto at least two lines. Size at 96 and Leading at 0.80, the other settings at their defaults | CROP: sidebar | NEEDS: glyphs with outlines for every letter of a short sentence that has both ascenders and descenders, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>The same sentence, larger and tighter.</p></figcaption></figure>

{% endcolumn %}

{% column valign="middle" %}

### Size and Leading

Both are sliders, with the value in force at the end of the row. A **Leading** under 1 sets the lines closer together than the text is tall, so ascenders and descenders of neighboring lines can meet.

{% endcolumn %}
{% endcolumns %}

## Selection, both ways

*Selected glyphs are highlighted in the text, and text selected in the preview becomes the selection.*

From the grid to the text: every character whose slot is selected sits on a highlight in the preview, wherever it occurs.

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-e29d8e8b4662f7cf150c5800c22ef85de565ee79%2Ftext-preview-highlight.png?alt=media" alt="STILL | id: text-preview-highlight | SHOWS: Every occurrence of the selected glyphs highlighted in the running text | FRAME: Two letters selected in the grid, each occurring several times in the text. Sidebar on the Text preview panel, Text field holding a short sentence the font has every glyph for, every occurrence of the two letters on its highlight | CROP: region: the sidebar and the first rows of the viewport | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>Change a selected glyph in the inspector and the highlight shows where to look.</p></figcaption></figure>

From the text to the grid: drag across text in the preview. When the mouse button is released, the characters under the drag become the selection, each character once, in the order of the text, with spaces and line breaks left out. The viewport stays on its range and the inspector shows the selection. Selecting in the grid itself is covered on [Search & Selection](https://mkfont.gitbook.io/mkfont-docs/building-a-font/search-and-selection.md).

| In the dragged text       | Selects                                                                                                                                                      |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A character with a glyph  | Its slot.                                                                                                                                                    |
| A character with no glyph | Its slot all the same. **Glyph › Create empty glyphs** then creates what the text is missing.                                                                |
| A ligature                | The slots of the characters it stands for. The slot of the ligature itself is never selected from the text, and selecting it in the grid highlights nothing. |

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-308dc31d5c6138d10eea6d9a40dbc0f883c812f0%2Fplaceholder-wide.jpg?alt=media" alt="CLIP | id: text-preview-drag-to-select | SHOWS: Dragging across a word in the preview selects the glyphs of its letters | BEATS: 1) Sidebar on the Text preview panel with a short sentence set in the font, the grid beside it with nothing selected. 2) The pointer drags across one word in the preview and the text under it takes the text selection color. 3) The button is released: the text selection goes, each letter of the word sits on its highlight wherever it occurs in the sentence, and the slots of those letters are selected in the grid. 4) The inspector changes to the view for several glyphs | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build | LENGTH: 6 seconds, loops"><figcaption><p>A word in the preview is a selection in one drag.</p></figcaption></figure>

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-fe325fd1f02eddfbd38905e2839e1e0bff47f578%2Ftext-preview-select-missing.png?alt=media" alt="STILL | id: text-preview-select-missing | SHOWS: Text dragged in the preview selecting a slot with no glyph along with the slots that have one | FRAME: Viewport on a Unicode block that lists every letter of the word. Sidebar on the Text preview panel, Text field holding one short word in which one letter has no glyph. The word was dragged across in the preview, so its letters are highlighted, the letter with no glyph faded on its highlight, and in the grid the slots of all its letters are selected, the one with no glyph included | CROP: region: the sidebar and the viewport | NEEDS: a Unicode block where at least one common Latin letter has no glyph, and glyphs for the other letters of a short word that uses it | SOURCE: Sample font, browser build"><figcaption><p>The selection is ready for the glyph that is still to make.</p></figcaption></figure>

## Ligature and Kern

*Text selected in the preview can become a ligature or a kerning pair.*

The buttons under the preview work from the text last dragged across in it. They keep that text while the selection changes in the grid, and let go of it when other text is dragged across, when the sidebar shows another panel or when another font is shown.

{% columns %}
{% column valign="middle" %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-97df1a8afac7c68389229c0550e79df8aea4efb3%2Ftext-preview-ligature-button.png?alt=media" alt="STILL | id: text-preview-ligature-button | SHOWS: The Ligature button naming the three characters dragged across in the preview, with the Kern button still disabled | FRAME: Sidebar on the Text preview panel. Three neighboring letters of a word were dragged across in the preview, so they are highlighted, the Ligature button reads Ligature followed by those three letters in quotes, the + components button is enabled, and the Kern button reads Select 2 characters to kern them | CROP: region: the preview area and the Ligature and Kern buttons under it | NEEDS: glyphs with outlines for every letter of a short sentence, and a glyph for the space | SOURCE: Sample font, browser build"><figcaption><p>Three characters make a ligature, and one too many for a pair.</p></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}

<table data-card-size="large" data-view="cards"><thead><tr><th>Button</th><th>Ready when the text has</th><th>Does</th></tr></thead><tbody><tr><td><strong>Ligature</strong> and the text in quotes</td><td>Two characters or more</td><td>Creates a glyph for that sequence, with no outline yet, and selects it.</td></tr><tr><td><strong>+ components</strong></td><td>Two characters or more</td><td>Does the same, and gives the new glyph one component per character.</td></tr><tr><td><strong>Kern</strong> and the two characters in quotes</td><td>Two characters</td><td>Opens that kerning pair for editing.</td></tr></tbody></table>
{% endcolumn %}
{% endcolumns %}

Until there is text to work from, the first reads **Select 2+ characters**, the third **Select 2 characters to kern them**, and all of them are disabled.

### Ligature

Creating the ligature is one step in the history, named **Create ligature** and its characters. If the viewport is showing a pair view, it changes to the **Ligatures** range so the new glyph can be seen. If the font already has that ligature, it is selected and a toast says so. What a ligature needs to work in text, and the other ways to create one, are on [Ligatures](https://mkfont.gitbook.io/mkfont-docs/building-a-font/ligatures.md).

{% columns %}
{% column valign="middle" %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-5a920abd27035786999ed4888869cbf9cc838936%2Ftext-preview-kern-button.png?alt=media" alt="STILL | id: text-preview-kern-button | SHOWS: The Kern button naming the two characters dragged across in the preview, with the value their pair already has | FRAME: Sidebar on the Text preview panel. Two neighboring letters that have a kerning pair with a value were dragged across in the preview, so they are highlighted, the Ligature button names them, and the Kern button reads Kern followed by the two letters in quotes and the value of the pair in small type | CROP: region: the preview area and the Ligature and Kern buttons under it | NEEDS: two letters with outlines that have a kerning pair with a negative value, and glyphs with outlines for the other letters of a short word that has those two side by side | SOURCE: Sample font, browser build"><figcaption><p>The value is the one the preview is already applying.</p></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}

### Kern

When the pair already has a value in force, its own or one it inherits, the button shows it after the characters.

Clicking adds the pair to the font at 0 if it is new, then shows it selected in the **Kerning** range, or in the pair view that is already in the viewport, with the caret in its value field in the pair inspector. A search in the viewport is cleared so the pair is listed. If the font already has the pair, a toast says so. Pairs, their values and their views are on [Kerning](https://mkfont.gitbook.io/mkfont-docs/building-a-font/kerning.md).
{% endcolumn %}
{% endcolumns %}

## What is remembered

*The text and the settings stay on this computer, shared by every font.*

The text, **Alignment**, **Direction**, **Text case**, **Size** and **Leading** are kept from one session to the next. They belong to this computer and are the same for every font: they are not written to the project file, so a project opened on another computer is previewed with that computer's text.

A default text that was never typed over follows the language of the interface. The text dragged across for the **Ligature** and **Kern** buttons is not kept.

What else stays out of the project file is listed on [Saving & Files](https://mkfont.gitbook.io/mkfont-docs/how-mkfont-works/saving-and-files.md).


---

# 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://mkfont.gitbook.io/mkfont-docs/building-a-font/text-preview.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.
