# How to add a new font

{% hint style="danger" %}
Adding new fonts is recommended ONLY for experienced developers! rcore Support is not able to help you in adding custom fonts.
{% endhint %}

1. Download swfmill - <https://www.swfmill.org/releases/swfmill-0.3.3-win32.zip>
2. Download gfxexport.exe. We can not tell you where to get this, as it’s illegal to spread - find it on Google. It should look like this

![GFXExport](https://rco.re/docs/spray/GFXExport.png)

1. put swfmill and GFxExport in a folder, put your font (must be .ttf) in the same folder
2. create file in.xml in this folder

```xml
<?xml version="1.0" encoding="iso-8859-1" ?>

<movie version="8" width="320" height="240" framerate="12">
  <frame>
    <library>
      <font id="yourfontname" import="yourfontname.ttf" name="yourfontname"/>
    </library>
  </frame>
</movie>
```

1. Make sure your font has a unique name, not "yourfontname", same in the .xml :)
2. Your folder should now look like this. Contents of GFxExport being in the previous screenshot

![Folder](https://rco.re/docs/spray/folder.png)

1. Open command line in this folder and execute the following
2. `.\swfmill.exe simple in.xml out.swf`
3. `.\GFxExport\gfxexport.exe out.swf`
4. Rename out.gfx to your font's wanted name (what the original .ttf is)
5. Put the .gfx in `rcore_spray/stream/`
6. Put the .ttf in `rcore_spray/ui/fonts`
7. The .ttf and .gfx MUST have the same name
8. Configure the font in rcore\_spray/config.lua (`FONTS` table)


---

# Agent Instructions: 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:

```
GET https://documentation.rcore.cz/paid-resources/rcore_spray/how-to-add-a-new-font.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
