pub struct TextStyle {
pub font: FontSpec,
pub color: Color,
pub h_align: TextAlign,
pub v_align: TextAlign,
pub wrap: bool,
pub trimming: Trimming,
pub letter_spacing: f32,
pub color_glyphs: bool,
}Fields§
§font: FontSpec§color: Color§h_align: TextAlign§v_align: TextAlign§wrap: boolQuebra automática de linha (nas palavras; palavra maior que a largura, no caractere).
trimming: TrimmingReticências quando não couber (por caractere, por palavra ou nenhuma).
letter_spacing: f32Espaço a mais entre as letras, em unidades lógicas (como o letter_spacing do
Label; negativo aperta). Vale no desenho e nas medidas (measure_text,
measure_text_wrapped): a largura de um texto ganha letter_spacing por letra, menos
a última.
color_glyphs: boolEmoji coloridos (o padrão). Desligado, os emoji saem na cor do texto, com a fonte
MONO_EMOJI_FAMILY (Noto Emoji) quando o app a registrou (o projeto com ela em
assets/fonts/): assim o desenho é igual nos três renderizadores. Sem a fonte, cada
renderizador faz o que pode (o Direct2D tira a cor da fonte de emoji do sistema; o
navegador continua colorido).
Trait Implementations§
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Forget for TextStyle
impl Freeze for TextStyle
impl Move for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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