pub struct TextScope { /* private fields */ }Expand description
A Text and its builder.
Implementations§
Source§impl TextScope
impl TextScope
Sourcepub fn spans(self, spans: TextSpans) -> Self
pub fn spans(self, spans: TextSpans) -> Self
Runs of different treatment inside the text: a bold phrase, a link, some code.
pub fn type_role(self, role: TypeRole) -> Self
pub fn font_size(self, sp: f32) -> Self
pub fn font_weight(self, weight: u16) -> Self
pub fn line_height(self, sp: f32) -> Self
pub fn letter_spacing(self, sp: f32) -> Self
pub fn color(self, paint: Paint) -> Self
pub fn text_align(self, align: TextAlign) -> Self
pub fn max_lines(self, lines: u32) -> Self
pub fn overflow(self, overflow: TextOverflow) -> Self
Source§impl TextScope
impl TextScope
Sourcepub fn on_pointer(
self,
kinds: PointerKinds,
handler: impl FnMut(PointerEvent) + 'static,
) -> Self
pub fn on_pointer( self, kinds: PointerKinds, handler: impl FnMut(PointerEvent) + 'static, ) -> Self
Subscribes the node to the kinds of pointer input in kinds. The handler runs
on the same call as the input; calling consume on the event keeps it from
the nearest subscribed ancestor and from the Renderer’s own handling.
A node that never calls this has no pointer input at all, and costs nothing.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TextScope
impl !Send for TextScope
impl !Sync for TextScope
impl !UnwindSafe for TextScope
impl Freeze for TextScope
impl Unpin for TextScope
impl UnsafeUnpin for TextScope
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