pub struct FamilyInfo(/* private fields */);Expand description
Named set of fonts that are instances of a core design.
Implementations§
Source§impl FamilyInfo
impl FamilyInfo
Sourcepub fn new(name: FamilyName, fonts: impl IntoIterator<Item = FontInfo>) -> Self
pub fn new(name: FamilyName, fonts: impl IntoIterator<Item = FontInfo>) -> Self
Creates a new font family object with the given name and collection of fonts.
Sourcepub fn fonts(&self) -> &[FontInfo]
pub fn fonts(&self) -> &[FontInfo]
Returns the collection of fonts that are members of the family.
Sourcepub fn default_font_index(&self) -> usize
pub fn default_font_index(&self) -> usize
Returns index of the default font of the family.
Sourcepub fn default_font(&self) -> Option<&FontInfo>
pub fn default_font(&self) -> Option<&FontInfo>
Returns the default font of the family.
Sourcepub fn match_index(
&self,
width: FontWidth,
style: FontStyle,
weight: FontWeight,
synthesize_style: bool,
) -> Option<usize>
pub fn match_index( &self, width: FontWidth, style: FontStyle, weight: FontWeight, synthesize_style: bool, ) -> Option<usize>
Returns the index of the best font from the family for the given attributes.
Sourcepub fn match_font(
&self,
width: FontWidth,
style: FontStyle,
weight: FontWeight,
synthesize_style: bool,
) -> Option<&FontInfo>
pub fn match_font( &self, width: FontWidth, style: FontStyle, weight: FontWeight, synthesize_style: bool, ) -> Option<&FontInfo>
Selects the best font from the family for the given attributes.
Trait Implementations§
Source§impl Clone for FamilyInfo
impl Clone for FamilyInfo
Auto Trait Implementations§
impl !RefUnwindSafe for FamilyInfo
impl !UnwindSafe for FamilyInfo
impl Freeze for FamilyInfo
impl Send for FamilyInfo
impl Sync for FamilyInfo
impl Unpin for FamilyInfo
impl UnsafeUnpin for FamilyInfo
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