> 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/import-and-export/preparing-svgs.md). Agents can also search and read this documentation through its [MCP server](https://mkfont.gitbook.io/mkfont-docs/~gitbook/mcp).

# Preparing SVGs

What MkFont reads from an SVG file, and how to set up and name files in a vector editor so each shape arrives at the right size, in the right slot.

An SVG file gives MkFont its shapes, one box around them, and, in a batch import, its name. The shapes become the glyph's imported shape, the box is the frame that shape is fitted by, and the name says which slot it goes to. Colors, stroke widths and effects are left behind.

<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="DIAGRAM | id: preparing-svgs-what-is-read | SHOWS: The parts of an SVG file MkFont reads, and what each becomes | ELEMENTS: Left, a file drawn as a vector editor would show it: an artboard frame, a letter shape on it filled with a color and outlined with a thick stroke, and the file name under it. Right, three labelled results joined to the left by lines: the geometry of the letter in plain black, labelled imported shape; the artboard frame alone, labelled imported box; a grid slot holding the character, labelled slot. The fill color and the stroke width faded on the left, with no line leading from them | MUST BE CLEAR: Geometry, one box and the file name are read. Color and stroke width are left behind"><figcaption><p>Geometry, a box and a name. The paint stays in the file.</p></figcaption></figure>

Importing the files, one at a time or as a batch, is on [Importing SVGs](https://mkfont.gitbook.io/mkfont-docs/import-and-export/importing-svgs.md).

## The imported box

*One box comes in with every shape. MkFont takes the first of these the file has: a marked box, the viewBox, the width and height, the size of the shape.*

The **imported box** is the frame a shape is measured in whenever its transforms use it, so blank space left inside it on purpose is kept. It is a different box from the outline box, the tight rectangle around the shape. What each one is for is on [Fitting a Shape](https://mkfont.gitbook.io/mkfont-docs/how-mkfont-works/fitting-a-shape.md).

| Order | The box is                                         | Taken when                                                                   |
| ----- | -------------------------------------------------- | ---------------------------------------------------------------------------- |
| 1     | The marked box                                     | The file has a path painted in the **Mark color**.                           |
| 2     | The viewBox                                        | The root `svg` element has a `viewBox` with a width and a height above zero. |
| 3     | The `width` and `height` of the root `svg` element | The file has no usable viewBox.                                              |
| 4     | The size of the shape itself                       | The file has none of the above.                                              |

<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="DIAGRAM | id: preparing-svgs-box-order | SHOWS: Which box MkFont takes as the imported box, in order of preference | ELEMENTS: Four panels left to right, numbered 1 to 4, the same letter shape in each. Panel 1, labelled marked box: a large artboard frame drawn faint, a magenta rectangle close around the letter drawn strong. Panel 2, labelled viewBox: the artboard frame drawn strong, no magenta rectangle. Panel 3, labelled width and height: no frame in the file, a box of the stated size drawn strong from the origin of the drawing, the origin marked with a small cross. Panel 4, labelled size of the shape: a box as wide and as tall as the letter drawn strong from the origin cross, the letter drawn away from the origin so that it sits partly outside the box | MUST BE CLEAR: The first box present wins, a marked box beats the viewBox, and the last two boxes start at the origin of the drawing wherever the shape is"><figcaption><p>The first one the file has is the one used.</p></figcaption></figure>

The viewBox is read with its origin: `viewBox="100 100 500 400"` is a box 500 wide and 400 tall whose top-left corner is the point 100, 100 of the drawing. When a file has a viewBox, its `width` and `height` are passed over.

Without a viewBox, `width` and `height` give the size of a box whose top-left corner is the origin of the drawing. A length in `mm`, `pt`, `in` or another absolute unit is converted to user units, at 96 to the inch. A percentage is not a size, and when one of the two is missing, that side is taken from the shape.

The box never clips. Whatever part of a shape the file holds outside the box is kept where it was drawn.

{% hint style="warning" %}

## Save the file with a viewBox

The last fallback gives a box as wide and as tall as the shape, and still puts its top-left corner at the origin of the drawing. A shape drawn away from the origin then sits outside its own imported box, and is fitted out of place under every **Bounds** option except **Glyph bounds**. A viewBox or a marked box avoids it.
{% endhint %}

### The marked box

A **marked box** is a path drawn into the file to say where the frame is, for a file whose viewBox is not the frame the shape should be measured in. MkFont takes the bounding box of that path as the imported box, and leaves the path out of the shape.

The path is recognized by its paint: its fill or its stroke is the **Mark color** set in **Preferences › Import**, `#ff00ff` unless it was changed. Either one is enough, so an unfilled rectangle with a magenta stroke works as well as a filled one. The color can be set on the path as an attribute, in its `style`, through a class, or on a group the path is in. The preference is listed on [Preferences](https://mkfont.gitbook.io/mkfont-docs/reference/preferences.md).

```svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
  <rect x="200" y="100" width="500" height="700" fill="none" stroke="#ff00ff"/>
  <path d="M250 800V300H650V800Z"/>
</svg>
```

This file comes in with a box 500 wide and 700 tall, and the shape placed inside it as drawn: 50 from its left edge, standing on its bottom edge.

<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="DIAGRAM | id: preparing-svgs-marked-box | SHOWS: A marked box drawn inside a larger artboard, and the imported box it gives | ELEMENTS: Left, an artboard much larger than a letter drawn on it, with an unfilled magenta rectangle around the letter that leaves some room above it and none under it. Right, the result: the rectangle redrawn as the imported box, in the line style the book uses for it, the letter inside it at the same place, the artboard gone and the magenta path gone from the shape | MUST BE CLEAR: The box of the magenta path replaces the artboard as the frame, and the magenta path itself is left out of the glyph"><figcaption><p>The rectangle becomes the frame. It never reaches the glyph.</p></figcaption></figure>

The color has to be written in a form MkFont compares:

| Written in the file as                               | Read as the mark                                                              |
| ---------------------------------------------------- | ----------------------------------------------------------------------------- |
| Six hex digits, in either case: `#ff00ff`, `#FF00FF` | When it is the **Mark color**.                                                |
| Three hex digits: `#f0f`                             | When the **Mark color** is the color it shortens.                             |
| `magenta`                                            | Only while the **Mark color** is `#ff00ff`. Other color names are never read. |
| `#b9529f`                                            | Always, whatever the **Mark color** is. It is a CMYK magenta.                 |
| `rgb(255, 0, 255)`, `fuchsia`, `#ff00ffff`           | Never. The path becomes part of the shape.                                    |

Opacity is not read: a mark at any opacity is a mark.

* **Any path can be the mark.** Its bounding box is what counts, so a rectangle is the plain choice.
* **A hidden mark still counts.** Hidden shapes are left out of the glyph, and a mark on a hidden layer sets the box all the same, so the mark can live on a layer of its own that stays switched off.
* **A file needs a shape besides its mark.** A mark alone leaves nothing to import.

{% hint style="warning" %}

## One mark per file

MkFont takes the first path in the mark color, in the order of the file. A second path in that color is read as part of the shape, and fills in the glyph.
{% endhint %}

In **Import SVG files**, a file whose mark was found reads **marked box** after its size.

{% columns %}
{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-835f1dde8ed2376787af0818fba263e4b018267a%2Fpreparing-svgs-without-mark.png?alt=media" alt="STILL | id: preparing-svgs-without-mark | SHOWS: A shape imported by its artboard alone: the unused room of a large artboard leaves the outline small between the lines | FRAME: The glyph imported without a marked box selected. Bounds on Imported bounds, Scale on Baseline to Ascender, everything else at the defaults. Glyph view showing the outline small, far short of the ascender line and inset from the edges of the advance box | CROP: region: the glyph view and the Fit fields under it | NEEDS: two glyphs imported from the same drawing on an artboard much larger than the letter, one from a file with a marked box close around the letter and one from a file without it | SOURCE: Sample font, browser build"><figcaption><p>No mark: the whole artboard is the box.</p></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-8b3f95a53e6def74cd55620768a9fbeca218c2b7%2Fpreparing-svgs-with-mark.png?alt=media" alt="STILL | id: preparing-svgs-with-mark | SHOWS: The same drawing imported with a marked box: the mark is the frame, and the outline fills the height between the lines | FRAME: The glyph imported with the marked box selected, same settings as preparing-svgs-without-mark. Glyph view showing the outline reaching from the baseline to the ascender line, with no magenta rectangle in it | CROP: region: the glyph view and the Fit fields under it | NEEDS: two glyphs imported from the same drawing on an artboard much larger than the letter, one from a file with a marked box close around the letter and one from a file without it | SOURCE: Sample font, browser build"><figcaption><p>Same drawing, same settings. The mark is now the box, and is gone from the outline.</p></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Artboards

*One glyph per file, and the artboard as its frame.*

Every shape in a file is merged into one glyph, so a font is drawn as one file per glyph.

An artboard does its work when the file is saved with a viewBox that matches it: the artboard is then the imported box. Give every glyph an artboard of the same height, and draw each shape on it at its real size and position.

When the height is fitted by the imported box, the bottom edge of the artboard lands on the baseline, and the top edge on the line the **Scale** option names: the ascender line for **Baseline to Ascender**. That is what a new font does, with **Bounds** on **Mixed bounds vertical** and a bottom anchor placed on **Baseline**. The **Bounds** options are on [Transforms](https://mkfont.gitbook.io/mkfont-docs/building-a-font/glyph-inspector/transforms.md).

<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="DIAGRAM | id: preparing-svgs-artboard-lines | SHOWS: Artboards of one height, and where their edges land in the font | ELEMENTS: Top row, three artboards of identical height side by side, each a separate file: a capital letter filling the height, a lowercase letter with a descender that hangs below the bottom edge of its artboard, and a comma small at the bottom. The bottom edge of each artboard labelled baseline and the top edge labelled ascender. Bottom row, the three shapes set side by side on shared horizontal lines labelled ascender and baseline, at the sizes and positions they were drawn, the descender below the baseline | MUST BE CLEAR: The bottom edge of the artboard is the baseline and its top edge is the line the scale is set to, for every file alike, and a part drawn below the bottom edge stays below the baseline"><figcaption><p>The edges of the artboard are the lines of the font.</p></figcaption></figure>

Because the box never clips, a descender drawn below the bottom edge of the artboard hangs below the baseline, as long as the saved file still holds it.

For Illustrator, MkFont writes a script that creates one artboard per glyph: [Illustrator Artboards](https://mkfont.gitbook.io/mkfont-docs/import-and-export/illustrator-artboards.md).

## Size and units

*The size a shape is drawn at is forgotten. Its size against its box is kept.*

Fitting scales the imported box to a distance between two of the font's metric lines, and the shape with it. A letter 20 units tall on an artboard of 30 and the same letter 2000 units tall on an artboard of 3000 give the same glyph. What carries over is proportion: how much of the box the shape fills, and where in the box it sits.

The drawn size counts under the **Scale** options **Manual** and **None**, which start from it: one unit of the file is then one font unit.

## What becomes the shape

*Paths and basic shapes, each with its transforms applied, merged into one shape. Paint is left behind.*

| In the file                            | Arrives as                                                                                             |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `path`                                 | Its geometry.                                                                                          |
| `rect`, `circle`, `ellipse`, `polygon` | A closed contour. Rounded corners are kept.                                                            |
| `polyline`                             | An open path, closed on arrival like any open path.                                                    |
| `line`                                 | A contour with no area. It fills nothing, and still widens the outline box.                            |
| `g`, at any depth                      | Its contents, with every `transform` on the way down applied.                                          |
| `use`                                  | The element it points to in the same file, drawn in place: a path, a group, a `symbol`, another `use`. |
| An `svg` element inside the file       | Its contents, placed and scaled by its own position, size and viewBox.                                 |

What is left out, or read without its effect:

| In the file                                              | What happens                                                                                                                         |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| A hidden shape                                           | Left out. Hidden means `display: none` on the shape or on a group around it, or `visibility: hidden`. An opacity of 0 does not hide. |
| `text`                                                   | Never drawn. Its text is read as a label: see [Text labels](#text-labels).                                                           |
| `image`                                                  | Ignored.                                                                                                                             |
| `clipPath`, `mask`                                       | Never applied. A clipped shape comes in whole.                                                                                       |
| The contents of `defs` and of a `symbol`                 | Drawn only where a `use` points to them.                                                                                             |
| A `use` that points to another file                      | Ignored.                                                                                                                             |
| A `rect` placed or sized in percent                      | Left out, which covers a background written as 100% of the page.                                                                     |
| Fill and stroke paint: color, gradient, pattern, opacity | Not read, the **Mark color** aside.                                                                                                  |
| Stroke width, caps, joins and dashes                     | Not read.                                                                                                                            |
| `fill-rule`                                              | Not read.                                                                                                                            |

{% hint style="warning" %}

## Every shape counts, whatever its paint

A white shape drawn to cover part of a letter, a background rectangle sized in units, a guide left with neither fill nor stroke: each one is added to the glyph as a filled shape. Delete them or hide them before saving.
{% endhint %}

### Strokes and open paths

A stroke is read as the path it runs along, and its width is dropped. A letter drawn as a centerline with a thick stroke arrives as that centerline. Convert every stroke to a filled outline in the vector editor before saving, so that the file holds the edges of the stroke as a path.

A font fills every contour, and a contour is always closed. An open path is closed by a straight line from its last point back to its first, and the area inside is filled.

<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="DIAGRAM | id: preparing-svgs-stroke-read | SHOWS: A stroked open path as drawn, and what MkFont reads from it | ELEMENTS: Left, labelled as drawn: an open curve such as an arc, drawn with a thick stroke and no fill. Middle, labelled as read: the same curve as a hairline, its two ends joined by a straight dashed line. Right, labelled as filled: the area between the curve and that straight line filled solid | MUST BE CLEAR: The width of the stroke is dropped, the path is closed between its ends, and the closed area is what gets filled"><figcaption><p>The width is dropped, the path is closed, the inside is filled.</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-0720d3f6d49b425350d224f6251eb22b3ac73b32%2Fpreparing-svgs-stroke-arrives.png?alt=media" alt="STILL | id: preparing-svgs-stroke-arrives | SHOWS: A stroked open path as it arrives in the glyph view: a filled area closed by a straight edge | FRAME: One glyph selected, imported from the stroked path, transforms at the defaults. Glyph view showing a solid shape with one curved side and one straight side | CROP: region: the glyph view | NEEDS: a glyph imported from an SVG that holds one open curved path with a thick stroke and no fill | SOURCE: Sample font, browser build"><figcaption><p>A stroke left as a stroke.</p></figcaption></figure>

### Overlaps and holes

Contours come in as drawn. Overlapping shapes stay separate contours of one glyph: MkFont does no union and no subtraction.

A hole is decided by direction, the way a font decides it: a contour cuts a hole in the one around it when it runs the opposite way. `fill-rule` is not read, so a counter that is a hole only by the even-odd rule arrives solid. For the same reason, two overlapping shapes that run opposite ways arrive with a hole where they overlap.

<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="DIAGRAM | id: preparing-svgs-direction-holes | SHOWS: How the direction of contours decides what is filled | ELEMENTS: Four small panels, each with small arrows along the contours to show their direction, and the filled result under it. Panel 1: a ring whose inner contour runs against the outer one, result with a hole. Panel 2: the same ring with both contours running the same way, result solid. Panel 3: two overlapping shapes running the same way, result one solid mass. Panel 4: two overlapping shapes running opposite ways, result with a hole where they overlap | MUST BE CLEAR: A hole opens wherever two contours running opposite ways cover the same area, and nowhere else"><figcaption><p>Opposite directions cut. The same direction adds.</p></figcaption></figure>

In the file, unite the shapes that overlap, and have each counter run against the contour around it. After import, a single contour can be reversed in the outline editor with **Reverse the contour direction (R)**, described on [Outline Editor](https://mkfont.gitbook.io/mkfont-docs/building-a-font/outline-editor.md).

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-f9185461fdf7760c7710d3b51e19cf598677286a%2Fpreparing-svgs-filled-counter.png?alt=media" alt="STILL | id: preparing-svgs-filled-counter | SHOWS: A letter whose two contours run the same way, as the glyph view draws it after import: the counter is solid | FRAME: One glyph selected. Glyph view showing the letter as a solid mass with no hole | CROP: region: the glyph view | NEEDS: a letter with a counter, such as an O, whose inner contour runs in the same direction as its outer contour | SOURCE: Sample font, browser build"><figcaption><p>Every point is in place. One contour runs the wrong way.</p></figcaption></figure>

## Text labels

*A `text` element is never drawn. Its text names a glyph to add as a component.*

Each `text` element in a file is read as the name of a glyph, and the imported glyph gets a component that places the named one. What a component does is on [Building with Components](https://mkfont.gitbook.io/mkfont-docs/how-mkfont-works/building-with-components.md).

A label is the whole text of one `text` element, with the spaces around it dropped.

| Label                | Names                             |
| -------------------- | --------------------------------- |
| `A`                  | The glyph of that character.      |
| `U+0301`             | The glyph of that Unicode value.  |
| `fi`, `U+0066U+0069` | The ligature of those characters. |

* **One line per label.** A `text` element broken over several lines is still one label, read as all its characters in a row, which names a ligature.
* **Characters and `U+` values only.** The `uni0041` and bare hex forms that file names accept are read here as plain characters.
* **One component per glyph named.** A label written twice gives one component, and a glyph that already has a component placing the named glyph gets no second one.
* **The named glyph can come later.** Until it exists, the component is listed as missing.
* **A hidden label is still read.** Text counts on hidden layers too: delete a label to remove it.

Lettering meant to be part of the shape has to be converted to paths before saving.

In **Import SVG files**, labels are read while **Text labels in SVGs become components** is on, as it is when the dialog opens. When one file is imported into one glyph, and each time a linked file reloads, labels are always read.

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-fe66265564afcfae85c8b5a6bd603777d95d5ea7%2Fpreparing-svgs-labels-components.png?alt=media" alt="STILL | id: preparing-svgs-labels-components | SHOWS: A glyph imported from a file with two text labels: one component per label, next to its own shape | FRAME: One glyph selected. Inspector scrolled so the glyph view and the Components section are visible, the section listing two components, each drawing the glyph its label named | CROP: region: the glyph view and the Components section | NEEDS: a glyph imported from an SVG that holds a shape and two text labels, each naming another glyph of the font | SOURCE: Sample font, browser build"><figcaption><p>Two labels in the file, two components in the glyph.</p></figcaption></figure>

## When a file is refused

*A file with nothing to import is refused, with the reason.*

One file imported into one glyph raises a toast, **Could not import** followed by the file name, with the reason under it. In **Import SVG files**, the reason is written under the name of the file, the file cannot be checked, and the dialog counts it as unusable.

| Reason                                                                | Cause                                                                                                                                |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **The file has no usable paths.** In the dialog, **No usable paths.** | Nothing is left to import: the file has no shape, every shape is hidden, it holds only text or images, or its only path is the mark. |
| **The SVG is incomplete or malformed.**                               | The file is cut short, or a tag in it is left unclosed.                                                                              |
| **This SVG draws too many copies through \<use> to import.**          | Its `use` elements draw more than 50,000 elements between them. References nested in references multiply fast.                       |
| **This SVG has too much path data to import.**                        | Its path data adds up to more than 8 million characters, the copies drawn by `use` included.                                         |

## File names

*In a batch import, the name of each file says which slot it goes to.*

**Import SVG files** opens on **From file names**: each file is assigned to the slot its name spells. A name is read in this order:

1. The extension is dropped.
2. If the **Prefix** field holds text, everything up to and including its last occurrence in the name is dropped.
3. What is left is split at the **Separator**.
4. Each part is read as one of the forms below, and the parts are joined. One character gives the slot of that character. Several give a ligature.

| A part written as                                                 | Is read as       | Example                  |
| ----------------------------------------------------------------- | ---------------- | ------------------------ |
| One or more characters                                            | Those characters | `A`, `é`, `fi`           |
| `U+` and a Unicode value, repeated for several                    | Those characters | `U+0041`, `U+0066U+0069` |
| `uni` and four hex digits, repeated for several                   | Those characters | `uni0041`, `uni00660069` |
| `u` and four to six hex digits                                    | That character   | `u1F600`                 |
| Four to six hex digits, at least one of them a figure from 0 to 9 | That character   | `00e9`, `1F600`          |

Hex digits are read in either case. `uni` and the lone `u` are lowercase: `UNI0041` is read as seven characters.

The separator is **\_ underscore**, **- dash**, **. dot**, **␣ space** or **none**. With **none**, a name is one part.

With no prefix and the underscore as separator, unless the row says otherwise:

| File                                                                      | Slot                                                                    |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `A.svg`                                                                   | A, `U+0041`                                                             |
| `a.svg`                                                                   | a, `U+0061`                                                             |
| `U+0041.svg`                                                              | A                                                                       |
| `uni0041.svg`                                                             | A                                                                       |
| `0041.svg`                                                                | A                                                                       |
| `00e9.svg`                                                                | é, `U+00E9`                                                             |
| `u1F600.svg`                                                              | `U+1F600`                                                               |
| `fi.svg`                                                                  | The ligature of f and i                                                 |
| `f_i.svg`                                                                 | The ligature of f and i                                                 |
| `f_f_i.svg`                                                               | The ligature of f, f and i                                              |
| `U+0066_U+0069.svg`                                                       | The ligature of f and i                                                 |
| `uni00660069.svg`                                                         | The ligature of f and i                                                 |
| `char_A.svg`, with **Prefix** `char`                                      | A                                                                       |
| `glyph-0041.svg`, with **Prefix** `glyph` and **Separator** on **- dash** | A                                                                       |
| `2024.svg`                                                                | `U+2024`: four figures are a Unicode value                              |
| `face.svg`                                                                | The ligature of f, a, c and e: with no figure in it, the name is a word |
| `acute.svg`                                                               | The ligature of a, c, u, t and e                                        |
| `_.svg`                                                                   | No slot: the name holds nothing but a separator                         |

<figure><img src="https://1675470811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwkWJ9v357hW91tto340i%2Fuploads%2Fgit-blob-8c0cedff05be9793442d4833e80e76e03eb5da1b%2Fpreparing-svgs-names-targets.png?alt=media" alt="STILL | id: preparing-svgs-names-targets | SHOWS: File names written in each accepted form, and the slot each one is assigned | FRAME: Import SVG files open on the fixture folder. Assign to unicode on From file names, Prefix blank, Separator on _ underscore. File list showing one row per file, each with its target character and Unicode value in the Target column | CROP: region: the file list of the dialog | NEEDS: any font | SOURCE: Sample font + fixture: a folder of SVG files named in each accepted form, browser build | NOTE: The folder holds at least one name of each form: a character, a U+ value, a uni name, bare hex, and a ligature written with a separator"><figcaption><p>One folder, every form of name, each file on its slot.</p></figcaption></figure>

{% hint style="warning" %}

## A word is a ligature

MkFont reads characters, never glyph names. `acute.svg` or `arrow-left.svg` is assigned to a ligature made of every character in its name. Name such a file by its Unicode value.
{% endhint %}

Some characters need their Unicode value as a name:

* **Both cases of a letter.** On Windows, a folder cannot hold `a.svg` and `A.svg` together. Name them `U+0061.svg` and `U+0041.svg`.
* **The separator itself.** With the underscore as separator, the underscore is `U+005F.svg`.
* **A character a file name cannot hold**, such as `/`.
* **A run of four to six figures.** `2024.svg` is one Unicode value.

A prefix is the text the files share ahead of the character part, such as `char` in `char_A.svg`. It is matched with its case, and a file that lacks it is read whole.

The dialog fills **Prefix** and **Separator** by itself when most of the names start with the same text before a separator. In a batch of three or more files made mostly of ligatures that begin with the same letter, such as `f_i.svg`, `f_l.svg` and `f_f.svg`, that guess is `f`: clear the field.

A file whose name gives no slot is listed as **unassigned**. Its slot can be typed in the **Override** column, in any of the forms above.


---

# 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/import-and-export/preparing-svgs.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.
