#typography #wgpu #gpu #graphics #rendering

bin+lib zentype

A high-performance modular text rendering engine for Rust

2 releases

0.1.0-alpha.2 Apr 19, 2026

#511 in Graphics APIs

Apache-2.0

65KB
1.5K SLoC

Zentype 🔤

Designer-grade typography for Rust applications with zero fuss.

A high-performance, modular text rendering engine built on wgpu, cosmic-text, and swash. Zentype provides a professional styling API that makes symmetric highlights and multi-axis alignment as trivial as CSS.


✨ Features

  • Layered API — Use the managed Zentype struct, the semi-managed TextRenderer, or raw GPU primitives.
  • Symmetric Padding — 4-way individual control (.padding_left(), .padding_top(), etc.) for professional highlights.
  • Multi-Axis Alignment — Sticky horizontal and vertical alignment with automated "Safe Area" insets.
  • Smart Wrapping — Built on cosmic-text for full bi-directional text, font fallbacks, and complex script support.
  • Instanced GPU Pipeline — Thousands of characters rendered in a single draw call via instanced quads.
  • Modular Traits — Every component (FontProvider, Rasterizer, Atlas) is a swappable trait.

🚀 Quick Start

Add Zentype to your project:

[dependencies]
zentype = "0.1.0-alpha.2"

Rendering Hero Text

use zentype::prelude::*;

VisualTester::run(|font_system, buffer| {
    let options = TextOptions::new()
        .font_size(32.0)
        .color(Color::WHITE)
        .padding(20.0)
        .padding_horizontal(60.0)
        .bg(Color::GREEN)
        .align(HorizontalAlignment::Center)
        .valign(VerticalAlignment::Center);

    options.apply(font_system, buffer);
    buffer.set_text(font_system, "Zentype", &options.as_attrs(), Shaping::Advanced, None);
});

🏗️ Architecture

Zentype is built to be a "Bring-Your-Own-X" library. Use our battle-tested defaults or swap in your own components:

let renderer = TextRenderer::builder()
    .font_provider(MyCustomProvider::new())
    .rasterizer(SwashRasterizer::new())
    .atlas(ZentypeAtlas::new(&device))
    .build(&device, &queue, &config);

📖 Documentation

For a deep dive into the engine, check out our Documentation Site:


⚔️ How Zentype Compares

Library Level Limitation
Glyphon / Glyphon-text High Too opinionated, restricts control
wgpu_text High Basic, no real layout control
ab_glyph Low No shaping (no RTL, no fallbacks)
Zentype Any None — you choose your level

📜 License

Apache 2.0 — see LICENSE

Part of the Zentype UI Framework suite.

Dependencies

~24–46MB
~639K SLoC