pub struct TextTheme { /* private fields */ }Expand description
Complete text appearance for one semantic typography role.
Implementations§
Source§impl TextTheme
impl TextTheme
Sourcepub fn new(
stack: FontStack,
color: Color,
font_size: f64,
weight: TextWeight,
line_height: f64,
) -> Result<TextTheme, Error>
pub fn new( stack: FontStack, color: Color, font_size: f64, weight: TextWeight, line_height: f64, ) -> Result<TextTheme, Error>
Construct one complete text role, using actual CSS pixels and a multiplier.
Sourcepub fn get_font_size(&self) -> f64
pub fn get_font_size(&self) -> f64
Inspect the positive font size in actual CSS pixels.
Sourcepub fn get_weight(&self) -> TextWeight
pub fn get_weight(&self) -> TextWeight
Inspect the closed font weight.
Sourcepub fn get_line_height(&self) -> f64
pub fn get_line_height(&self) -> f64
Inspect the retained multiplier, without multiplying by the font size.
Sourcepub fn stack(self, stack: FontStack) -> Result<TextTheme, Error>
pub fn stack(self, stack: FontStack) -> Result<TextTheme, Error>
Replace only the complete font stack.
Sourcepub fn color(self, color: Color) -> Result<TextTheme, Error>
pub fn color(self, color: Color) -> Result<TextTheme, Error>
Replace only the complete text paint.
Sourcepub fn font_size(self, font_size: f64) -> Result<TextTheme, Error>
pub fn font_size(self, font_size: f64) -> Result<TextTheme, Error>
Replace only the positive CSS font size.
Trait Implementations§
impl Eq for TextTheme
impl StructuralPartialEq for TextTheme
Auto Trait Implementations§
impl Forget for TextTheme
impl Freeze for TextThemewhere
*const ArcInner<Vec<FontFamily>> is !null: Freeze,
PhantomData<ArcInner<Vec<FontFamily>>>: Freeze,
impl Move for TextTheme
impl RefUnwindSafe for TextTheme
impl Send for TextTheme
impl Sync for TextTheme
impl Unpin for TextTheme
impl UnsafeUnpin for TextThemewhere
*const ArcInner<Vec<FontFamily>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<FontFamily>>>: UnsafeUnpin,
impl UnwindSafe for TextTheme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.