Struct Paragraph Layout
pub struct ParagraphLayout { /* private fields */ }Expand description
Owned immutable output retaining the original text, paragraph options and base direction. Font/shaping style identity remains caller-owned. Preparation allocates and repeatedly shapes candidate lines; backend transient work is not bounded by output caps and must never run in audio callbacks.
Implementations§
§impl ParagraphLayout
impl ParagraphLayout
pub fn new(
font: &TextFont,
text: &str,
text_options: TextOptions<'_>,
options: ParagraphOptions,
) -> Result<Self, TextError>
pub fn new( font: &TextFont, text: &str, text_options: TextOptions<'_>, options: ParagraphOptions, ) -> Result<Self, TextError>
Wrap <=4096 UTF8 bytes at Unicode line opportunities. Greedy fitting stops at the first overflowing candidate; an oversized first unbreakable unit overflows unchanged and is flagged. No character reversal or forced split.
Preserve paragraph embedding/isolate context across soft wraps, applying
bidi line reordering to each candidate before shaping visual runs. Base
direction is explicit in text_options; script/language/features apply
to each directional run and remain caller-owned segmentation policy.
LF, CRLF, CR and Unicode line/paragraph separators create hard lines; empty input and a trailing separator produce an empty line. Other controls and noncharacters reject. Output caps are 256 lines/512 runs/16384 glyphs. Complete failure returns no partial layout. No fonts/files/network are discovered.
pub fn options(&self) -> ParagraphOptions
pub fn options(&self) -> ParagraphOptions
Validated physical alignment, width and baseline spacing.
pub fn direction(&self) -> TextDirection
pub fn direction(&self) -> TextDirection
Explicit paragraph base direction used during layout.
pub fn lines(&self) -> &[ParagraphLine]
pub fn glyph_count(&self) -> usize
Trait Implementations§
§impl Clone for ParagraphLayout
impl Clone for ParagraphLayout
§fn clone(&self) -> ParagraphLayout
fn clone(&self) -> ParagraphLayout
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more