Move text layout and rendering to Parley

This commit is contained in:
iris committed 2026-09-13 01:04:49 -04:00
1 parent fc1ba3cdc3
commit f659e319ff
19 files changed
+1333 -798

No files matched your search

+17
View File
@@ -202,6 +202,7 @@ impl PrimitiveHandle {
primitives!(
rects: RectPrimitive => 0,
textures: TexturePrimitive => 1,
glyphs: GlyphPrimitive => 2,
);
#[repr(C)]
@@ -231,6 +232,22 @@ pub struct TexturePrimitive {
pub sampler_idx: u32,
}
/// An atlas subrectangle, tinted for masks or unchanged for color glyphs.
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GlyphPrimitive {
pub uv_min: [f32; 2],
pub uv_max: [f32; 2],
pub view_idx: u32,
pub sampler_idx: u32,
pub color: Color<u8>,
pub flags: u32,
}
impl GlyphPrimitive {
pub const IS_COLOR: u32 = 1;
}
pub struct PrimitiveVec<T> {
vec: Vec<T>,
free: Vec<usize>,