pub struct TextLayout {
pub writing_mode: WritingMode,
pub lines: Vec<TextLine>,
pub measured: Size,
pub font_size: Unit,
pub paint_offset_y: Unit,
pub diagnostics: Vec<TextDiagnostic>,
pub align_x: Alignment,
pub padding_inline: Unit,
pub padding: Insets,
}Expand description
Complete deterministic shaped layout.
Fields§
§writing_mode: WritingModeHorizontal lines or top-to-bottom right-to-left columns.
lines: Vec<TextLine>Lines or columns in block-flow order.
measured: SizeNatural or constrained measurement.
font_size: UnitEffective font size after shrinking.
paint_offset_y: UnitPaint-only vertical translation retained by every visual exporter. Positive values move text toward the page bottom; measurement and pagination continue to use the unshifted geometry.
diagnostics: Vec<TextDiagnostic>Non-fatal diagnostics.
align_x: AlignmentInline alignment applied to every resolved line.
padding_inline: UnitSymmetric padding on the writing mode’s inline axis.
padding: InsetsResolved per-side padding around the text block.
Implementations§
Source§impl TextLayout
impl TextLayout
Source§impl TextLayout
impl TextLayout
Sourcepub fn outer_measured(&self) -> Result<Size>
pub fn outer_measured(&self) -> Result<Size>
Returns the measured outer size including block padding.
Sourcepub fn content_bounds(&self, bounds: Rect) -> Result<Rect>
pub fn content_bounds(&self, bounds: Rect) -> Result<Rect>
Returns the inner text rectangle after applying block padding.
Trait Implementations§
Source§impl Clone for TextLayout
impl Clone for TextLayout
Source§impl Debug for TextLayout
impl Debug for TextLayout
Source§impl<'de> Deserialize<'de> for TextLayout
impl<'de> Deserialize<'de> for TextLayout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TextLayout
Source§impl PartialEq for TextLayout
impl PartialEq for TextLayout
Source§impl Serialize for TextLayout
impl Serialize for TextLayout
impl StructuralPartialEq for TextLayout
Auto Trait Implementations§
impl Freeze for TextLayout
impl RefUnwindSafe for TextLayout
impl Send for TextLayout
impl Sync for TextLayout
impl Unpin for TextLayout
impl UnsafeUnpin for TextLayout
impl UnwindSafe for TextLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.