# 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)

![screenshot of some sample text](demo.png)

## 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` + `i` into `ﬁ`), 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 &mdash; 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 &mdash; the api is designed to be pretty simple, tbh.
