pub struct TextFormat {
pub font_family: Option<String>,
pub font_weight: Option<u32>,
pub font_bold: Option<bool>,
pub font_italic: Option<bool>,
pub font_size: Option<f32>,
pub color: Option<[f32; 4]>,
}Expand description
Text formatting parameters for the single-line layout API.
Controls font selection, size, and text color. All fields are optional and fall back to the typesetter’s defaults (default font, default size, default text color).
Fields§
§font_family: Option<String>Font family name (e.g., “Noto Sans”, “monospace”). None means use the default font.
font_weight: Option<u32>Font weight (100-900). Overrides font_bold.
font_bold: Option<bool>Shorthand for weight 700. Ignored if font_weight is set.
font_italic: Option<bool>Italic style.
font_size: Option<f32>Font size in pixels. None means use the default size.
color: Option<[f32; 4]>Text color (RGBA, 0.0-1.0). None means use the typesetter’s text color.
Trait Implementations§
Source§impl Clone for TextFormat
impl Clone for TextFormat
Source§fn clone(&self) -> TextFormat
fn clone(&self) -> TextFormat
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 TextFormat
impl Debug for TextFormat
Source§impl Default for TextFormat
impl Default for TextFormat
Source§fn default() -> TextFormat
fn default() -> TextFormat
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextFormat
impl RefUnwindSafe for TextFormat
impl Send for TextFormat
impl Sync for TextFormat
impl Unpin for TextFormat
impl UnsafeUnpin for TextFormat
impl UnwindSafe for TextFormat
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