pub struct TextTexture<'a> {
pub texture: SourceView<'a>,
pub width: u32,
pub height: u32,
pub margin: [u32; 2],
pub cache_key: Option<RenderCacheKey>,
}Expand description
One prepared text: its texture, pixel size, and where its layout box lies in it.
Fields§
§texture: SourceView<'a>Premultiplied, sRGB-encoded RGBA, as every source texture.
width: u32Width in pixels.
height: u32Height in pixels.
margin: [u32; 2]The margin, in pixels, the same on both sides of each axis, that the texture adds around the text and its decorations for ink reaching past them: an accent above the first line, say. Placement leaves it out, so such ink never moves the text.
cache_key: Option<RenderCacheKey>The key the renderer’s result cache holds results drawn from this
texture under, or None to keep every frame showing it out of that
cache. It is the provider’s promise that the texture’s pixels depend
on nothing it leaves out, as crate::FrameProvider::source_key is
for a source: TextTextures keys each text by its text_key and
the fonts it was drawn with.