pub struct RichTextSpan {
pub text: String,
pub size_px: f32,
pub color: Color,
pub font_stack: Option<String>,
}Expand description
富文本样式 span。颜色只影响绘制,不参与 shape 缓存 key。
Fields§
§text: String§size_px: f32§color: Color§font_stack: Option<String>None = DEFAULT_FONT_STACK
Implementations§
Source§impl RichTextSpan
impl RichTextSpan
pub fn new(text: impl Into<String>) -> RichTextSpan
pub fn with_size(self, size_px: f32) -> RichTextSpan
pub fn with_color(self, color: Color) -> RichTextSpan
pub fn with_font_stack(self, stack: impl Into<String>) -> RichTextSpan
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 moreSource§impl Debug for RichTextSpan
impl Debug for RichTextSpan
Source§impl PartialEq for RichTextSpan
impl PartialEq for RichTextSpan
impl StructuralPartialEq for RichTextSpan
Auto 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