TextStyle

TextStyle 是一个用于描述文本样式的结构体。

TextStyle is used for describe text style

Properties

decoratenametypedescription
livefontFont字体
font family
live(9.0)font_sizef64字体大小
define the size of the text
live(1.0)brightnessf32亮度
the brightness of text
live(0.5)curvef32曲线
word curve
live(1.4)line_spacingf64行间距
the spacing of word
live(1.1)top_dropf64顶部偏移
top drop of the text
live(1.3)height_factorf64高度因子
height factor of the text

Example

#![allow(unused)]
fn main() {
text_style: {
    // so here font size = 16 * 1.5 = 24
    font_size: 16,
    font: {path: dep("crate://makepad-widgets/resources/IBMPlexSans-SemiBold.ttf")},
    // brightness > 1.0 will make the text brighter
    // < 1.0 will make the text darker
    brightness: 1.0,
},
}