ferroui_base/media/fonts/
embedded_font_collection.rs1use crate::media::fonts::{FontCollectionBase, FontCollectionBaseImpl};
2use crate::utilities::Uri;
3
4pub struct EmbeddedFontCollection {
7 base: FontCollectionBase,
8 key: Uri,
9 source: Uri,
10}
11
12impl EmbeddedFontCollection {
13 pub fn new(key: Uri, source: Uri) -> Self {
16 let collection = Self { base: FontCollectionBase::new(), key, source };
17
18 FontCollectionBase::try_add_font_source(&collection, &collection.source);
19
20 collection
21 }
22}
23
24impl FontCollectionBaseImpl for EmbeddedFontCollection {
25 fn base(this: &Self) -> &FontCollectionBase {
26 &this.base
27 }
28
29 fn key(this: &Self) -> Uri {
30 this.key.clone()
31 }
32}