pub struct Paragraph {
pub text: String,
pub rect: [f32; 4],
pub font: Standard14,
pub size: f32,
pub leading: Option<f32>,
pub align: ParagraphAlign,
}Expand description
A block of text wrapped, aligned, and (for ParagraphAlign::Justify)
stretched to fill a rectangle.
Fields§
§text: StringThe text to lay out. \n forces a line break; other whitespace runs
between words collapse to a single space.
rect: [f32; 4]The box to wrap into, [x0, y0, x1, y1] in page user-space units.
font: Standard14Face to draw in.
size: f32Font size, in points.
leading: Option<f32>Line-to-line advance, in points. None defaults to 1.2 * size.
align: ParagraphAlignHorizontal alignment within the rect.
Trait Implementations§
Source§impl Draw for Paragraph
Tw (word spacing) is persistent text state that BeginText does not
clear, so a stretch an earlier line left active must be reset before the
first following line that does not itself stretch — not only once, at
the very end.
impl Draw for Paragraph
Tw (word spacing) is persistent text state that BeginText does not
clear, so a stretch an earlier line left active must be reset before the
first following line that does not itself stretch — not only once, at
the very end.
impl StructuralPartialEq for Paragraph
Auto Trait Implementations§
impl Freeze for Paragraph
impl RefUnwindSafe for Paragraph
impl Send for Paragraph
impl Sync for Paragraph
impl Unpin for Paragraph
impl UnsafeUnpin for Paragraph
impl UnwindSafe for Paragraph
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