pub struct FontFile {
pub path: String,
pub weight: FontWeight,
pub style: FontStyle,
}Expand description
One font file of a file-backed family, with the weight and style the file provides.
Fields§
§path: StringPath of the font file.
weight: FontWeightWeight of the face in the file.
style: FontStyleUpright or italic style of the face in the file.
Implementations§
Source§impl FontFile
impl FontFile
Sourcepub fn new(path: impl Into<String>) -> Self
pub fn new(path: impl Into<String>) -> Self
Creates an entry for the font file at path with normal weight and upright style.
Sourcepub fn with_weight(self, weight: FontWeight) -> Self
pub fn with_weight(self, weight: FontWeight) -> Self
Sets the weight the file provides.
Sourcepub fn with_style(self, style: FontStyle) -> Self
pub fn with_style(self, style: FontStyle) -> Self
Sets the style the file provides.
Trait Implementations§
impl Eq for FontFile
impl StructuralPartialEq for FontFile
Auto Trait Implementations§
impl Freeze for FontFile
impl RefUnwindSafe for FontFile
impl Send for FontFile
impl Sync for FontFile
impl Unpin for FontFile
impl UnsafeUnpin for FontFile
impl UnwindSafe for FontFile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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