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<Self, Error>
pub fn new( stack: FontStack, color: Color, font_size: f64, weight: TextWeight, line_height: f64, ) -> Result<Self, 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<Self, Error>
pub fn stack(self, stack: FontStack) -> Result<Self, Error>
Replace only the complete font stack.
Sourcepub fn font_size(self, font_size: f64) -> Result<Self, Error>
pub fn font_size(self, font_size: f64) -> Result<Self, Error>
Replace only the positive CSS font size.
Sourcepub fn weight(self, weight: TextWeight) -> Result<Self, Error>
pub fn weight(self, weight: TextWeight) -> Result<Self, Error>
Replace only the font weight.
Sourcepub fn line_height(self, line_height: f64) -> Result<Self, Error>
pub fn line_height(self, line_height: f64) -> Result<Self, Error>
Replace only the finite positive line-height multiplier.
Trait Implementations§
impl Eq for TextTheme
impl StructuralPartialEq for TextTheme
Auto Trait Implementations§
impl Forget for TextTheme
impl Freeze for TextTheme
impl Move for TextTheme
impl RefUnwindSafe for TextTheme
impl Send for TextTheme
impl Sync for TextTheme
impl Unpin for TextTheme
impl UnsafeUnpin for TextTheme
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.