pub enum ThemeTextType {
Show 30 variants
DisplayLarge,
DisplayMedium,
DisplaySmall,
HeadlineLarge,
HeadlineMedium,
HeadlineSmall,
TitleLarge,
TitleMedium,
TitleSmall,
BodyLarge,
BodyMedium,
BodySmall,
LabelLarge,
LabelMedium,
LabelSmall,
DisplayLargeEmphasized,
DisplayMediumEmphasized,
DisplaySmallEmphasized,
HeadlineLargeEmphasized,
HeadlineMediumEmphasized,
HeadlineSmallEmphasized,
TitleLargeEmphasized,
TitleMediumEmphasized,
TitleSmallEmphasized,
BodyLargeEmphasized,
BodyMediumEmphasized,
BodySmallEmphasized,
LabelLargeEmphasized,
LabelMediumEmphasized,
LabelSmallEmphasized,
}Expand description
Which type-scale role a text’s font FAMILY resolves from at layout, when
opted into with TextView::themed_family and a theme is active — one
variant per TypeScale slot (15 baseline roles plus their 15
_emphasized siblings).
Only the family is taken from the role: size, weight, line height and
tracking stay whatever the text view itself set. Resolving it at layout
rather than at build is what lets a text follow a live theme swap — an app
rewriting its type scale’s family repaints every opted-in run in the new
face on the next layout, the same way a themed ThemeTextColor follows a
brightness flip. An explicit TextView::family/TextView::style always
wins (precedence: explicit > theme > fallback); with no theme, or no role
set, the style’s own family (FontFamily::SystemUi by default) is used
unchanged.
Part of the widget-authoring toolkit — re-exported as
crate::authoring::ThemeTextType, which is the path a design system
outside this crate names it by.
Variants§
DisplayLarge
type_scale.display_large.
DisplayMedium
type_scale.display_medium.
DisplaySmall
type_scale.display_small.
HeadlineLarge
type_scale.headline_large.
HeadlineMedium
type_scale.headline_medium.
HeadlineSmall
type_scale.headline_small.
TitleLarge
type_scale.title_large.
TitleMedium
type_scale.title_medium.
TitleSmall
type_scale.title_small.
BodyLarge
type_scale.body_large.
BodyMedium
type_scale.body_medium.
BodySmall
type_scale.body_small.
LabelLarge
type_scale.label_large.
LabelMedium
type_scale.label_medium.
LabelSmall
type_scale.label_small.
DisplayLargeEmphasized
type_scale.display_large_emphasized.
DisplayMediumEmphasized
type_scale.display_medium_emphasized.
DisplaySmallEmphasized
type_scale.display_small_emphasized.
HeadlineLargeEmphasized
type_scale.headline_large_emphasized.
HeadlineMediumEmphasized
type_scale.headline_medium_emphasized.
HeadlineSmallEmphasized
type_scale.headline_small_emphasized.
TitleLargeEmphasized
type_scale.title_large_emphasized.
TitleMediumEmphasized
type_scale.title_medium_emphasized.
TitleSmallEmphasized
type_scale.title_small_emphasized.
BodyLargeEmphasized
type_scale.body_large_emphasized.
BodyMediumEmphasized
type_scale.body_medium_emphasized.
BodySmallEmphasized
type_scale.body_small_emphasized.
LabelLargeEmphasized
type_scale.label_large_emphasized.
LabelMediumEmphasized
type_scale.label_medium_emphasized.
LabelSmallEmphasized
type_scale.label_small_emphasized.
Implementations§
Source§impl ThemeTextType
impl ThemeTextType
Sourcepub fn style_in(self, scale: &TypeScale) -> &TextStyle
pub fn style_in(self, scale: &TypeScale) -> &TextStyle
The full TextStyle this role names in scale — what
TextView::themed_family reads at layout to resolve an opted-in
text’s family, and the one mapping a design-system crate outside this
one calls into directly instead of restating its own copy of the
30-arm role-to-slot table.
Trait Implementations§
Source§impl Clone for ThemeTextType
impl Clone for ThemeTextType
Source§fn clone(&self) -> ThemeTextType
fn clone(&self) -> ThemeTextType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ThemeTextType
Source§impl Debug for ThemeTextType
impl Debug for ThemeTextType
impl Eq for ThemeTextType
Source§impl PartialEq for ThemeTextType
impl PartialEq for ThemeTextType
impl StructuralPartialEq for ThemeTextType
Auto Trait Implementations§
impl Freeze for ThemeTextType
impl RefUnwindSafe for ThemeTextType
impl Send for ThemeTextType
impl Sync for ThemeTextType
impl Unpin for ThemeTextType
impl UnsafeUnpin for ThemeTextType
impl UnwindSafe for ThemeTextType
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
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.