pub struct TextConfig {
pub color: Color,
pub font_id: u16,
pub font_size: u16,
pub letter_spacing: u16,
pub line_height: u16,
pub wrap_mode: TextElementConfigWrapMode,
pub alignment: TextAlignment,
}Expand description
Configuration settings for rendering text elements.
Fields§
§color: ColorThe color of the text.
font_id: u16Clay does not manage fonts. It is up to the user to assign a unique ID to each font
and provide it via the font_id field.
font_size: u16The font size of the text.
letter_spacing: u16The spacing between letters.
line_height: u16The height of each line of text.
wrap_mode: TextElementConfigWrapModeDefines the text wrapping behavior.
alignment: TextAlignmentThe alignment of the text.
Implementations§
Source§impl TextConfig
impl TextConfig
Sourcepub fn font_id(&mut self, id: u16) -> &mut Self
pub fn font_id(&mut self, id: u16) -> &mut Self
Sets the font ID. The user is responsible for assigning unique font IDs.
Sourcepub fn letter_spacing(&mut self, spacing: u16) -> &mut Self
pub fn letter_spacing(&mut self, spacing: u16) -> &mut Self
Sets the letter spacing.
Sourcepub fn line_height(&mut self, height: u16) -> &mut Self
pub fn line_height(&mut self, height: u16) -> &mut Self
Sets the line height.
Sourcepub fn wrap_mode(&mut self, mode: TextElementConfigWrapMode) -> &mut Self
pub fn wrap_mode(&mut self, mode: TextElementConfigWrapMode) -> &mut Self
Sets the text wrapping mode.
Sourcepub fn alignment(&mut self, alignment: TextAlignment) -> &mut Self
pub fn alignment(&mut self, alignment: TextAlignment) -> &mut Self
Sets the text alignment.
Sourcepub fn end(&self) -> TextElementConfig
pub fn end(&self) -> TextElementConfig
Finalizes the text configuration and stores it in memory.
Trait Implementations§
Source§impl Clone for TextConfig
impl Clone for TextConfig
Source§fn clone(&self) -> TextConfig
fn clone(&self) -> TextConfig
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 TextConfig
impl Debug for TextConfig
Source§impl Default for TextConfig
impl Default for TextConfig
Source§impl From<Clay_TextElementConfig> for TextConfig
impl From<Clay_TextElementConfig> for TextConfig
Source§fn from(value: Clay_TextElementConfig) -> Self
fn from(value: Clay_TextElementConfig) -> Self
Converts to this type from the input type.
Source§impl From<TextConfig> for Clay_TextElementConfig
impl From<TextConfig> for Clay_TextElementConfig
Source§fn from(value: TextConfig) -> Self
fn from(value: TextConfig) -> Self
Converts to this type from the input type.
impl Copy for TextConfig
Auto Trait Implementations§
impl Freeze for TextConfig
impl RefUnwindSafe for TextConfig
impl Send for TextConfig
impl Sync for TextConfig
impl Unpin for TextConfig
impl UnwindSafe for TextConfig
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