animate/runtime/lottie/model/
font_character.rs

1use super::content::ShapeGroup;
2
3pub struct FontCharacter {
4    shapes: Vec<ShapeGroup>,
5    character: String,
6    size: f64,
7    width: f64,
8    style: String,
9    font_family: String,
10}
11
12impl FontCharacter {
13    pub fn new(
14        shapes: Vec<ShapeGroup>,
15        character: String,
16        size: f64,
17        width: f64,
18        style: String,
19        font_family: String,
20    ) -> Self {
21        Self {
22            shapes,
23            character,
24            size,
25            width,
26            style,
27            font_family,
28        }
29    }
30
31    pub fn hash_for(character: &str, font_family: &str, style: &str) -> u64 {
32        unimplemented!()
33    }
34
35    fn get_hash_code(&self) -> u64 {
36        FontCharacter::hash_for(&self.character, &self.font_family, &self.style)
37    }
38}
39
40impl PartialEq for FontCharacter {
41    fn eq(&self, other: &Self) -> bool {
42        self.character == other.character
43            && self.size == other.size
44            && self.width == other.width
45            && self.style == other.style
46            && self.font_family == other.font_family
47    }
48}
49
50impl Eq for FontCharacter {}