pub struct TextAttribute {
pub property: u16,
pub value_type: u8,
pub value: u32,
}Expand description
A single scalar text-format attribute on a range.
Fields§
§property: u16The property id (a text-format id from property_id).
value_type: u8The standard wire value type (F32, COLOR, U8, …).
value: u32The property’s 4-byte wire value (bit pattern for F32).
Implementations§
Source§impl TextAttribute
impl TextAttribute
Sourcepub const fn new(property: u16, value_type: u8, value: u32) -> Self
pub const fn new(property: u16, value_type: u8, value: u32) -> Self
Construct an attribute from raw wire parts.
Sourcepub fn font_weight(weight: f32) -> Self
pub fn font_weight(weight: f32) -> Self
FONT_WEIGHT (100–900).
Sourcepub fn normal_style() -> Self
pub fn normal_style() -> Self
FONT_STYLE = Normal.
Sourcepub fn font_design(code: u8) -> Self
pub fn font_design(code: u8) -> Self
FONT_DESIGN by enum code (Default=0, Serif=1, Rounded=2,
Monospaced=3).
Sourcepub const fn strikethrough(on: bool) -> Self
pub const fn strikethrough(on: bool) -> Self
STRIKETHROUGH (0/1).
Trait Implementations§
Source§impl Clone for TextAttribute
impl Clone for TextAttribute
impl Copy for TextAttribute
Source§impl Debug for TextAttribute
impl Debug for TextAttribute
impl Eq for TextAttribute
Source§impl PartialEq for TextAttribute
impl PartialEq for TextAttribute
impl StructuralPartialEq for TextAttribute
Auto Trait Implementations§
impl Forget for TextAttribute
impl Freeze for TextAttribute
impl RefUnwindSafe for TextAttribute
impl Send for TextAttribute
impl Sync for TextAttribute
impl Unpin for TextAttribute
impl UnsafeUnpin for TextAttribute
impl UnwindSafe for TextAttribute
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