I have just released daegun 1.0.0
Putting text on screen normally means assembling a stack: one crate reads the font, another shapes the script, another rasterizes, another subsets. Each brings its own dependency tree, and they do not always agree about what a glyph is. daegun is all of that in one crate.
[dependencies]
daegun = "1.0.0"
It parses TrueType, CFF, CFF2 and variable fonts, shapes with GSUB and GPOS in full plus Apple morx and kerx, handles bidi and line breaking and justification, hints, rasterizes on the CPU or the GPU, and subsets a font down to the glyphs a page actually uses.
Two constraints shaped most of it:
No dependencies at all. The supply chain is rustc and nothing else. no_std with alloc; std is a default feature you can turn off. MSRV is 1.97.1, edition 2024.
forbid(unsafe) in every parser and in the shaper, so an inner allow is a hard error rather than a warning. A font file is data from strangers and I wanted the compiler enforcing that rather than my own review. Only the GPU backends and the C layer opt back in, and they say so at the top of their own files.
One thing that turned out interesting: the CPU rasterizer accumulates signed area per scanline and the GPU one casts two rays per sample in the shader. Two entirely different algorithms, so there is a test that renders the same outline both ways and holds them to a tolerance. It caught a real bug where overlapping contours double counted antialiased edge pixels.
There is also a C ABI beside the Rust API, checked for parity on every build: if a Rust call stops being reachable from C, the build fails.
Docs: https://dg.calia.cc
Source: GitHub - silly-tae/daegun: Your all-in-one text engine. Rust, no_std, zero dependencies · GitHub
Note: Heavy use of AI was involved in the project to speed up testing, development, etc.
No such thing as "claude skiddadle this, make no mistakes" lmao
Manual code review is done constantly, along with constant testing and confirmations as well as improving things in general.
Feedback very welcome, particularly from anyone who has fought shaping or subsetting before. Those are the parts I would most like to have wrong pointed out.