pub struct ParagraphStyle {
pub align: TextAlign,
pub direction: Option<TextDirection>,
pub preserve_trailing_whitespace: bool,
pub max_lines: Option<u32>,
pub ellipsis: Option<String>,
}Expand description
Paragraph-level knobs, fixed at build (Flutter’s ParagraphStyle).
Fields§
§align: TextAlign§direction: Option<TextDirection>The bidi base level. None infers it from the first strong character
(UAX #9 rules P2/P3); Some(..) forces it, which is what CSS
direction and Canvas2D’s direction ask for. Forcing matters for
text that is entirely neutral — digits and punctuation carry no
direction of their own, so only the base level orders them.
preserve_trailing_whitespace: boolInclude trailing whitespace in line advances. Canvas text enables this; paragraph layout defaults to trimmed line widths like SkParagraph.
max_lines: Option<u32>Stop wrapping after this many lines; content past them is dropped
(see ellipsis).
ellipsis: Option<String>Spliced onto a truncated last line (shaped in that line’s trailing style), on the visual end matching the paragraph’s base direction.
Trait Implementations§
Source§impl Clone for ParagraphStyle
impl Clone for ParagraphStyle
Source§fn clone(&self) -> ParagraphStyle
fn clone(&self) -> ParagraphStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParagraphStyle
impl Debug for ParagraphStyle
Source§impl Default for ParagraphStyle
impl Default for ParagraphStyle
Source§fn default() -> ParagraphStyle
fn default() -> ParagraphStyle
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more