use kurbo::Affine;
use peniko::{Brush, FontData};
#[derive(Clone, Debug)]
pub struct FontHandle(FontData);
impl FontHandle {
pub fn new(font: FontData) -> Self {
Self(font)
}
pub fn font(&self) -> &FontData {
&self.0
}
}
impl From<FontData> for FontHandle {
fn from(font: FontData) -> Self {
Self::new(font)
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Glyph {
pub id: u32,
pub x: f32,
pub y: f32,
}
#[derive(Clone, Debug)]
pub struct GlyphRun {
pub font: FontHandle,
pub font_size: f32,
pub brush: Brush,
pub transform: Affine,
pub glyphs: Vec<Glyph>,
}