diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md index 0c31fb9b6fd24031b36162f591bc3c14dc8da2d9..5de534998ef8e77e18a725472c87e5f56d8fa215 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md @@ -15,7 +15,7 @@ | fontColor | [ResourceColor](ts-types.md#resourcecolor) | 设置文本颜色。 | | fontSize | Length \| [Resource](ts-types.md#resource) | 设置文本尺寸,Length为number类型时,使用fp单位。 | | fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 设置文本的字体样式。
默认值:FontStyle.Normal | -| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。
默认值:FontWeight.Normal | +| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。
默认值:FontWeight.Normal | | fontFamily | string \| [Resource](ts-types.md#resource) | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial, sans-serif'。 | diff --git a/zh-cn/application-dev/ui/ui-ts-components.md b/zh-cn/application-dev/ui/ui-ts-components.md index 7712c3c67422daacbc299bd3b57d5253123f1afb..45d22d02d3255dddcd90760c911595a942c2ee17 100644 --- a/zh-cn/application-dev/ui/ui-ts-components.md +++ b/zh-cn/application-dev/ui/ui-ts-components.md @@ -33,9 +33,10 @@ interface Builder { 开发者创建系统组件时,会显示其默认样式。开发者可以通过更改组件的属性样式来改变组件的视图显示。 -1. 修改Text组件的fontSize属性来更改组件的字体大小,将字体大小设置为26,fontWeight字体的粗细为500。fontWeight支持两种设置方式: - 1. number类型的取值范围为100到900,默认为400,取值越大,字体越粗。 - 2. fontWeight为内置枚举类型,取值支持Lighter、Normal、Bold、Bolder。 +1. 修改Text组件的fontSize属性来更改组件的字体大小,将字体大小设置为26,通过fontWeight属性更改字体粗细,将其设置为500。fontWeight属性支持三种设置方式: + 1. number类型的取值范围为100到900,取值间隔为100,默认为400,取值越大,字体越粗。 + 2. FontWeight为内置枚举类型,取值支持FontWeight.Lighter、FontWeight.Normal、FontWeight.Regular、FontWeight.Medium、FontWeight.Bold、FontWeight.Bolder。FontWeight.Normal即为400数值的字体粗细。 + 3. string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。设置其他字符串则为无效,保持默认字体粗细显示。 属性方法要紧随组件,通过“.”运算符连接,也可以通过链式调用的方式配置组件的多个属性。