Type | Description |
|---|---|
VelloRenderer<'a> | Implements fission_render::Renderer. Writes display ops into a Vello Scene using the current affine transform stack. Handles rectangles, text, rich text (with per-run styling and background highlights), images, SVG paths, inline SVG, and box shadows. |
VelloTextMeasurer | Implements fission_layout::TextMeasurer. Wraps a Parley FontContext and LayoutContext with an LRU-style layout cache (4096 simple entries, 2048 rich entries). Provides measure, measure_rich_text, hit_test, get_line_metrics, and get_caret_position. |
ParleyBrush | A simple [u8; 4] RGBA brush type used as the generic parameter for parley::layout::Layout. |
use fission_render_vello::{VelloRenderer, VelloTextMeasurer};
use parley::FontContext;
use std::sync::{Arc, Mutex};
use vello::Scene;
// Set up text measurement
let font_cx = Arc::new(Mutex::new(FontContext::new()));
let measurer = Arc::new(VelloTextMeasurer::new(font_cx));
// Render a frame
let mut scene = Scene::new();
let mut renderer = VelloRenderer::new(&mut scene, measurer, 2.0 /* scale factor */);
renderer.render(&display_list)?;
// `scene` is now ready to be submitted to a Vello `Renderer` backed by wgpu.
Type | Description |
|---|---|
VelloRenderer<'a> | Implements fission_render::Renderer. Writes display ops into a Vello Scene using the current affine transform stack. Handles rectangles, text, rich text (with per-run styling and background highlights), images, SVG paths, inline SVG, and box shadows. |
VelloTextMeasurer | Implements fission_layout::TextMeasurer. Wraps a Parley FontContext and LayoutContext with an LRU-style layout cache (4096 simple entries, 2048 rich entries). Provides measure, measure_rich_text, hit_test, get_line_metrics, and get_caret_position. |
ParleyBrush | A simple [u8; 4] RGBA brush type used as the generic parameter for parley::layout::Layout. |
use fission_render_vello::{VelloRenderer, VelloTextMeasurer};
use parley::FontContext;
use std::sync::{Arc, Mutex};
use vello::Scene;
// Set up text measurement
let font_cx = Arc::new(Mutex::new(FontContext::new()));
let measurer = Arc::new(VelloTextMeasurer::new(font_cx));
// Render a frame
let mut scene = Scene::new();
let mut renderer = VelloRenderer::new(&mut scene, measurer, 2.0 /* scale factor */);
renderer.render(&display_list)?;
// `scene` is now ready to be submitted to a Vello `Renderer` backed by wgpu.