This crate is a Rust implementation of the signed distance field generation techniques
demonstrated by Valve
The generic interface works with any bitmap, and a high level interface enables easy operation
with FreeType faces when the optional
freetype feature is enabled.
The approach taken by this crate is similar to TinySDF; it works from a raster bitmap rather than directly from vector outlines. This keeps the crate simple and allows it to be used generically with any bitmap. The SDF is calculated using the same algorithm described in this paper by Felzenszwalb & Huttenlocher.
Rather than re-invent the rasterisation process for fonts, this crate relies on FreeType to generate the bitmap. This is quite fast (we’re talking µs/glyph), and the results are almost always indistinguishable from the more sophisticated vector-based approach of sdf-glyph-foundry.
- A raw bitmap containing only the alpha channel.
- Compresses a