use super::font::GlyphCode;
use super::geometry::{Point, Rect, Size};
#[derive(Debug, Default, Clone, Copy, PartialEq)]
pub struct ForeignMetrics {
pub width: f32,
pub ascent: f32,
pub descent: f32,
}
#[derive(Debug, Default, Clone, PartialEq)]
pub struct NodeLayout {
pub location: Point,
pub size: Size,
pub baseline: f32,
pub fragments: Vec<Fragment>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum Fragment {
Glyphs {
origin: Point,
font_size: f32,
glyphs: Vec<PositionedGlyph>,
},
Rule(Rect),
DashedRule(Rect),
Line {
start: Point,
end: Point,
thickness: f32,
},
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct PositionedGlyph {
pub glyph: GlyphCode,
pub offset: Point,
pub cluster: u32,
}