Skip to content

FontWeight 命名空间包含用于各种字体粗细的常量,遵循 CSS 规范。

常量

以下常量在 FontWeight 命名空间中可用。它们都是无单位的 float 值。

NameValueDescription
thin100细体
extra-light200极细
light300
normal400正常
medium500中等
semi-bold600半粗
bold700粗体
extra-bold800特粗
black900黑色

示例

slint
export component Example inherits Window {    Text {        text: "Hello World";        font-weight: FontWeight.bold;    }}

基于 MIT 协议发布