pub struct Text {
pub container: Container,
pub content: String,
pub font: Font,
pub color: Color,
pub cell_size: f32,
}Expand description
Text node — bitmap glyph string anchored at its container’s origin.
Layout flows left-to-right, top-to-bottom. Newlines (\n) advance
cursor.y by line_height (= cell_size × cell_pixels).
Fields§
§container: ContainerTransform / visibility container.
content: StringString to render. Newlines start a new line.
font: FontBitmap font supplying the glyph atlas.
color: ColorText color tint.
cell_size: f32NDC units per atlas pixel. Default 0.02 ≈ glyphs ~16% of NDC tall.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl !RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl !UnwindSafe for Text
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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