(Working in progress) [查看中文版本]
Huozi (Rust) is a new generation version of huozi.js. Unlike the latter, it is implemented in Rust and has the following features:
- Renders glyphs using SDF (Signed Distance Field) technology
- Dynamic SDF glyph generation and caching, supporting rendering up to 1024 different glyphs simultaneously
- Supports various typography effects, including stroke, shadow, etc.
- Supports multiple font formats, including TTF, OTF
- Supports various text effects, including underline, strikethrough, color, etc. (under development)
- Outputs as images or textures, and provides vertex coordinates and texture coordinates for easy integration with any rendering engine
- Implements W3C Requirements for Chinese Text Layout, including inline punctuation compression, inline quote position correction, etc. (under development)
Run cargo run --example render --release to see the following GUI window:
- Glyph generation and caching
- WGPU rendering example
- Stroke, Shadow
- Multiple font formats
- Multiple fonts, Font Fallback
- Color
- Underline, Strikethrough
- Emphasis marks, Wavy underline
- Output as image or texture, providing vertex and texture coordinates
- W3C Chinese Layout Requirements (Punctuation hanging, Punctuation squeezing)
- Ligatures
- Oblique, bold
- Supports Windows, macOS, Linux, Android, iOS, Web (WebAssembly) platforms
Still in the early stages of development, especially with a high lack of typesetting features. Any Issues and Pull Requests are welcome!
Any translation is welcome!
See the examples directory.
