pub struct ParagraphStyle {
pub text_align: TextAlign,
pub text_direction: TextDirection,
pub line_height: TextUnit,
pub text_indent: Option<TextIndent>,
pub platform_style: Option<PlatformParagraphStyle>,
pub line_height_style: Option<LineHeightStyle>,
pub line_break: LineBreak,
pub hyphens: Hyphens,
pub text_motion: Option<TextMotion>,
}Expand description
Style of a whole paragraph: alignment, direction, line height and line breaking.
Compose’s ParagraphStyle.
Fields§
§text_align: TextAlignHorizontal alignment of the lines.
text_direction: TextDirectionBase direction of the paragraph.
line_height: TextUnitDistance between baselines, in Sp or as a multiple of the font size. Unspecified uses
the natural line height of the font.
text_indent: Option<TextIndent>Indent of the first line and of the other lines. Text layout does not apply it yet.
platform_style: Option<PlatformParagraphStyle>Platform-specific settings.
line_height_style: Option<LineHeightStyle>How the line height is placed in each line and trimmed at the edges of the paragraph.
line_break: LineBreakStrategy that breaks the paragraph into lines.
hyphens: HyphensWhether words may be split with a hyphen.
text_motion: Option<TextMotion>Whether the text moves. None counts as TextMotion::Static.
Implementations§
Source§impl ParagraphStyle
impl ParagraphStyle
Sourcepub fn merge(&self, other: &ParagraphStyle) -> ParagraphStyle
pub fn merge(&self, other: &ParagraphStyle) -> ParagraphStyle
Returns a style where each field set in other replaces the one in self. Fields unset
in other keep the value of self.
Sourcepub fn plus(&self, other: &ParagraphStyle) -> ParagraphStyle
pub fn plus(&self, other: &ParagraphStyle) -> ParagraphStyle
Same as ParagraphStyle::merge. Compose’s ParagraphStyle.plus.
Sourcepub fn render_hash(&self) -> u64
pub fn render_hash(&self) -> u64
Hash of every field that changes how the paragraph looks, as renderers use it to key caches.
Trait Implementations§
Source§impl Clone for ParagraphStyle
impl Clone for ParagraphStyle
Source§impl Debug for ParagraphStyle
impl Debug for ParagraphStyle
Source§impl Default for ParagraphStyle
impl Default for ParagraphStyle
Source§impl PartialEq for ParagraphStyle
impl PartialEq for ParagraphStyle
impl StructuralPartialEq for ParagraphStyle
Auto Trait Implementations§
impl Freeze for ParagraphStyle
impl RefUnwindSafe for ParagraphStyle
impl Send for ParagraphStyle
impl Sync for ParagraphStyle
impl Unpin for ParagraphStyle
impl UnsafeUnpin for ParagraphStyle
impl UnwindSafe for ParagraphStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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