#[derive(Debug, Clone, Copy)]
pub struct TextMetrics {
pub ascender: f32,
pub descender: f32,
pub line_height: f32,
}
#[derive(Debug, Clone, Copy)]
pub struct TextBounds {
pub advance: f32,
pub bounds: [f32; 4],
}
impl TextBounds {
pub fn width(&self) -> f32 {
self.bounds[2] - self.bounds[0]
}
pub fn height(&self) -> f32 {
self.bounds[3] - self.bounds[1]
}
}
#[derive(Debug, Clone, Copy)]
pub struct GlyphPosition {
pub byte_index: usize,
pub x: f32,
pub min_x: f32,
pub max_x: f32,
}
#[derive(Debug, Clone)]
pub struct TextRow {
pub start: usize,
pub end: usize,
pub next: usize,
pub width: f32,
pub min_x: f32,
pub max_x: f32,
}