[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IFont

IFont Interface

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.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IFont
Public Interface IFont
Examples
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;

Properties

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 IRange.Characters(int, int) to get an ITextRun, and then use Font.

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 IRange.Characters(int, int) to get an ITextRun, and then use Font.

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 -1.0 to 1.0, where 0 is neutral; otherwise, an ArgumentException is thrown.

Underline

Gets or sets the underline type for the font.