pub struct TextLabel {
pub slot: String,
pub lines: Vec<String>,
pub font_id: String,
pub font_px: f32,
pub color: String,
pub h_align: Option<String>,
pub v_align: Option<String>,
pub slots: Vec<String>,
}Expand description
A free-floating text label to draw in one of the nine placement slots. Independent of the GLW overlay (labels can be added to any render).
Fields§
§slot: Stringplacement-slot anchor name (top_left … center … bottom_right).
lines: Vec<String>the text, one entry per line. Empty / all-blank labels draw nothing.
font_id: Stringid of the font to draw this label with (per-snippet). Must match one
returned by GET /api/fonts.
font_px: f32font size in pixels.
color: Stringhex colour string (#rrggbb) for the text.
h_align: Option<String>horizontal alignment within the slot’s free rectangle
(left | center | right); absent → the slot’s outward default.
v_align: Option<String>vertical alignment within the slot’s free rectangle
(top | center | bottom); absent → the slot’s outward default.
slots: Vec<String>the slots this label spans, as combined by the user (each a slot-anchor
name, including Self::slot). Empty → just Self::slot. When more
than one, the label grows to the largest free rectangle within exactly
those slots’ thirds and reserves every slot listed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextLabel
impl<'de> Deserialize<'de> for TextLabel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TextLabel
impl RefUnwindSafe for TextLabel
impl Send for TextLabel
impl Sync for TextLabel
impl Unpin for TextLabel
impl UnsafeUnpin for TextLabel
impl UnwindSafe for TextLabel
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.