# PdfTextStyle class

> How a span of text looks: font, size, paint and decorations.

Namespace: [PdfNetStack.Drawing](https://www.jadev-corp.com/api/pdfnetstack-drawing/)  
Assembly: PdfNetStack.dll  
Package: `PdfNetStack`

How a span of text looks: font, size, paint and decorations.

```csharp
public sealed record PdfTextStyle : IEquatable<PdfTextStyle>
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfTextStyle](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextstyle/)

**Implements**

[IEquatable&lt;PdfTextStyle\>](https://learn.microsoft.com/dotnet/api/system.iequatable\-1)

## Constructors

### <a id="PdfNetStack_Drawing_PdfTextStyle__ctor_PdfNetStack_Fonts_PdfFont_System_Double_"></a> PdfTextStyle\(PdfFont, double\)

How a span of text looks: font, size, paint and decorations.

```csharp
public PdfTextStyle(PdfFont Font, double Size)
```

#### Parameters

`Font` [PdfFont](https://www.jadev-corp.com/api/pdfnetstack-fonts/pdffont/)

The font. Characters it lacks are looked up in [Fallbacks](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextstyle/#PdfNetStack_Drawing_PdfTextStyle_Fallbacks).

`Size` [double](https://learn.microsoft.com/dotnet/api/system.double)

Font size in points.

## Properties

### <a id="PdfNetStack_Drawing_PdfTextStyle_Brush"></a> Brush

Fill of the glyphs, and of underlines and strikethroughs. Default black; null for outlines only.

```csharp
public PdfBrush? Brush { get; init; }
```

#### Property Value

 [PdfBrush](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfbrush/)?

### <a id="PdfNetStack_Drawing_PdfTextStyle_Fallbacks"></a> Fallbacks

Fonts tried, in order, for characters [Font](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdftextstyle/#PdfNetStack_Drawing_PdfTextStyle_Font) has no glyph for.

```csharp
public IReadOnlyList<PdfFont> Fallbacks { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[PdfFont](https://www.jadev-corp.com/api/pdfnetstack-fonts/pdffont/)\>

### <a id="PdfNetStack_Drawing_PdfTextStyle_Font"></a> Font

The font.

```csharp
public PdfFont Font { get; init; }
```

#### Property Value

 [PdfFont](https://www.jadev-corp.com/api/pdfnetstack-fonts/pdffont/)

### <a id="PdfNetStack_Drawing_PdfTextStyle_LetterSpacing"></a> LetterSpacing

Extra space after every character, in points; may be negative.

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

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Drawing_PdfTextStyle_Pen"></a> Pen

Outline of the glyphs, or null.

```csharp
public PdfPen? Pen { get; init; }
```

#### Property Value

 [PdfPen](https://www.jadev-corp.com/api/pdfnetstack-drawing/pdfpen/)?

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

Font size in points.

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

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

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

Draws a line through the text.

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

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

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

Draws a line under the text.

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

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="PdfNetStack_Drawing_PdfTextStyle_WordSpacing"></a> WordSpacing

Extra space added to every space between words, in points.

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

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

## Used in

- [PDF links and annotations in C# and .NET](https://www.jadev-corp.com/guides/annotations/)
- [Fonts and text in PDF with C# and .NET](https://www.jadev-corp.com/guides/fonts-and-text/)
- [CSS support in PdfNetStack.Html](https://www.jadev-corp.com/guides/html-to-pdf/css-support/)
- [Write Arabic text in a PDF in C#](https://www.jadev-corp.com/recipes/arabic-text-pdf/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-drawing/pdftextstyle/
