pub struct OwnedFont { /* private fields */ }Expand description
An owned font face that can be shared across threads.
Wraps the raw font data and a parsed ttf_parser::Face behind an Arc
so clones are cheap. The rustybuzz::Face is created on-demand during
shaping since it borrows from the data.
Implementations§
Source§impl OwnedFont
impl OwnedFont
Sourcepub fn from_bytes(data: Vec<u8>, face_index: u32) -> Option<Self>
pub fn from_bytes(data: Vec<u8>, face_index: u32) -> Option<Self>
Parse a font from raw TTF/OTF bytes.
Returns None if the data is not a valid font.
Sourcepub fn units_per_em(&self) -> u16
pub fn units_per_em(&self) -> u16
Units-per-em for this font.
Sourcepub fn face_index(&self) -> u32
pub fn face_index(&self) -> u32
Face index inside a TTC collection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OwnedFont
impl RefUnwindSafe for OwnedFont
impl Send for OwnedFont
impl Sync for OwnedFont
impl Unpin for OwnedFont
impl UnsafeUnpin for OwnedFont
impl UnwindSafe for OwnedFont
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