Style
Style
概述
Style 是 Aspose.Cells FOSS 用于 TypeScript 的一个类。继承自:StyleType。
此类为 TypeScript 程序中的 Style 对象声明了 37 个方法。可用的方法包括:constructor、getAlignment、getBackgroundColor、getBorder、getFill、getFont、getFontColor、getFontName、getFontSize、getForegroundColor、getHorizontalAlignment、getNumberFormat,以及另外 25 个方法。公共成员在安装了 Aspose.Cells 用于 TypeScript 的 FOSS 包后,可供任何 TypeScript 应用程序访问。属性:alignment、border、fill、font、numberFormat、protection。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
font | : Font | 读写 | 获取或设置字体。 |
fill | : Fill | 读写 | 获取或设置填充。 |
border | : Border | 读写 | 获取或设置边框。 |
alignment | : Alignment | 读写 | 获取或设置对齐方式。 |
numberFormat | : string | 读写 | 获取或设置数字格式。 |
protection | : Protection | 读写 | 获取或设置保护。 |
方法
| 签名 | 描述 |
|---|---|
constructor() | 在此 Style 实例上调用构造函数。 |
getFont() → Font | 返回字体。 |
setFont(font: Font) | 设置字体值。 |
getFill() → Fill | 返回填充。 |
setFill(fill: Fill) | 设置填充值。 |
getBorder() → Border | 返回边框。 |
setBorder(border: Border) | 设置边框值。 |
getAlignment() → Alignment | 返回对齐方式。 |
setAlignment(alignment: Alignment) | 设置对齐值。 |
setNumberFormat(format: string) | 设置数字格式的值。 |
getNumberFormat() → `string | undefined` |
setProtection(protection: Protection) | 设置保护值。 |
isBold() → boolean | 如果已设置粗体,则返回 true。 |
setBold(bold: boolean) | 设置粗体值。 |
isItalic() → boolean | 如果斜体已设置,则返回 true。 |
setItalic(italic: boolean) | 设置 italic 值。 |
getFontName() → string | 返回字体名称。 |
setFontName(name: string) | 设置字体名称的值。 |
getFontSize() → number | 返回字体大小。 |
setFontSize(size: number) | 设置字体大小值。 |
getFontColor() → `string | undefined` |
setFontColor(color: string) | 设置字体颜色值。 |
getForegroundColor() → `string | undefined` |
setForegroundColor(color: string) | 设置前景色值。 |
getBackgroundColor() → `string | undefined` |
setBackgroundColor(color: string) | 设置背景颜色值。 |
getHorizontalAlignment() → string | 返回水平对齐方式。 |
setHorizontalAlignment(alignment: Alignment["horizontal"]) | 设置水平对齐值。 |
getVerticalAlignment() → string | 返回垂直对齐方式。 |
setVerticalAlignment(alignment: Alignment["vertical"]) | 设置垂直对齐值。 |
isWrapText() → boolean | 如果已设置 wrap text,则返回 true。 |
setWrapText(wrapText: boolean) | 设置换行文本的值。 |
isLocked() → boolean | 如果已设置 locked,则返回 true。 |
setLocked(locked: boolean) | 设置锁定值。 |
isHidden() → boolean | 如果已设置 hidden,则返回 true。 |
setHidden(hidden: boolean) | 设置隐藏值。 |
toXml() → string | 对该 Style 实例调用 toXml。 |