pub struct Font(Arc<FontRepr>);Expand description
An OpenType or PostScript font.
This type is internally reference counted, cheaply cloneable and thread safe.
Tuple Fields§
§0: Arc<FontRepr>Implementations§
Source§impl Font
impl Font
Sourcepub fn new(source: impl Into<FontSource>, index: u32) -> Result<Self, ReadError>
pub fn new(source: impl Into<FontSource>, index: u32) -> Result<Self, ReadError>
Creates a new font from the given source and font index.
The index parameter specifies the desired font in a font collection (ttc or otc) file. It is ignored if the data source is not a blob.
Sourcepub fn source(&self) -> &FontSource
pub fn source(&self) -> &FontSource
Returns the underlying source of font data.
Sourcepub fn tables(&self) -> &FontTables
pub fn tables(&self) -> &FontTables
Returns an object that provides access to individual font tables.
For non-SFNT fonts, this will return an empty set of tables.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Font
impl !RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
impl !UnwindSafe for 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