pub struct TextDrawParams {
pub rect: Rect,
pub text: Rc<AnnotatedString>,
pub render_text: Arc<RenderString>,
pub color: Color,
pub text_style: TextStyle,
pub font_size: f32,
pub scale: f32,
pub layout_options: TextLayoutOptions,
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.
render_text: Arc<RenderString>text as a renderer’s draws carry it across threads.
color: ColorColor that fills the glyphs.
text_style: TextStyleStyle the text is drawn with.
font_size: f32Font size in logical pixels, before scale is applied.
scale: f32Uniform layer scale — the factor glyphs are rasterized at.
layout_options: TextLayoutOptionsLayout options the text is laid out with.
clip: Option<Rect>Clip rectangle that cuts the text, or None when nothing clips it.