[]
Represents font attributes, such as font name, font size, color, and text styles, for an object.
Use this interface to read or modify the formatting of text associated with drawing-related objects. It provides access to font color through IColorFormat and to common text style settings such as bold, italic, underline, strikethrough, subscript, superscript, and theme font.
public interface IFontFormat
Public Interface IFontFormat
worksheet.Range["A1:B3"].Value = new object[,] {
{"Month", "Sales"},
{"Jan", 100},
{"Feb", 120}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:B3"], RowCol.Columns, true, true);
chart.HasDataTable = true;
IFontFormat font = chart.DataTable.Font;
font.Bold = true;
font.Color.RGB = Color.Blue;
| Name | Description |
|---|---|
| Bold | Gets or sets whether the represented text is bold. |
| Color | Gets the color format. This property gets the IColorFormat object that represents the color of the text associated with this font format. Use the returned object to read or modify the text color, such as an RGB color or a theme-based color. |
| Italic | Gets or sets whether the represented text is italicized. |
| Name | Gets or sets the font name to use for the represented text. |
| Size | Gets or sets the size of the font in points. The returned value specifies the font size applied to the represented text. |
| Strikethrough | Gets or sets whether the represented text has a strike through it. |
| Subscript | Gets or sets whether the represented text is formatted as subscript. This property indicates whether the current character formatting applies subscript to the text. |
| Superscript | Gets or sets whether the represented text is formatted as superscript.
This property indicates whether superscript formatting is applied to the represented text.
The default value is |
| ThemeFont | Gets or sets the theme font in the applied font scheme that is associated with the specified object. Use this property to determine whether the object uses the major theme font, minor theme font, or no theme font. |
| Underline | Gets or sets the underline style of the represented text. This property uses a TextUnderlineType value that describes how the text is underlined. |