zenith-scene 0.0.0-beta.1

Zenith backend-neutral scene IR and compilation (geometry, text wrap, anchors, opacity, clip).
Documentation

Backend-neutral scene IR and scene compilation for Zenith.

Owns the display-list primitives (FillRect, DrawGlyphRun, PushClip, etc.), scene compilation from a validated AST into a z-ordered display list, opacity/visibility/clip resolution, and exclusion of non-printing nodes.

This crate is the stable contract boundary that every future backend — GPU, PDF, SVG export — will consume.

Module layout

  • ir — scene IR types (Scene, SceneCommand, Color, SceneGlyph).
  • color — sRGB hex parsing → Color.
  • compilecompile(&Document, &dyn FontProvider) -> CompileResult.

Quick start

use zenith_scene::{Scene, SceneCommand, Color, Paint};

let mut scene = Scene::new(640.0, 360.0);
scene.commands.push(SceneCommand::FillRect {
    x: 0.0, y: 0.0, w: 640.0, h: 360.0,
    paint: Paint::solid(Color::srgb(248, 250, 252, 255)),
});
let json = scene.to_json().expect("serializes");
assert!(json.contains("zenith-scene-v1"));

Compile a parsed document into a scene with compile.