Takumi
Takumi is a library with different parts to render your React components to images. This crate contains the core logic for layout, rendering.
Checkout the Quick Start if you are looking for napi-rs / WASM bindings.
Example
use ;
// Create a node tree with `ContainerNode` and `TextNode`
let mut 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 = default
.viewport
.node
.global
.build
.unwrap;
// 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: