daegun - A text and shaping engine for Rust and C, no dependencies
by•
Drawing text takes a font parser, a shaper, line layout and a rasterizer. daegun is all four in one Rust library with a C API: complex scripts, variable and color fonts, hinting, subsetting. no_std, zero dependencies, MIT. For editors, games, PDFs and UIs.

Replies
Getting text on screen usually means stitching several libraries together, each with its own build system, its own C dependencies and decades of legacy. I wanted one library that does the whole job, read the font, shape the string, lay out the lines, and hand back pixels or outlines, without that friction, and better wherever I could make it better.
So daegun has:
- No dependencies at all. The supply chain is the Rust compiler and nothing else.
- A C API beside the Rust one, not a wrapper behind it. Every Rust call is reachable from C, bar a handful.
- No unsafe code in the engine. A font file is data from strangers, so 2,000 mutated fonts go through it before every release.
- No legacy formats. TrueType and OpenType, variable and color fonts. Formats older than OpenType, like Type 1 and BDF, are refused on purpose.
It shapes Arabic, Hebrew, Thai, Hangul, the Indic scripts and 91 more, breaks lines greedy or optimal, and rasterizes on the CPU itself. Drawing on the GPU instead? It hands your renderer what it needs: quadratic curves for shaders, outlines or polygons, whichever your pipeline takes.
It's for anyone drawing text in Rust or C: editors, games, UI toolkits, PDF tools. My own daepdf runs on it.
What would help most:
1. A font or a string that comes out wrong. Send me both and I'll look into it.
2. Where the API tripped you up on your first try.
3. What's missing for what you're building.
Docs, with an example for every function: https://zztaeha.dev/daegun/
Source: https://github.com/zztaeha/daegun/