# FontExtensions

Namespace: **System**

Assembly: **Wisej.Framework** (4.0.0.0)

Extends the [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) class.

{% tabs %}
{% tab title="C#" %}

```csharp
public class FontExtensions
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class FontExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Change(font, style)

Changes the [FontStyle](https://docs.microsoft.com/dotnet/api/system.drawing.fontstyle) of the specified *font* .

| Parameter | Type                                                                        | Description                                                                      |
| --------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font)           | Base font.                                                                       |
| **style** | [FontStyle](https://docs.microsoft.com/dotnet/api/system.drawing.fontstyle) | New [FontStyle](https://docs.microsoft.com/dotnet/api/system.drawing.fontstyle). |

**Returns:** [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font). A new [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) with the same size and family as *font* and the specified *style* .

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Change(font, size)

Changes the size of the specified *font* .

| Parameter | Type                                                              | Description                                                                                                                        |
| --------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) | Base font.                                                                                                                         |
| **size**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)     | New size using the same [GraphicsUnit](https://docs.microsoft.com/dotnet/api/system.drawing.graphicsunit) of the original *font* . |

**Returns:** [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font). A new [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) with the new size and same family as *font* .

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Change(font, size, unit)

Changes the size of the specified *font* .

| Parameter | Type                                                                              | Description                                                                            |
| --------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font)                 | Base font.                                                                             |
| **size**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                     | New size using the specified *unit* .                                                  |
| **unit**  | [GraphicsUnit](https://docs.microsoft.com/dotnet/api/system.drawing.graphicsunit) | New [GraphicsUnit](https://docs.microsoft.com/dotnet/api/system.drawing.graphicsunit). |

**Returns:** [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font). A new [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) with the new size and *unit* .

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Change(font, size, style, unit)

Changes the size and style of the specified *font* .

| Parameter | Type                                                                              | Description                                                                            |
| --------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font)                 | Base font.                                                                             |
| **size**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                     | New size using the specified *unit* .                                                  |
| **style** | [FontStyle](https://docs.microsoft.com/dotnet/api/system.drawing.fontstyle)       | New see [FontStyle](https://docs.microsoft.com/dotnet/api/system.drawing.fontstyle).   |
| **unit**  | [GraphicsUnit](https://docs.microsoft.com/dotnet/api/system.drawing.graphicsunit) | New [GraphicsUnit](https://docs.microsoft.com/dotnet/api/system.drawing.graphicsunit). |

**Returns:** [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font). A new [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) with the new size, *unit* , and *style* .

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Copy(font)

Creates a copy of the [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) preserving the [OriginalFontName](https://docs.microsoft.com/dotnet/api/system.drawing.font.originalfontname).

| Parameter | Type                                                              | Description |
| --------- | ----------------------------------------------------------------- | ----------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) |             |

**Returns:** [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font). A new [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) identical to the original font..

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) IsThemeFont(font)

Returns whether the specified *font* is a theme font.

| Parameter | Type                                                              | Description    |
| --------- | ----------------------------------------------------------------- | -------------- |
| **font**  | [Font](https://docs.microsoft.com/dotnet/api/system.drawing.font) | Font to check. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if *font* is a theme font.
