pub struct SoftwareTextFont { /* private fields */ }Implementations§
Source§impl SoftwareTextFont
impl SoftwareTextFont
pub fn from_bytes( bytes: impl Into<Vec<u8>>, ) -> Result<Self, SoftwareTextFontError>
Sourcepub fn from_registered_bytes(
family: &FontFamily,
weight: FontWeight,
style: FontStyle,
bytes: impl Into<Vec<u8>>,
) -> Result<Self, SoftwareTextFontError>
pub fn from_registered_bytes( family: &FontFamily, weight: FontWeight, style: FontStyle, bytes: impl Into<Vec<u8>>, ) -> Result<Self, SoftwareTextFontError>
Parse bytes as a face an app registered under family, declaring
weight and style for it.
The declaration wins over the face’s own OS/2 values, the way a
Compose Font(resId, FontWeight.Medium) entry does, and a variable face
is instanced on its wght/ital axes so one file can back a whole
family. That last part is what makes Android’s sans-serif reachable:
the platform ships a single variable Roboto-Regular.ttf and describes
every weight of the family as an axis position on it.
pub fn family_names(&self) -> &[String]
Sourcepub fn registered_family(&self) -> Option<FontFamilyKey>
pub fn registered_family(&self) -> Option<FontFamilyKey>
The family an app registered this face under, if any.
pub fn weight(&self) -> FontWeight
pub fn style(&self) -> FontStyle
Sourcepub fn content_hash(&self) -> u64
pub fn content_hash(&self) -> u64
Stable hash of the font binary — cache-key component wherever rasterized output depends on which font served the run.
Trait Implementations§
Source§impl Clone for SoftwareTextFont
impl Clone for SoftwareTextFont
Source§fn clone(&self) -> SoftwareTextFont
fn clone(&self) -> SoftwareTextFont
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for SoftwareTextFont
impl !UnwindSafe for SoftwareTextFont
impl Freeze for SoftwareTextFont
impl Send for SoftwareTextFont
impl Sync for SoftwareTextFont
impl Unpin for SoftwareTextFont
impl UnsafeUnpin for SoftwareTextFont
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