Files
minecraft-text-generator/README.md
2026-03-29 21:49:03 +02:00

63 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Minecraft text generator
This little project is a tool that takes a string of text and generates minecraft structure that represents given text in a font of your choice. User can choose blocks to use (or define their own palette) or just use preset.
Exported structure can be in various formats, such as .schematic, .litematic or .nbt, or just .mcfunction file with setblock commands.
## Usage
### Build
```bash
cargo build --release
```
The binary is at `target/release/minecraft-text-generator`.
### Generate text
```bash
minecraft-text-generator -t "Hello World" -f path/to/font.ttf
```
Outputs `output.mcfunction` by default.
### Common flags
| Flag | Default | Description |
|------|---------|-------------|
| `-t, --text` | *(required)* | Text to generate |
| `-f, --font` | *(required)* | Path to `.ttf` font file |
| `--format` | `mcfunction` | Output format(s): `mcfunction`, `litematica`, `png`, `all` |
| `-o, --out` | `output` | Output file path (without extension) |
| `--size` | `16.0` | Text height in blocks |
| `-d, --depth` | `1` | How many blocks deep |
| `-p, --palette` | `default` | Built-in palette preset name |
| `--palette-file` | — | Path to a custom JSON palette file |
| `--shadow` | off | Add a drop shadow |
| `--shadow-x` / `--shadow-y` | `1` / `-1` | Shadow offset in blocks |
| `--outline-mode` | `8` | Outline connectivity: `4` (cardinal) or `8` (with corners) |
| `--letter-spacing` | font default | Extra blocks between characters |
| `--word-spacing` | `4` | Blocks wide for a space character |
| `--cell-size` | `16` | Pixel size per block for PNG export (864) |
### List available palettes
```bash
minecraft-text-generator --list-palettes
```
### Examples
```bash
# Litematica schematic with a shadow
minecraft-text-generator -t "HELLO" -f fonts/myfont.ttf --format litematica --shadow
# PNG preview at 32px per block
minecraft-text-generator -t "HELLO" -f fonts/myfont.ttf --format png --cell-size 32
# All formats at once, custom palette
minecraft-text-generator -t "HELLO" -f fonts/myfont.ttf --format all -p stone
```
![showcase](minecraft_world.png)