pub struct TextPaint {
pub plain: bool,
pub color: Color,
pub baseline_shift: f32,
pub style_hash: u64,
pub static_motion: bool,
pub casts_shadow: bool,
pub spread: InkSpread,
/* private fields */
}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.
static_motion: boolWhether the style’s motion is static, so its glyphs stay on whole pixels.
casts_shadow: boolWhether the style or a span casts a shadow, which spreads past the glyphs.
spread: InkSpreadHow far past their outlines the glyphs put ink: a stroke’s outer half, and the bold or italic a face of the layout synthesizes.
Implementations§
Source§impl TextPaint
impl TextPaint
Sourcepub fn of(
style: &TextStyle,
style_hash: u64,
spans: &[RangeStyle<SpanStyle>],
(font_size, layout): (f32, &TextLayout),
) -> Self
pub fn of( style: &TextStyle, style_hash: u64, spans: &[RangeStyle<SpanStyle>], (font_size, layout): (f32, &TextLayout), ) -> Self
The paint of a text in style, whose TextStyle::render_hash is
style_hash, with spans, at font_size, laid out as layout.