pub struct Face {
pub family: String,
pub weight: Weight,
/* private fields */
}Expand description
A font face the application gives: its family name (as a theme names
it), its weight and the bytes of a .ttf or .otf file.
Fields§
§family: String§weight: WeightImplementations§
Source§impl Face
impl Face
Sourcepub fn from_static(family: &str, weight: Weight, bytes: &'static [u8]) -> Self
pub fn from_static(family: &str, weight: Weight, bytes: &'static [u8]) -> Self
A face from bytes the binary embeds.
Sourcepub fn from_owned(family: &str, weight: Weight, bytes: Vec<u8>) -> Self
pub fn from_owned(family: &str, weight: Weight, bytes: Vec<u8>) -> Self
A face from bytes read at run time.
Sourcepub fn origin(&self) -> Origin
pub fn origin(&self) -> Origin
Where it comes from: Origin::Registered, or Origin::File
for a user’s font file.
Sourcepub fn tabular_digits(&self) -> bool
pub fn tabular_digits(&self) -> bool
Whether its digits 0 to 9 share one advance (tabular figures
by default); false when it cannot be read.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Face
impl !RefUnwindSafe for Face
impl Send for Face
impl Sync for Face
impl Unpin for Face
impl UnsafeUnpin for Face
impl !UnwindSafe for Face
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more