Skip to content

StrutStyle

定义用于垂直文本布局的 strut(支撑线)。

strut 会相对于基线设置最小行高,并作用于段落中的每一行。当文本的书写系统或字体度量可能不同、但仍需保持可预测的纵向节奏时,它非常有用。

属性 ​

名称类型默认值说明
sizeOptional[Number]NoneThe size of text (in logical pixels) to use when getting metrics from the font. Defaults to 14.
heightOptional[Number]NoneThe minimum height of the strut, as a multiple of size. See detailed explanation here: https://api.flutter.dev/flutter/painting/StrutStyle/height.html
weightOptional[FontWeight]NoneThe typeface thickness to use when calculating the strut. Defaults to W_400.
italicboolFalseWhether to use italic typeface.
font_familyOptional[str]NoneSee font_family.
leadingOptional[Number]NoneThe amount of additional space to place between lines when rendering text. Defaults to using the font-specified leading value.
force_strut_heightOptional[bool]NoneWhether the strut height should be forced. Defaults to False.

方法 ​

名称类型默认值说明
copy'StrutStyle'—返回此对象的副本,可覆盖指定属性。

关注我,学习大模型、大数据、Python等热门技术。