pub struct FontKit { /* private fields */ }Implementations
sourceimpl FontKit
impl FontKit
sourcepub fn add_font_from_buffer(
&mut self,
buffer: Vec<u8>
) -> Result<FontKey, Error>
pub fn add_font_from_buffer(
&mut self,
buffer: Vec<u8>
) -> Result<FontKey, Error>
Add a font from a buffer. This will load the font and store the font
buffer in FontKit. Type information is inferred from the magic number
using infer crate
sourcepub fn search_fonts_from_path(
&mut self,
path: impl AsRef<Path>
) -> Result<(), Error>
pub fn search_fonts_from_path(
&mut self,
path: impl AsRef<Path>
) -> Result<(), Error>
Recursively scan a local path for fonts, this method will not store the font buffer to reduce memory consumption
pub fn to_fontdb(&self) -> Result<Database, Error>
pub fn query(&self, key: &FontKey) -> Option<&Font>
Auto Trait Implementations
impl RefUnwindSafe for FontKit
impl Send for FontKit
impl Sync for FontKit
impl Unpin for FontKit
impl UnwindSafe for FontKit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more