pub struct InMemoryFontLoader { /* private fields */ }Expand description
Loads fonts from an in process map keyed by file name.
Implementations§
Source§impl InMemoryFontLoader
impl InMemoryFontLoader
Sourcepub fn with_font(
self,
file: impl Into<String>,
bytes: impl Into<Arc<[u8]>>,
) -> Self
pub fn with_font( self, file: impl Into<String>, bytes: impl Into<Arc<[u8]>>, ) -> Self
Adds a font by file name and returns the loader.
Sourcepub fn insert(
&mut self,
file: impl Into<String>,
bytes: impl Into<Arc<[u8]>>,
) -> FontKey
pub fn insert( &mut self, file: impl Into<String>, bytes: impl Into<Arc<[u8]>>, ) -> FontKey
Adds or replaces a font by file name and returns its key, keys are never reused.
Sourcepub fn insert_font_data(&mut self, file: impl Into<String>, font: FontData)
pub fn insert_font_data(&mut self, file: impl Into<String>, font: FontData)
Adds or replaces a font the host built, keeping the host’s key.
Trait Implementations§
Source§impl Clone for InMemoryFontLoader
impl Clone for InMemoryFontLoader
Source§impl Debug for InMemoryFontLoader
impl Debug for InMemoryFontLoader
Source§impl Default for InMemoryFontLoader
impl Default for InMemoryFontLoader
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryFontLoader
impl !UnwindSafe for InMemoryFontLoader
impl Freeze for InMemoryFontLoader
impl Send for InMemoryFontLoader
impl Sync for InMemoryFontLoader
impl Unpin for InMemoryFontLoader
impl UnsafeUnpin for InMemoryFontLoader
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