pub struct TextPaint {
pub plain: bool,
pub color: Color,
pub baseline_shift: f32,
pub style_hash: u64,
pub text_hash: u64,
pub text_empty: bool,
pub static_motion: bool,
}Expand description
The paint of a text node’s glyphs.
Fields§
§plain: boolWhether the glyphs in color are all the text draws: no background,
shadow, brush, stroke or decoration, and no span that paints its own
range.
color: ColorThe style’s colour, or its solid brush, times its alpha; white when it names neither.
baseline_shift: f32How far the style’s baseline shift moves the glyphs down.
style_hash: u64The style’s TextStyle::render_hash, which keys the glyph caches
a renderer draws the text from, so no frame hashes the style again.
text_hash: u64The string’s RenderString::render_hash, which keys those caches
beside the style’s, so that drawing a cached run never loads the
string.
text_empty: boolWhether the string has no characters.
static_motion: boolWhether the style’s motion is static, so its glyphs stay on whole pixels.
Implementations§
Source§impl TextPaint
impl TextPaint
Sourcepub fn of(
style: &TextStyle,
style_hash: u64,
spans: &[RangeStyle<SpanStyle>],
font_size: f32,
(text_hash, text_empty): (u64, bool),
) -> Self
pub fn of( style: &TextStyle, style_hash: u64, spans: &[RangeStyle<SpanStyle>], font_size: f32, (text_hash, text_empty): (u64, bool), ) -> Self
The paint of a text in style, whose TextStyle::render_hash is
style_hash, with spans, at font_size, whose string’s
RenderString::render_hash and emptiness are text.