Home

Awesome

swash

Swash is a pure Rust, cross-platform crate that provides font introspection, complex text shaping and glyph rendering.

Crates.io Docs.rs MIT licensed Apache licensed

Goals

This crate aims to lay the foundation for a cross-platform, high performance set of components for beautiful typography. In particular, this library focuses on fonts and operations that are directly applicable to them. For the most part, the desire is to be unopinionated with respect to resource management, higher level layout and lower level rendering.

Non goals

Due to the intention of being generally useful and easy to integrate, the following areas of related interest are specifically avoided:

General features

Introspection

Complex text shaping

Scaling

Text analysis

Performance

Performance is a primary goal for this crate and preliminary microbenchmarks show a general improvement over FreeType and Harfbuzz by about 10-20% on average and some cases show substantial wins, particularly when scaling Postscript outlines or shaping text with complex features. Specifically, shaping runs with fonts like Calibri and Noto Sans Myanmar is almost twice as fast. Simple fonts and pure ASCII runs tend to show the smallest gains as those simply measure shaper initialization and glyph iteration. A comprehensive set of benchmarks (and test cases!) are needed here to gain more insight and track regressions.

Contributing

Contributions are welcome and appreciated! All contributions must be granted under the licenses under which this project is released.