[]
Represents font formatting for a range, style, or text run.
Use this interface to get or set font properties such as name, size, bold, italic, underline, strikethrough, font color, theme color, theme font, and subscript or superscript formatting.
public interface IFont
Public Interface IFont
IRange cell = worksheet.Range["A1"];
cell.Value = "Title";
IFont font = cell.Font;
font.Name = "Arial";
font.Size = 14;
font.Bold = true;
font.Color = Color.Red;
| Name | Description |
|---|---|
| Bold | Gets or sets whether the font is bold. |
| Color | Gets or sets the font color. |
| ColorIndex | Gets or sets the color index used for the font. The value can be a palette color index or a special color index value such as Automatic. |
| Italic | Gets or sets whether the font style is italic. |
| Name | Gets or sets the font family name. |
| Size | Gets or sets the font size, in points. |
| Strikethrough | Gets or sets whether strikethrough formatting is applied to the font. |
| Subscript | Gets or sets whether subscript formatting is applied to the font. Setting this property on Font affects all text in the range. To format only part of the text, call |
| Superscript | Gets or sets whether superscript formatting is applied to the font. Setting this property on Font affects all text in the range. To format only part of the text, call |
| ThemeColor | Gets or sets the theme color used for the font color. |
| ThemeFont | Gets or sets the theme font used by the font. Use Major or Minor to follow the workbook theme font scheme, or None to use a non-theme font. |
| TintAndShade | Gets or sets the tint and shade adjustment applied to the font color.
The value must be from |
| Underline | Gets or sets the underline type for the font. |