Crates.io | harfrust |
lib.rs | harfrust |
version | 0.3.1 |
created_at | 2025-06-10 14:00:10.796202+00 |
updated_at | 2025-09-12 19:42:26.384052+00 |
description | A complete HarfBuzz shaping algorithm port to Rust. |
homepage | |
repository | https://github.com/harfbuzz/harfrust |
max_upload_size | |
id | 1707132 |
size | 1,624,391 |
HarfRust is a Rust port of HarfBuzz text shaping engine. See Major changes below for major differences between HarfRust and HarfBuzz.
HarfRust started as a fork of RustyBuzz to explore porting from ttf-parser
to
read-fonts
to avoid shipping (and maintaining)
multiple implementations of core font parsing for skrifa
consumers.
Further context in https://github.com/googlefonts/fontations/issues/956.
Matches HarfBuzz v11.4.5.
https://github.com/googlefonts/oxidize outlines Google Fonts motivations to try to migrate font production and consumption to Rust.
read-fonts
.graphite2
library support.mort
table is not supported, since it's deprecated by Apple.graphite
font support.The following conformance issues need to be fixed:
HarfRust is less than 25% slower than HarfBuzz on most common fonts. For a comparison see this spreadsheet.
You can run cargo bench
to see the performance of HarfRust on your machine.
HarfRust is not a full port of HarfBuzz. HarfBuzz (C++ edition) can roughly be split into 6 parts:
read-fonts
klippa
fontations
where appropriate (e.g. int set)The library is completely safe.
There are no unsafe
in this library and in most of its dependencies (excluding bytemuck
).
For notes on the backporting process of HarfBuzz code, see docs/backporting.md.
For notes on generating state machine using ragel
, see docs/ragel.md.
The following HarfBuzz studies are relevant to HarfRust development:
HarfRust is licensed under the MIT license.
HarfBuzz is licensed under the Old MIT