pub struct RichTextSpan {
pub text: String,
pub bold: bool,
pub italic: bool,
pub color: [u8; 4],
pub font_size: f32,
pub font_family: Option<String>,
}Expand description
A styled text span for use with UiCtx::rich_text.
Each span carries its own typographic style, allowing a single call to
rich_text to render mixed-style text (bold headings, coloured links, …).
Fields§
§text: StringThe text content of this span.
bold: boolRender the text in bold weight.
italic: boolRender the text in italic.
color: [u8; 4]RGBA colour bytes [r, g, b, a].
font_size: f32Font size in logical pixels.
font_family: Option<String>Optional font-family override; None uses the theme default.
Implementations§
Trait Implementations§
Source§impl Clone for RichTextSpan
impl Clone for RichTextSpan
Source§fn clone(&self) -> RichTextSpan
fn clone(&self) -> RichTextSpan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RichTextSpan
impl RefUnwindSafe for RichTextSpan
impl Send for RichTextSpan
impl Sync for RichTextSpan
impl Unpin for RichTextSpan
impl UnsafeUnpin for RichTextSpan
impl UnwindSafe for RichTextSpan
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