pub struct BasicTextStyle {
pub size: u8,
pub text_color: Option<(u8, u8, u8)>,
pub before_spacing: f32,
pub after_spacing: f32,
pub alignment: Option<TextAlignment>,
pub font_family: Option<&'static str>,
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub strikethrough: bool,
pub background_color: Option<(u8, u8, u8)>,
}Expand description
Basic text styling properties that can be applied to any text element.
Fields§
§size: u8Font size in points
text_color: Option<(u8, u8, u8)>Text color in RGB format
before_spacing: f32Space before element in points
after_spacing: f32Space after element in points
alignment: Option<TextAlignment>Text alignment within container
font_family: Option<&'static str>Font family name
bold: boolWhether text should be bold
italic: boolWhether text should be italic
underline: boolWhether text should be underlined
strikethrough: boolWhether text should have strikethrough
background_color: Option<(u8, u8, u8)>Background color in RGB format
Implementations§
Source§impl BasicTextStyle
impl BasicTextStyle
Sourcepub fn new(
size: u8,
text_color: Option<(u8, u8, u8)>,
before_spacing: Option<f32>,
after_spacing: Option<f32>,
alignment: Option<TextAlignment>,
font_family: Option<&'static str>,
bold: bool,
italic: bool,
underline: bool,
strikethrough: bool,
background_color: Option<(u8, u8, u8)>,
) -> Self
pub fn new( size: u8, text_color: Option<(u8, u8, u8)>, before_spacing: Option<f32>, after_spacing: Option<f32>, alignment: Option<TextAlignment>, font_family: Option<&'static str>, bold: bool, italic: bool, underline: bool, strikethrough: bool, background_color: Option<(u8, u8, u8)>, ) -> Self
Creates a new BasicTextStyle with the specified properties.
§Arguments
size- Font size in pointstext_color- Optional RGB color tuple for textbefore_spacing- Optional space before element in pointsafter_spacing- Optional space after element in pointsalignment- Optional text alignmentfont_family- Optional font family namebold- Whether text should be bolditalic- Whether text should be italicunderline- Whether text should be underlinedstrikethrough- Whether text should have strikethroughbackground_color- Optional RGB color tuple for background
Trait Implementations§
Source§impl Clone for BasicTextStyle
impl Clone for BasicTextStyle
Source§fn clone(&self) -> BasicTextStyle
fn clone(&self) -> BasicTextStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BasicTextStyle
impl Debug for BasicTextStyle
Source§impl Default for BasicTextStyle
impl Default for BasicTextStyle
Source§impl PartialEq for BasicTextStyle
impl PartialEq for BasicTextStyle
impl Copy for BasicTextStyle
impl StructuralPartialEq for BasicTextStyle
Auto Trait Implementations§
impl Freeze for BasicTextStyle
impl RefUnwindSafe for BasicTextStyle
impl Send for BasicTextStyle
impl Sync for BasicTextStyle
impl Unpin for BasicTextStyle
impl UnwindSafe for BasicTextStyle
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.