FontWeight 命名空间包含用于各种字体粗细的常量,遵循 CSS 规范。
常量
以下常量在 FontWeight 命名空间中可用。它们都是无单位的 float 值。
| Name | Value | Description |
|---|---|---|
thin | 100 | 细体 |
extra-light | 200 | 极细 |
light | 300 | 细 |
normal | 400 | 正常 |
medium | 500 | 中等 |
semi-bold | 600 | 半粗 |
bold | 700 | 粗体 |
extra-bold | 800 | 特粗 |
black | 900 | 黑色 |
示例
slint
export component Example inherits Window { Text { text: "Hello World"; font-weight: FontWeight.bold; }}