pub struct TextFlow {
pub word_break: WordBreak,
/* private fields */
}Expand description
A TextFlow manages styled text and flows it into bounding boxes across one or more pages.
Fields§
§word_break: WordBreakHow to handle words wider than the bounding box.
Implementations§
Source§impl TextFlow
impl TextFlow
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if all text has been consumed.
Sourcepub fn generate_content_ops(
&mut self,
rect: &Rect,
tt_fonts: &mut [TrueTypeFont],
) -> (Vec<u8>, FitResult, UsedFonts)
pub fn generate_content_ops( &mut self, rect: &Rect, tt_fonts: &mut [TrueTypeFont], ) -> (Vec<u8>, FitResult, UsedFonts)
Generate PDF content stream operations that fit within the given rectangle. Returns the content bytes, a FitResult, and the fonts actually used.
Multi-page stability: when word_break is not Normal, the word
list is pre-processed by break_wide_words before layout. That
function is deterministic for a given rect.width, so the internal
cursor index remains valid across successive calls — provided the
caller supplies the same rect.width every time for a given flow.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextFlow
impl RefUnwindSafe for TextFlow
impl Send for TextFlow
impl Sync for TextFlow
impl Unpin for TextFlow
impl UnsafeUnpin for TextFlow
impl UnwindSafe for TextFlow
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