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.
Trait Implementations§
Source§impl<'a> Clone for TextTexture<'a>
impl<'a> Clone for TextTexture<'a>
impl<'a> Copy for TextTexture<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TextTexture<'a>
impl<'a> !UnwindSafe for TextTexture<'a>
impl<'a> Freeze for TextTexture<'a>
impl<'a> Send for TextTexture<'a>
impl<'a> Sync for TextTexture<'a>
impl<'a> Unpin for TextTexture<'a>
impl<'a> UnsafeUnpin for TextTexture<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more