Skip to main content

katsuji

活字, movable type. Variable-width font tooling for a816 SNES projects.

Build a project's fonts and strings

katsuji.toml at the project root:

[fonts.dialog]
png = "fonts/vwf.png"
cell = [8, 16]
table = "text/ff4fr.tbl"
output = "assets/font.dat"
widths = { "0xFF" = 3, "0xA0" = -1 }     # negative trims, positive sets
kerning-candidates = ["Ta", "Te", "va"]  # tested for collision kerning
kerning = { "tt" = 2 }                   # hand-tuned: pixels tighter

[fonts.menu]
png = "fonts/8x8vwf.png"
cell = [8, 8]
table = "text/ff4_menus.tbl"
output = "assets/menu_font.dat"
constants = "assets/menu_font.i"         # a816 constants describing the file

[strings.items]
font = "menu"
file = "text/items.txt"                  # one string per line (or `texts = [...]`)
bpp = 2
ink = 3
paper = 1
blob = "assets/items_vwf.dat"            # tiles, no string across a bank edge
index = "assets/items_vwf.idx"           # 4 bytes per string: offset lo16, bank, tiles
katsuji build            # writes every output, paths relative to katsuji.toml
katsuji banner "Tarot" --table text/ff4fr.tbl --font assets/font.dat

Library

  • Atlas: a font drawn as a PNG grid of cells.
  • find_kerning / pair_kerning: pair kerning by collision (one diagonal touch, never side by side).
  • VwfFont: the font file the a816 VWF runtime reads (1bpp rows + width per glyph, kerning pairs, height).
  • render / measure: text set at build time exactly as the runtime sets it.
  • Wrapper: word wrap by pixel width, the game's control codes as data.
  • Window / WindowBuilder: fill text windows; a game's script rules drive them.
  • encode_tiles / colourize: SNES 2bpp / 4bpp planar tiles.
  • text_tiles / pack_runs: static strings pre-rendered to a bank-safe blob.

Grown from ff4's tooling: its five fonts rebuild byte for byte, its wrapping and dialog goldens pass.

uv sync
make check

Metadata

Release files for katsuji 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for katsuji 0.2.1
File Size Uploaded
katsuji-0.2.1.tar.gz 96.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for katsuji 0.2.1
File Interpreter ABI Platform
katsuji-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 124.5 kB

Release files / katsuji-0.2.1.tar.gz

Download URL katsuji-0.2.1.tar.gz
Size 96.6 kB
Tags Source
SHA-256 checksum
How to use checksums
51accdc6a7cfda9abbfcc9204491e51b7c1fca41e22f19d39c855503a3eaaa4e
BLAKE2b-256 checksum
How to use checksums
b9857a792f56bd48bd19d0b576d1cc4b029aa7b715630092b5b206a2eabc98d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.14.8"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.9 29 Sep 2026","python":"3.14.8","system":{"name":"Linux","release":"6.17.0-1022-azure"}} HTTPX2/2.13.1

Release files / katsuji-0.2.1-py3-none-any.whl

Download URL katsuji-0.2.1-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db68e83a1d3b6ffcee56c475173475f4dcd39476e6281b387f282a5037d173a5
BLAKE2b-256 checksum
How to use checksums
eaebd64a9231b6d896178b055092a992aa0776b1a255b3cbc510bb6dda6164fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.14.8"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.9 29 Sep 2026","python":"3.14.8","system":{"name":"Linux","release":"6.17.0-1022-azure"}} HTTPX2/2.13.1

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page