pub struct ParagraphBuilder<'a> { /* private fields */ }Expand description
Collects styled spans; build() runs fallback segmentation + shaping
once and hands back the retained Paragraph.
Implementations§
Source§impl<'a> ParagraphBuilder<'a>
impl<'a> ParagraphBuilder<'a>
Sourcepub fn new(fonts: &'a mut FontCollection) -> Self
pub fn new(fonts: &'a mut FontCollection) -> Self
Skia’s ParagraphBuilder::make(style, fontCollection, unicode):
the collection comes in at construction and answers misses itself.
pub fn style(&mut self, style: ParagraphStyle) -> &mut Self
pub fn add_text(&mut self, text: &str, style: &TextStyle) -> &mut Self
Sourcepub fn build(&mut self) -> Paragraph
pub fn build(&mut self) -> Paragraph
The expensive tier: segment + shape, consulting the collection’s
sources at every miss (Skia’s one build(); what no source could
answer waits on the collection as take_unanswered). The paragraph
keeps the faces it resolved, so it is self-contained afterwards.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ParagraphBuilder<'a>
impl<'a> !Send for ParagraphBuilder<'a>
impl<'a> !Sync for ParagraphBuilder<'a>
impl<'a> !UnwindSafe for ParagraphBuilder<'a>
impl<'a> Freeze for ParagraphBuilder<'a>
impl<'a> Unpin for ParagraphBuilder<'a>
impl<'a> UnsafeUnpin for ParagraphBuilder<'a>
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