#[repr(C)]pub struct KuiTextStyle {
pub size: f32,
pub line_height: f32,
pub color: u32,
pub family: u32,
pub font: u64,
pub wrap: u32,
pub max_lines: u32,
pub ellipsis: u32,
pub features: KuiStr,
pub decoration: u32,
pub underline_color: u32,
pub underline_style: u32,
}Expand description
How a run of text is set: size, line height, colour, family or font,
wrapping and decoration. A zeroed struct is the default style at size
0, so set at least size; NULL where a style pointer is taken is the
default style.
Fields§
§size: f32§line_height: f32<= 0 picks the default (size * 1.35).
color: u320xRRGGBBAA; 0 = default foreground
family: u32KUI_FONT_SANS (0, default) / KUI_FONT_SERIF / KUI_FONT_MONO.
font: u64A registered font handle (kui_font_add / kui_font_add_system);
non-zero overrides family.
wrap: u32KUI_WRAP_WORD (0, default) / KUI_WRAP_GLYPH / KUI_WRAP_NONE / KUI_WRAP_BREAK_SPACES.
max_lines: u32Lay out at most this many lines; 0 = unlimited.
ellipsis: u32Non-zero: end the last line with an ellipsis when the text is cut
off (a single line unless max_lines says otherwise).
features: KuiStrOpenType features for the shaper, in the spelling every binding
shares: tag=value pairs separated by spaces or commas, a bare
tag meaning 1 and -tag 0 ("liga=0 calt=0", "tnum"). Empty
(a zeroed KuiStr) is the font’s defaults.
decoration: u32KUI_DECO_UNDERLINE | KUI_DECO_STRIKETHROUGH: lines where the
face puts them, over every glyph. Paint only.
underline_color: u32The underline’s own colour as 0xRRGGBBAA, 0 for the text’s;
non-zero implies KUI_DECO_UNDERLINE. ABI 17.
underline_style: u32KUI_UNDERLINE_SOLID / _WAVY / _DOTTED; a non-solid style
implies KUI_DECO_UNDERLINE. ABI 17.
Trait Implementations§
Source§impl Clone for KuiTextStyle
impl Clone for KuiTextStyle
impl Copy for KuiTextStyle
Auto Trait Implementations§
impl !Send for KuiTextStyle
impl !Sync for KuiTextStyle
impl Freeze for KuiTextStyle
impl RefUnwindSafe for KuiTextStyle
impl Unpin for KuiTextStyle
impl UnsafeUnpin for KuiTextStyle
impl UnwindSafe for KuiTextStyle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.