pub struct ExtractedText {Show 18 fields
pub origin: Vec2,
pub text: String,
pub size_px: f32,
pub fill: Color,
pub caret: Option<usize>,
pub selection: Option<(usize, usize)>,
pub selection_color: Option<Color>,
pub selection_foreground: Option<Color>,
pub caret_color: Option<Color>,
pub order: PaintOrder,
pub container_width: f32,
pub align: TextAlign,
pub wrap: TextWrap,
pub max_lines: Option<u32>,
pub family: Option<Arc<str>>,
pub weight: u16,
pub line_height_px: f32,
pub caret_width_px: f32,
}Expand description
One text run to render this frame.
PartialEq compares every visual field so the retained Node-IR damage
diff can skip an unchanged label without re-shaping - deterministic
shaping means identical fields => identical glyphs => identical pixels.
Fields§
§origin: Vec2Baseline origin in window coordinates at the container’s leading edge. The renderer shifts by (container_width - measured_width) times an alignment fraction to honour Self::align.
text: StringUnshaped text passed to the shaper.
size_px: f32Font size in logical pixels.
fill: ColorFill color.
caret: Option<usize>Some(byte_offset) paints a vertical caret at the corresponding pixel position inside text.
selection: Option<(usize, usize)>Some((start, end)) paints a translucent selection highlight between the byte offsets; start < end.
selection_color: Option<Color>Selection highlight background. None falls back to
DEFAULT_SELECTION_BG. Sourced from
TextStyle::selection_color (selection-color CSS property).
selection_foreground: Option<Color>Selected-glyph color (Qt HighlightedText / Slint
selection-foreground-color). None keeps glyphs their normal
Self::fill. Sourced from [TextStyle::selection_foreground].
caret_color: Option<Color>Caret color. None falls back to Self::fill (the text color).
Sourced from [TextStyle::caret_color] (caret-color).
order: PaintOrderGlobal paint order.
container_width: f32Container width within which the text is aligned. With align == Start the renderer draws at origin directly; other alignments measure the run and shift inside this width.
align: TextAlignHorizontal alignment policy.
wrap: TextWrapWrap policy passed to the shaper.
max_lines: Option<u32>Hard cap on shaped line count; None is unbounded.
family: Option<Arc<str>>CSS font-family fallback chain (None = platform sans-serif).
weight: u16CSS font-weight (1-1000; 400 = normal).
line_height_px: f32Resolved CSS line-height in logical pixels (already resolved
against Self::size_px via resolve_line_height). Drives
inter-line spacing in the shaper and the newline-caret math.
caret_width_px: f32Resolved text-input caret stroke width in logical pixels (already
resolved against CARET_WIDTH_PX or a CaretWidth override).
Trait Implementations§
Source§impl Clone for ExtractedText
impl Clone for ExtractedText
Source§fn clone(&self) -> ExtractedText
fn clone(&self) -> ExtractedText
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ExtractedText
impl Component for ExtractedText
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Debug for ExtractedText
impl Debug for ExtractedText
Source§impl From<&ExtractedText> for Node
impl From<&ExtractedText> for Node
Source§fn from(t: &ExtractedText) -> Self
fn from(t: &ExtractedText) -> Self
Source§impl PartialEq for ExtractedText
impl PartialEq for ExtractedText
Source§fn eq(&self, other: &ExtractedText) -> bool
fn eq(&self, other: &ExtractedText) -> bool
self and other values to be equal, and is used by ==.