CellFont
public sealed class CellFont
Namespace SharpCell · package SharpCell
The font of a cell's text. A record: fonts compare by value, and with makes a changed copy, such as font with { Bold = true }.
Constructors
CellFont()
public CellFont()
Calibri 11 in the automatic colour, as CellFont.Default; set properties in an initializer.
Properties
Bold
public bool Bold { get; init; }
Bold text.
Color
public CellColor? Color { get; init; }
The text colour; null for automatic, which Excel shows black.
Default
public static CellFont Default { get; }
Calibri 11 in the automatic colour, the font of a new workbook in Excel 2007 to 2021.
Italic
public bool Italic { get; init; }
Italic text.
Name
public string Name { get; init; }
The font family, such as Calibri.
Exceptions
ArgumentException: The name is empty.
Size
public double Size { get; init; }
The size in points, 1 to 409 as in Excel.
Exceptions
ArgumentOutOfRangeException: The size is outside 1 to 409.
Strikethrough
public bool Strikethrough { get; init; }
Text struck through.
Underline
public CellUnderline Underline { get; init; }
The underline, if any.