use crate::backend::render::{RenderBackend, ShapeHandle}; type Error = Box; pub struct Font { glyphs: Vec, } impl Font { pub fn from_swf_tag(renderer: &mut dyn RenderBackend, tag: &swf::Font) -> Result { let mut glyphs = vec![]; for glyph in &tag.glyphs { let shape_handle = renderer.register_glyph_shape(glyph); glyphs.push(shape_handle); } Ok(Font { glyphs }) } pub fn get_glyph(&self, i: usize) -> Option { self.glyphs.get(i).cloned() } }