pub struct TextSpec {
pub text: String,
pub anchor: Anchor,
pub offset: (i32, i32),
pub style: TextStyle,
}Expand description
A text/title layer: the string, its placement, and its styling.
Size-agnostic: the canvas dimensions are supplied by the renderer, so the same spec can render at any resolution.
Fields§
§text: StringThe text to render (UTF-8).
anchor: AnchorWhere the text is anchored within the canvas.
offset: (i32, i32)Pixel offset (dx, dy) from the anchor (positive = right / down).
style: TextStyleVisual styling.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextSpec
impl<'de> Deserialize<'de> for TextSpec
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TextSpec
impl StructuralPartialEq for TextSpec
Auto Trait Implementations§
impl Freeze for TextSpec
impl RefUnwindSafe for TextSpec
impl Send for TextSpec
impl Sync for TextSpec
impl Unpin for TextSpec
impl UnsafeUnpin for TextSpec
impl UnwindSafe for TextSpec
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