pub struct TextDrawData<'a> {
pub text_buffer: Cow<'a, Buffer>,
pub area: MathRect,
pub top: f32,
pub fallback_color: Color,
pub clip_to_shape: Option<usize>,
pub buffer_metadata: usize,
}Fields§
§text_buffer: Cow<'a, Buffer>The text buffer containing glyph information.
area: MathRectThe area within which the text is rendered.
top: f32The top position of the text within the layout area.
fallback_color: ColorThe color of the text.
clip_to_shape: Option<usize>Optional index of the shape to which the text is clipped.
buffer_metadata: usizeImplementations§
Source§impl<'a> TextDrawData<'a>
impl<'a> TextDrawData<'a>
pub fn new( text: &str, layout: impl Into<TextLayout>, scale_factor: f32, font_system: &mut FontSystem, font_family: Family<'_>, clip_to_shape: Option<usize>, buffer_id: usize, ) -> Self
pub fn with_buffer( buffer: impl IntoCowBuffer<'a>, area: MathRect, fallback_color: Color, vertical_offset: f32, clip_to_shape: Option<usize>, buffer_metadata: usize, ) -> Self
pub fn into_text_area(self, scale_factor: f32) -> TextArea<'a>
pub fn to_text_area(&self, scale_factor: f32) -> TextArea<'_>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TextDrawData<'a>
impl<'a> RefUnwindSafe for TextDrawData<'a>
impl<'a> Send for TextDrawData<'a>
impl<'a> Sync for TextDrawData<'a>
impl<'a> Unpin for TextDrawData<'a>
impl<'a> UnwindSafe for TextDrawData<'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