AUDIO
Source snapshot · 12 October 2026

API reference / ravet_surface::paragraph::ParagraphLayout

Struct ParagraphLayout 

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

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 text(&self) -> &str

Complete immutable original UTF8 source, including hard separators.

pub fn options(&self) -> ParagraphOptions

Validated physical alignment, width and baseline spacing.

pub fn direction(&self) -> TextDirection

Explicit paragraph base direction used during layout.

pub fn lines(&self) -> &[ParagraphLine]

pub fn glyph_count(&self) -> usize

pub fn height(&self) -> f64

Baseline-spacing extent, not ink bounds or measured font ascender/descent.

Trait Implementations§

§

impl Clone for ParagraphLayout

§

fn clone(&self) -> ParagraphLayout

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ParagraphLayout

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for ParagraphLayout

§

fn eq(&self, other: &ParagraphLayout) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · §

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for ParagraphLayout

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

Performs copy-assignment from self to dest. Read more
§

impl<T> ErasedDestructor for Twhere T: 'static,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.