pub struct TextStyle {
pub family: FontFamily,
pub size: f32,
pub bold: bool,
pub italic: bool,
pub color: Color,
pub line_height: f32,
pub align: Align,
pub decoration: Decoration,
}Expand description
A fully resolved text style: every field concrete, no inheritance left to chase.
Fields§
§family: FontFamilyFont family.
size: f32Font size in points.
bold: boolBold weight.
italic: boolItalic style.
color: ColorText color.
line_height: f32Line height, as a multiple of font size.
align: AlignText alignment.
decoration: DecorationText decoration.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn base() -> TextStyle
pub fn base() -> TextStyle
The hard fallback beneath the default theme: 11pt black Helvetica, left-aligned, no decoration.
Sourcepub fn apply(&self, d: &Declared) -> TextStyle
pub fn apply(&self, d: &Declared) -> TextStyle
Overlays a rule’s declared fields onto this style, resolving Em
sizes against the inherited size and leaving unset fields
inherited unchanged.
Sourcepub fn font(&self) -> Standard14
pub fn font(&self) -> Standard14
The Standard-14 face this style resolves to, by family, weight and slant.
Trait Implementations§
impl Copy for TextStyle
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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