pastry
truetype font renderer
README.md
1492 bytes raw
pastry
pastry is a tiny truetype font renderer written in pure c99. it’s made to be simple, lightweight, and memory-friendly, which is perfect for embedded systems, games, or apps where big engines like freetype feel overkill.
features
- single-file library
- solid truetype support
- memory efficient
- no external dependencies
- cross platform
- handles compound glyphs
- supports unicode bmp (0x0000–0xffff)
- hinting support*
- ligature support*
- affine transforms (scaling, translation, limited rotation)

limitations
- no runtime truetype bytecode hinting. pastry just renders the outlines directly from the font. most modern fonts are pre-hinted anyway, so you're probably fine
- no text layout or substitution (like auto-turning
f+iintofi), but if your system provides the pre-composed ligature glyph, pastry will render it perfectly - no opentype features (like contextual alternates, glyph substitution, or positioning)
- no font collection handling. pastry just loads the full font file — you can’t pick individual weights or styles from a collection
- no support for color glyphs (colr/cpal), variable fonts, or characters outside the bmp (so, no emoji)
- only supports cmap tables 4, 6, 12, and 13, plus simple/compound glyf outlines
- only has its own fixed grayscale anti-aliasing method
usage
look at demo.c for a usage example — the api is designed to be pretty simple, tbh.