Takumi
Takumi is a library with different parts to render UI component trees to images. This crate contains the core logic for layout and rendering.
Checkout the Quick Start if you are looking for napi-rs / WASM bindings.
Example
use ;
// Create a node tree with `Node::container` and `Node::text`
let node = container;
// Create a context for storing resources, font caches.
// You should reuse the context to speed up the rendering.
let mut global = default;
// Load fonts
global.font_context.load_and_store;
// Create a viewport
let viewport = new;
// Create render options
let options = builder
.viewport
.node
.global
.build;
// Render the layout to an `RgbaImage`
let image = render.unwrap;
Feature Flags
woff2: Enable WOFF2 font support.woff: Enable WOFF font support.svg: Enable SVG support.rayon: Enable rayon support.
Credits
Takumi wouldn't be possible without the following works: