pub enum TextStyle {
LargeTitle,
Title,
Title2,
Title3,
Headline,
Subheadline,
Body,
Callout,
Footnote,
Caption,
Caption2,
}Expand description
A role in the type ladder — SwiftUI’s Font.TextStyle.
Variants§
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn painted(self) -> f32
pub fn painted(self) -> f32
The size this role paints at, which set_base_text_size moves.
Sourcepub const fn line_height(self) -> f32
pub const fn line_height(self) -> f32
The role’s measured line height in points, at its measured Self::size.
A table beside size, because the ratio is not one number: it runs 1.18
at Title up to 1.33 at Title3, and does not move monotonically with
the size. Left unset, gpui leads every line at phi — 21pt on a 13pt body
against the platform’s 16.
Sourcepub fn painted_line_height(self) -> f32
pub fn painted_line_height(self) -> f32
The line box this role paints in, which set_base_text_size moves.
Sourcepub const fn weight(self) -> FontWeight
pub const fn weight(self) -> FontWeight
The role’s weight. Three roles share 13pt and three share 10pt, so this is what separates them.
Trait Implementations§
impl Copy for TextStyle
impl Eq for TextStyle
Source§impl From<TextStyle> for Metrics
impl From<TextStyle> for Metrics
Source§fn from(role: TextStyle) -> Self
fn from(role: TextStyle) -> Self
The ladder’s own setting for a role: its measured leading and weight.
A set that wants prose leading names its own through Metrics::new.
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
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<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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more