use {
super::bitmap::Bitmap,
serde::{Deserialize, Serialize},
};
#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct BitmapFont {
def: String,
pages: Vec<Bitmap>,
}
impl BitmapFont {
pub fn new(def: String, pages: Vec<Bitmap>) -> Self {
Self { def, pages }
}
pub fn def(&self) -> &str {
self.def.as_str()
}
pub fn pages(&self) -> impl ExactSizeIterator<Item = &Bitmap> {
self.pages.iter()
}
}