pub struct RichText {
pub segments: Vec<RichSegment>,
pub color: Color,
pub font_size: f32,
pub font: String,
pub align: TextAlign,
}Expand description
A rich text value composed of styled segments.
Fields§
§segments: Vec<RichSegment>§color: Color§font_size: f32§font: StringFont family name (e.g. “Noto Sans”). Resolved by the renderer’s text stack: runtime-registered fonts → system fonts (native only) → bundled Liberation Sans. Empty string = bundled font. A character the resolved face cannot draw falls back per character to registered fonts, the bundled face, then (native only) installed system fonts.
align: TextAlignWhere each line of a multi-line text sits inside the block. Additive
schema: documents written before it existed parse as Left (the only
layout they could have had), and Left is not serialized, so their
JSON round-trips unchanged.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RichText
impl<'de> Deserialize<'de> for RichText
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 StructuralPartialEq for RichText
Auto Trait Implementations§
impl Freeze for RichText
impl RefUnwindSafe for RichText
impl Send for RichText
impl Sync for RichText
impl Unpin for RichText
impl UnsafeUnpin for RichText
impl UnwindSafe for RichText
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