1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
use std::path::PathBuf; use std::collections::BTreeMap; use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FontMetadata { pub atlas_path: PathBuf, pub atlas_width: u32, pub atlas_height: u32, pub line_height: u32, pub glyphs: BTreeMap<String, GlyphMetadata>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GlyphMetadata { pub x: u32, pub y: u32, pub width: u32, pub height: u32, pub hori_bearing_x: i32, pub hori_bearing_y: i32, pub advance_x: i32, pub advance_y: i32, }