<!-- Generated by tools/SharpCell.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# CellFont

```csharp
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

<a id="ctor"></a>
### CellFont()

```csharp
public CellFont()
```

Calibri 11 in the automatic colour, as [CellFont.Default](SharpCell.CellFont.md#default); set properties in an initializer.

## Properties

<a id="bold"></a>
### Bold

```csharp
public bool Bold { get; init; }
```

Bold text.

<a id="color"></a>
### Color

```csharp
public CellColor? Color { get; init; }
```

The text colour; null for automatic, which Excel shows black.

<a id="default"></a>
### Default

```csharp
public static CellFont Default { get; }
```

Calibri 11 in the automatic colour, the font of a new workbook in Excel 2007 to 2021.

<a id="italic"></a>
### Italic

```csharp
public bool Italic { get; init; }
```

Italic text.

<a id="name"></a>
### Name

```csharp
public string Name { get; init; }
```

The font family, such as `Calibri`.

**Exceptions**

- `ArgumentException`: The name is empty.

<a id="size"></a>
### Size

```csharp
public double Size { get; init; }
```

The size in points, 1 to 409 as in Excel.

**Exceptions**

- `ArgumentOutOfRangeException`: The size is outside 1 to 409.

<a id="strikethrough"></a>
### Strikethrough

```csharp
public bool Strikethrough { get; init; }
```

Text struck through.

<a id="underline"></a>
### Underline

```csharp
public CellUnderline Underline { get; init; }
```

The underline, if any.
