pub struct FontManager {
pub max_frames_not_used: usize,
/* private fields */
}Expand description
Manages fonts, loading and caching them as needed.
Fields§
§max_frames_not_used: usizeImplementations§
Source§impl FontManager
impl FontManager
pub fn new() -> Self
Sourcepub fn get(&mut self, asset: &'static FontAsset) -> Option<&Font>
pub fn get(&mut self, asset: &'static FontAsset) -> Option<&Font>
Get a cached font by its asset key.
Sourcepub fn get_default(&self) -> Option<&Font>
pub fn get_default(&self) -> Option<&Font>
Get the default font (set via load_default).
Returns None if no default font has been set.
Sourcepub async fn load_default(asset: &'static FontAsset)
pub async fn load_default(asset: &'static FontAsset)
Load the default font. Stored outside the cache and never evicted.
Sourcepub async fn ensure(asset: &'static FontAsset)
pub async fn ensure(asset: &'static FontAsset)
Ensure a font is loaded (no-op if already cached).
pub fn clean(&mut self)
Auto Trait Implementations§
impl Freeze for FontManager
impl RefUnwindSafe for FontManager
impl Send for FontManager
impl Sync for FontManager
impl Unpin for FontManager
impl UnsafeUnpin for FontManager
impl UnwindSafe for FontManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more