COOLJAPAN
← All posts

OxiText 0.2.2 Released — Vendored Swash Fork Fixes Two Indic Shaping Bugs, Absorbs an Unfixed Upstream Panic

OxiText 0.2.2 vendors its own fork of swash to fix a Devanagari reph-duplication bug and an out-of-bounds panic that has sat open and unfixed upstream since April 2025, adds a Pure-Rust PNG decoder to fully remove the `png`/`flate2` dependency chain, and fixes color-glyph misdetection for sbix/CBDT/SVG fonts — 845 tests passing, the sovereign text layer for the COOLJAPAN ecosystem.

release oxitext pure-rust cooljapan noffi text typography shaping indic security

An open, unfixed upstream panic in a shaping library isn’t someone else’s problem once you ship on top of it — a font you don’t control can take down your process.

Today we released OxiText 0.2.2 — a shaping-correctness release that vendors its own fork of swash, oxitext-swash, to fix a Devanagari reph-duplication bug and an out-of-bounds panic that has been open on upstream since April 2025 with no fix, no PR, and no assignee. It also finishes removing the png/flate2/miniz_oxide dependency chain from the workspace and fixes color-glyph format detection for sbix/CBDT/SVG fonts.

No C. No Fortran. No png crate anywhere in the graph anymore. OxiText compiles to a single static binary (or WASM) with no system libraries and no build-time C toolchain — Pure Rust from font bytes to rendered pixel.

Why OxiText 0.2.2 is a game changer

Complex-script shaping bugs are the kind that don’t show up in a Latin-only test suite and then take down production the day real-world text arrives:

OxiText 0.2.2 ends all of that.

Technical Deep Dive: the fork, the decoder, and where each fix lives

  1. The vendored shaping engine (oxitext-swash). A drop-in fork via a Cargo package = rename (swash = { package = "oxitext-swash", ... }), so every existing use swash::... call site across the workspace is byte-unchanged. 37 of 61 files are byte-identical to upstream; every modified file carries an OXITEXT MODIFICATION header per Apache-2.0 §4(b), and PROVENANCE.md records the full per-file divergence table.
  2. The PNG decoder (oxitext-core::png_decode). Mirrors 0.2.1’s png_encode, built on the same oxiarc_deflate/oxiarc_core stack. Normalizes every still-image PNG to straight-alpha RGBA8 across all standard color types and bit depths, rejects a declared IHDR size unless the compressed payload could plausibly reach it at deflate’s maximum expansion ratio, and was cross-validated against 235 real-world PNGs (byte-identical to Pillow’s decode) plus a 13-million-execution fuzz run with zero crashes.
  3. Color-glyph rendering (oxitext-raster, oxitext facade). Pipeline::render/render_to_image now reach CBDT/CBLC and sbix strikes in the default build, and SVG glyphs behind a new opt-in svg-glyphs feature — all three were previously either misdetected or had no code path to actually render once detected.
  4. Fuzz coverage. Two new cargo-fuzz targets, sdf_atlas_from_bytes and cbdt_bitmap, join the workspace’s existing fuzz suite, targeting the byte-slice parsers that read untrusted font and image data directly.

Getting Started

cargo add oxitext

The published, compile-checked quick-start example (crates/oxitext/examples/quick_start.rs, new in this release):

use oxitext::Pipeline;

let font_data = std::fs::read("MyFont.ttf")?;
let mut pipeline = Pipeline::from_bytes(&font_data, 0)?;

let metrics = pipeline.measure("Hello, OxiText!", 32.0)?;
println!("{}x{}", metrics.total_width, metrics.total_height);

let bitmap = pipeline.render_to_image(
    "Hello, OxiText!",
    32.0,
    [255, 255, 255, 255], // background
    [0, 0, 0, 255],       // text color
)?;
# Ok::<(), Box<dyn std::error::Error>>(())

Shaping Devanagari or any other complex script directly? The fix lives entirely inside oxitext-swash — no API changes are needed on your side to pick it up; a version bump is the whole migration.

What’s New in 0.2.2

Tips

This is the foundation

OxiText is part of NoFFI — the COOLJAPAN initiative replacing every C/C++/Fortran/-sys dependency in the Rust ecosystem with a clean, memory-safe, Pure-Rust implementation. A release that removes an unfixed upstream panic from the dependency graph, rather than working around it downstream, is exactly what that initiative is for. It pairs with OxiFont for font parsing and discovery, and sits underneath OxiUI (every widget, via the oxitext-sdf GPU glyph atlas), oximedia (subtitles and captions), and every other COOLJAPAN surface that shapes or rasterizes text — including a caption pipeline that depends on it directly for Japanese subtitle rendering.

Repository: https://github.com/cool-japan/oxitext

Star the repo if you want a text stack where an unfixed upstream panic gets absorbed and fixed, not shipped through to your users.

The era of trusting a shaping library’s happy path because your test suite is Latin-only is over. Pure Rust typography — sovereign, safe, and now provably free of dfrg/swash#93 — is here.

KitaSan at COOLJAPAN OÜ August 6, 2026

↑ Back to all posts