https://github.com/tryashtar/minecraft-ttf
Pixel-accurate and complete TrueType fonts from Minecraft: Java Edition, generated automatically from the latest version of the game
https://github.com/tryashtar/minecraft-ttf
Last synced: 4 months ago
JSON representation
Pixel-accurate and complete TrueType fonts from Minecraft: Java Edition, generated automatically from the latest version of the game
- Host: GitHub
- URL: https://github.com/tryashtar/minecraft-ttf
- Owner: tryashtar
- Created: 2025-06-04T01:15:03.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2026-01-05T20:54:14.000Z (5 months ago)
- Last Synced: 2026-01-20T19:35:47.151Z (5 months ago)
- Language: Python
- Homepage:
- Size: 51.8 KB
- Stars: 29
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minecraft TTF
This Python script converts Minecraft: Java Edition [font definition files](https://minecraft.wiki/w/Font#Providers) to [TrueType Fonts (TTFs)](https://en.wikipedia.org/wiki/TrueType).
The script downloads the latest snapshot jar and reads the following font definitions:
* [Default](https://minecraft.wiki/w/Mojangles) (`minecraft:default`): The default game text font
* [Enchanting](https://minecraft.wiki/w/Standard_Galactic_Alphabet) (`minecraft:alt`): The font used in enchanting table spells
* [Illager Runes](https://minecraft.wiki/w/Illageralt) (`minecraft:illageralt`): An unused font added in 1.18, inspired by *Minecraft Dungeons*
It creates regular, bold, italic, and bold italic variants of each, matching the `bold` and `italic` styles as they appear in-game.
Other Minecraft TTFs floating around the internet tend to be outdated (using the pre-1.13 bitmap) or don't contain the complete set of characters. Using this script will ensure you have a set that perfectly matches the vanilla game.
## Font Downloads
Fonts generated by this script can be downloaded on [the releases page](https://github.com/tryashtar/minecraft-ttf/releases).
If you use Arch Linux, I have an [AUR package](https://aur.archlinux.org/packages/minecraft-ttf-git) that uses this script to install the generated fonts to your system.
## Running the Script
1. [Download and extract the repo](https://github.com/tryashtar/minecraft-ttf/archive/refs/heads/master.zip) or clone it (`git clone https://github.com/tryashtar/minecraft-ttf`)
2. Install [`uv`](https://docs.astral.sh/uv/#installation)
3. `uv run main.py`
4. Fonts will be created in the `out` folder
## Notes
### Extended Characters
Minecraft has a [`uniform`](https://minecraft.wiki/w/GNU_Unifont) font that provides thousands of characters that aren't in the regular game font, such as [CJK characters](https://en.wikipedia.org/wiki/CJK_characters). This massive font comes from [GNU Unifont](https://en.wikipedia.org/wiki/GNU_Unifont), and its characters are **not included** in the fonts generated by this script. This font is [available for download on its website](https://unifoundry.com/unifont/index.html).
### Resource Pack Fonts
This script can turn any `bitmap` and `space` font provider into a TTF, so it could work with custom user-created fonts from resource packs too. Code would have to be written to allow the user to select which mode to use (vanilla jar or resource pack), and handle reading from unzipped sources. I have no use for this right now, so it's not implemented. But I'd be happy to help anyone who would like to see this functionality added.
### Display Tips
These fonts are very accurate, and should look good at any scale in programs that use vector graphics to draw text. When rasterizing text in programs like [GIMP](https://en.wikipedia.org/wiki/GIMP), the font will be pixel-perfect accurate when its height is set to a multiple of 12 pixels, and the line and letter spacing are whole integers.
These TTFs can be imported back into Minecraft with a `ttf` provider, and perfectly match the vanilla fonts. The `size` property should be set to 12 instead of the default 11. Italic text will be antialiased; you can increase `oversample` to around 4 to make it a closer match:
`assets/custom_font/font/default.json`:
```json
{
"providers": [
{
"type": "ttf",
"file": "custom_font:default.ttf",
"size": 12
},
{
"type": "ttf",
"file": "custom_font:italic.ttf",
"size": 12,
"oversample": 4
}
]
}
```