# HarfRust

> A Rust port of the HarfBuzz text shaping engine.

Source: https://talira.ai/catalog/harfrust-5n8vcc2s
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / text / shaping](https://talira.ai/categories/libraries/text/shaping), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT[^2][^3]
- Pricing: Free and open source[^2][^3]
- Free tier: yes[^2][^3]
- Self-hostable: yes[^2]
- Backed by: [HarfBuzz](https://talira.ai/orgs/harfbuzz.md)

HarfRust is the HarfBuzz project's port of its text shaping engine to Rust: it turns a run of Unicode text and an OpenType font into positioned glyphs, applying the font's GSUB and GPOS rules and the script-specific shapers for Arabic, Indic, Khmer, Myanmar, Hangul and others. It started as a fork of RustyBuzz, reads fonts with read-fonts from Google's fontations (the parser under [Skrifa](https://talira.ai/catalog/skrifa-aj7qcsk8.md)), tracks a specific HarfBuzz release and mostly passes HarfBuzz's own test and fuzzing suites. The library has no unsafe code. A C API (`harfrust_capi`) mirrors HarfBuzz's shaping API with an `hr_` prefix, and the `hr-shape` command-line tool shapes text and can trace each shaping step.

## Links

- GitHub: https://github.com/harfbuzz/harfrust
- Docs: https://docs.rs/harfrust

## Problems it solves

- shape Arabic, Hindi or Thai text into correctly joined and reordered glyphs in pure Rust
- turn a Unicode string and an OpenType font into glyph IDs and positions for my renderer
- apply kerning, ligatures and OpenType features like small caps when laying out text in Rust
- replace HarfBuzz C bindings in my Rust app with memory-safe code that gives the same shaping
- my PDF generator draws Devanagari and Arabic text with broken letterforms
- shape text against variable fonts at specific axis settings in Rust
- a no_std text shaping engine for an embedded or WebAssembly target
- debug why a font shapes a string wrongly by tracing every lookup applied
- call a memory-safe HarfBuzz-compatible shaper from C or C++ code
- shape text from the command line to compare glyph output between fonts

## Features

- port of HarfBuzz's shaping and Unicode routines, tracking a named HarfBuzz release
- OpenType GSUB and GPOS layout with script-specific shapers
- fonts parsed with read-fonts from fontations, shared with skrifa
- variable font support through font variation coordinates
- opt-in tracing of every shaping step, compatible with no_std
- hr-shape command-line tool with a --trace option
- C API (harfrust_capi) mirroring HarfBuzz's hb_ API as hr_, linkable alongside HarfBuzz
- passes most of HarfBuzz's test and fuzzing suites
- no unsafe code in the library
- no_std support with libm

## Limitations

- Doesn't support Graphite fonts: only OpenType shaping is ported from HarfBuzz[^1]
- Doesn't take a font size: shaping always works in font units (units per em) and you scale the results yourself[^1]
- Doesn't integrate with FreeType, CoreText, DirectWrite, ICU or GLib: fonts are parsed with read-fonts and the Unicode functions are its own[^1]
- Doesn't fall back on malformed fonts: it returns an error where HarfBuzz uses a fallback shaper[^1]
- Doesn't subset fonts: HarfBuzz's subsetter is ported separately as skera in fontations[^1]

## Capabilities

- Has a command line tool: plan not known
- Has official SDKs: plan not known

## Trust

Overall: 0.32 out of 1.
Signals: backing 0.30, extensibility 0.20.

- backed by HarfBuzz

Warnings:

- GitHub activity not fetched yet

## Sources

[^1]: https://github.com/harfbuzz/harfrust/blob/main/README.md (checked 20 Nov 2026)
[^2]: https://crates.io/crates/harfrust (checked 20 Nov 2026)
[^3]: https://github.com/harfbuzz/harfrust/blob/main/LICENSE (checked 20 Nov 2026)
