pub struct TextStyle {
pub color: (u8, u8, u8),
pub size: f64,
pub anchor: TextAnchor,
pub angle: f64,
pub family: Option<String>,
pub face: FontFace,
pub bg_colour: Option<(u8, u8, u8)>,
pub bg_r: f64,
}Expand description
Style for drawing text.
Fields§
§color: (u8, u8, u8)§size: f64§anchor: TextAnchor§angle: f64§family: Option<String>Font family (e.g., “serif”, “monospace”). None defaults to “sans-serif”.
face: FontFaceFont face (R’s element_text(face = ...)).
bg_colour: Option<(u8, u8, u8)>Text halo / outline colour (#229, ggrepel’s bg.colour /
shadowtext’s bg.col): None (the default) draws no halo, so
existing output is byte-identical. SVG: stroke on the <text>
itself (stroke-linejoin="round", paint-order="stroke", so the
stroke paints under the fill rather than over it). Raster: an
outline pass in this colour before the normal fill pass.
bg_r: f64Text halo radius in px (#229, ggrepel’s bg.r) — the SVG
stroke-width is 2 * bg_r. Only matters when bg_colour is
Some; 0.0 (the default) draws no halo even if bg_colour is
set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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,
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