pub struct TextDrawParams {
pub rect: Rect,
pub text: Rc<AnnotatedString>,
pub layout: TextLayout,
pub color: Color,
pub text_style: Arc<TextStyle>,
pub style_hash: u64,
pub font_size: f32,
pub scale: f32,
pub clip: Option<Rect>,
}Expand description
A DrawScope text run, lowered into the vocabulary the text pipeline
already speaks.
The fields line up one-for-one with CompositorScene::push_text in both
backends, so a text primitive joins the same glyph atlas, run cache and
shader the Text composable uses instead of getting a pipeline of its own.
Fields§
§rect: RectLayer-transformed block box. Glyphs are laid out from its top-left; the draw scope already resolved alignment into it.
text: Rc<AnnotatedString>The text to draw.
layout: TextLayoutThe lines and glyphs, from rect’s top left corner.
color: ColorColor that fills the glyphs.
text_style: Arc<TextStyle>Style the text is drawn with.
style_hash: u64text_style’s render hash.
font_size: f32Font size in logical pixels, before scale is applied.
scale: f32Uniform layer scale — the factor glyphs are rasterized at.
clip: Option<Rect>Clip rectangle that cuts the text, or None when nothing clips it.
Auto Trait Implementations§
impl !RefUnwindSafe for TextDrawParams
impl !Send for TextDrawParams
impl !Sync for TextDrawParams
impl !UnwindSafe for TextDrawParams
impl Forget for TextDrawParams
impl Freeze for TextDrawParams
impl Unpin for TextDrawParams
impl UnsafeUnpin for TextDrawParams
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