use crate::richtext::marks::AppliedStyle;
use super::TextAlign;
#[derive(Debug, Clone)]
pub struct LineSegment {
pub text: String,
pub x_offset_mm: f64,
pub style: AppliedStyle,
pub font_size: f64,
pub letter_spacing_mm: f64,
}
#[derive(Debug, Clone)]
pub struct LineBox {
pub segments: Vec<LineSegment>,
pub height_mm: f64,
pub width_mm: f64,
pub alignment: TextAlign,
}
impl LineBox {
pub fn total_width_mm(&self) -> f64 {
self.width_mm
}
pub fn is_empty(&self) -> bool {
self.segments.is_empty() || self.segments.iter().all(|s| s.text.trim().is_empty())
}
}