Class Font
Represents font formatting for cells, including font family, size, color, and style attributes.
Implements
Inherited Members
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class Font : AbstractFont, INotifyPropertyChanged
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Examples
// Create and configure a font
var font = new Font()
.SetBold()
.SetItalic()
.WithColor(SpreadsheetColor.FromName("Blue"));
Constructors
Font()
Initializes a new Font for the supplied workbook data.
Declaration
public Font()
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Font(Font)
Initializes a new Font for the supplied workbook data.
Declaration
public Font(Font other)
Parameters
| Type | Name | Description |
|---|---|---|
| Font | other |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Font(string)
Initializes a new Font for the supplied workbook data.
Declaration
public Font(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Properties
Condense
Gets or sets whether the font is condensed (narrower characters).
Declaration
public bool Condense { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Extend
Gets or sets whether the font is extended (wider characters).
Declaration
public bool Extend { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Name
Exposes the name associated with Font.
Declaration
public override string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The name returned by the operation. |
Overrides
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Outline
Gets or sets whether the font is outlined (hollow letters).
Declaration
public bool Outline { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
Methods
Create()
Exposes the create associated with Font.
Declaration
public static Font Create()
Returns
| Type | Description |
|---|---|
| Font | The create returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
SetBold()
Updates the bold held by the Font.
Declaration
public Font SetBold()
Returns
| Type | Description |
|---|---|
| Font | The set bold returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
SetItalic()
Updates the italic held by the Font.
Declaration
public Font SetItalic()
Returns
| Type | Description |
|---|---|
| Font | The set italic returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
SetStrikethrough()
Updates the strikethrough held by the Font.
Declaration
public Font SetStrikethrough()
Returns
| Type | Description |
|---|---|
| Font | The set strikethrough returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
WithColor(SpreadsheetColor)
Exposes the with color associated with Font.
Declaration
public Font WithColor(SpreadsheetColor color)
Parameters
| Type | Name | Description |
|---|---|---|
| SpreadsheetColor | color | The color used by the operation. |
Returns
| Type | Description |
|---|---|
| Font | The with color returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.
WithUnderline(SpreadsheetUnderline)
Exposes the with underline associated with Font.
Declaration
public Font WithUnderline(SpreadsheetUnderline value)
Parameters
| Type | Name | Description |
|---|---|---|
| SpreadsheetUnderline | value | The value used by the operation. |
Returns
| Type | Description |
|---|---|
| Font | The with underline returned by the operation. |
Remarks
A Font defines the text appearance for cell content, including bold, italic,
underline, strikethrough, color, and size settings.
This class supports a fluent API for easy configuration.