pub struct RegisteredFont { /* private fields */ }Implementations§
Source§impl RegisteredFont
impl RegisteredFont
Sourcepub fn from_bytes(data: impl Into<Vec<u8>>) -> RegisteredFont
pub fn from_bytes(data: impl Into<Vec<u8>>) -> RegisteredFont
Font data: a TrueType or OpenType font or collection, or one
compressed as WOFF or WOFF2, which is decoded. Data is not checked
here; data that is not a font, or that fails to decode, fails when the
font is used. try_from_bytes checks it.
Sourcepub fn try_from_bytes(data: impl Into<Vec<u8>>) -> Result<RegisteredFont, Error>
pub fn try_from_bytes(data: impl Into<Vec<u8>>) -> Result<RegisteredFont, Error>
Like from_bytes, but fails when the data is not
a font or a WOFF or WOFF2 file does not decode.
Sourcepub fn family_name(&self) -> Option<String>
pub fn family_name(&self) -> Option<String>
The font’s family name, preferring its typographic family, when the font names one.
pub const fn with_face_index(self, face_index: u32) -> RegisteredFont
pub fn bytes(&self) -> &[u8] ⓘ
pub fn data_ptr(&self) -> usize
pub fn data_len(&self) -> usize
pub const fn face_index(&self) -> u32
Trait Implementations§
Source§impl Clone for RegisteredFont
impl Clone for RegisteredFont
Source§fn clone(&self) -> RegisteredFont
fn clone(&self) -> RegisteredFont
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegisteredFont
impl Debug for RegisteredFont
impl Eq for RegisteredFont
Source§impl PartialEq for RegisteredFont
impl PartialEq for RegisteredFont
impl StructuralPartialEq for RegisteredFont
Auto Trait Implementations§
impl Forget for RegisteredFont
impl Freeze for RegisteredFont
impl Move for RegisteredFont
impl RefUnwindSafe for RegisteredFont
impl Send for RegisteredFont
impl Sync for RegisteredFont
impl Unpin for RegisteredFont
impl UnsafeUnpin for RegisteredFont
impl UnwindSafe for RegisteredFont
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.