pub struct FontDatabase { /* private fields */ }Expand description
Global Thread-Safe Font Database managing OpenType font faces.
Implementations§
Source§impl FontDatabase
impl FontDatabase
pub fn new() -> Self
Sourcepub fn register_font_data(
&self,
family: &str,
data: &[u8],
) -> Result<Arc<OpenTypeFont>, OpenTypeParseError>
pub fn register_font_data( &self, family: &str, data: &[u8], ) -> Result<Arc<OpenTypeFont>, OpenTypeParseError>
Registers font data for a specific family name.
Sourcepub fn query_font(
&self,
family_name: &str,
weight: FontWeight,
style: FontStyle,
) -> Option<Arc<OpenTypeFont>>
pub fn query_font( &self, family_name: &str, weight: FontWeight, style: FontStyle, ) -> Option<Arc<OpenTypeFont>>
Queries the best matching OpenType font face for family, weight, and style.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FontDatabase
impl Forget for FontDatabase
impl Move for FontDatabase
impl RefUnwindSafe for FontDatabase
impl Send for FontDatabase
impl Sync for FontDatabase
impl Unpin for FontDatabase
impl UnsafeUnpin for FontDatabase
impl UnwindSafe for FontDatabase
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