Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 2.97 KB

File metadata and controls

58 lines (44 loc) · 2.97 KB

huóRust

A simple typography engine for CJK languages, especially designed for game rich-text.

(Working in progress) [查看中文版本]

docs.rs

Overview

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)

GUI Debugger

Run cargo run --example render --release to see the following GUI window:

huozi gui debugger

Roadmap

  • 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!

Usage

See the examples directory.