# fontsdf [![dependency status](https://deps.rs/repo/github/Overpeek/fontsdf/status.svg)](https://deps.rs/repo/github/Overpeek/fontsdf) [![build status](https://github.com/Overpeek/fontsdf/actions/workflows/rust.yml/badge.svg)](https://github.com/Overpeek/fontsdf/actions) [![crates.io](https://img.shields.io/crates/v/fontsdf.svg?label=fontsdf)](https://crates.io/crates/fontsdf) [![docs.rs](https://docs.rs/fontsdf/badge.svg)](https://docs.rs/fontsdf/)

Signed Distance Field (SDF) textures can be used to render text or other vector art more flexibly[1], with higher quality while using less video memory (for the texture).

[1] For example:

Example usage with image:

```rust let font = fontsdf::Font::from_bytes(..).unwrap();

let (metrics, sdf) = font.rasterize('x', 64.0, true); image::GrayImage::fromraw(metrics.width as _, metrics.height as _, sdf) .unwrap() .save("sdfx.png") .unwrap(); ```

Example output:

Normal

SDF

TODO: