pub struct FontManager<Font> { /* private fields */ }Expand description
Shared, thread-safe handle to a font storage implementation.
Implementations§
Source§impl<Font> FontManager<Font>
impl<Font> FontManager<Font>
Sourcepub fn new<Holder: FontsHolder<Font> + 'static>(font_data: Holder) -> Self
pub fn new<Holder: FontsHolder<Font> + 'static>(font_data: Holder) -> Self
Creates a new manager from a concrete font holder.
Sourcepub fn leak(self) -> &'static Self
pub fn leak(self) -> &'static Self
Leaks the manager and returns a 'static reference to it.
This is an advanced escape hatch for global callback-driven integrations. Most applications should prefer regular owned values.
Sourcepub fn get_fonts(&self) -> FontsGuard<'_, Font>
pub fn get_fonts(&self) -> FontsGuard<'_, Font>
Returns read-only access to the underlying holder.
§Panics
Panics if the internal RwLock is poisoned.
Sourcepub fn delete_font(&self, index: usize)
pub fn delete_font(&self, index: usize)
Auto Trait Implementations§
impl<Font> !Send for FontManager<Font>
impl<Font> !Sync for FontManager<Font>
impl<Font> Freeze for FontManager<Font>
impl<Font> RefUnwindSafe for FontManager<Font>
impl<Font> Unpin for FontManager<Font>
impl<Font> UnsafeUnpin for FontManager<Font>
impl<Font> UnwindSafe for FontManager<Font>
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