lotus_shared/font.rs
1use std::collections::HashMap;
2
3use serde::{Deserialize, Serialize};
4
5/// Properties of a bitmap font.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct BitmapFontProperties {
8 /// The horizontal distance between letters.
9 pub horizontal_distance: i32,
10 /// The vertical size of the font.
11 pub vertical_size: i32,
12 /// The letters in the font.
13 pub letters: HashMap<char, FontLetter>,
14}
15
16/// A letter in a bitmap font.
17#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
18pub struct FontLetter {
19 /// The character represented by the letter.
20 pub character: char,
21 /// The start of the letter in the texture.
22 pub start: u32,
23 /// The width of the letter in the texture.
24 pub width: u32,
25}