pub enum FontSelection {
Default,
FontId(FontId),
Style(TextStyle),
}Variants§
Default
Default text style - will use TextStyle::Body, unless
Style::override_font_id or Style::override_text_style is set.
FontId(FontId)
Directly select size and font family
Style(TextStyle)
Use a TextStyle to look up the FontId in Style::text_styles.
Implementations§
Source§impl FontSelection
impl FontSelection
Sourcepub fn resolve(self, style: &Style) -> FontId
pub fn resolve(self, style: &Style) -> FontId
Resolve to a FontId.
On Self::Default and no override in the style, this will
resolve to TextStyle::Body.
Sourcepub fn resolve_with_fallback(self, style: &Style, fallback: Self) -> FontId
pub fn resolve_with_fallback(self, style: &Style, fallback: Self) -> FontId
Resolve with a final fallback.
Fallback is resolved on Self::Default and no override in the style.
Trait Implementations§
Source§impl Clone for FontSelection
impl Clone for FontSelection
Source§fn clone(&self) -> FontSelection
fn clone(&self) -> FontSelection
Returns a duplicate of the value. Read more
1.0.0 · 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 FontSelection
impl Debug for FontSelection
Source§impl Default for FontSelection
impl Default for FontSelection
Source§impl From<FontId> for FontSelection
impl From<FontId> for FontSelection
Auto Trait Implementations§
impl Freeze for FontSelection
impl RefUnwindSafe for FontSelection
impl Send for FontSelection
impl Sync for FontSelection
impl Unpin for FontSelection
impl UnwindSafe for FontSelection
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