---
title: "Interface IFontService | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/IFontService/"
---

# Interface IFontService

> `Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry`

###### **Namespace**: [Aurigma.DesignAtoms.Services](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services.md)

###### **Assembly**: Aurigma.DesignAtoms.dll

```csharp title="Syntax"
public interface IFontService
```

## Properties

### DefaultPostscriptName

```csharp
string DefaultPostscriptName { get; }
```

### FontSizeWarningThreshold

```csharp
long FontSizeWarningThreshold { get; }
```

### FontRegistry

```csharp
FontRegistry FontRegistry { get; }
```

### AllFontsByPsName

```csharp
IReadOnlyDictionary<string, FontService.FontData> AllFontsByPsName { get; }
```

### FontRemaps

```csharp
IReadOnlyDictionary<string, string> FontRemaps { get; }
```

## Methods

### GetFontRegistry

```csharp
FontRegistry GetFontRegistry()
```

##### Returns

### InitializeAsync

```csharp
Task InitializeAsync()
```

##### Returns

`System.Threading.Tasks.Task`

### WaitUntilReadyAsync

```csharp
Task WaitUntilReadyAsync()
```

##### Returns

`System.Threading.Tasks.Task`

### FindSuitableFont

```csharp
FontSettings FindSuitableFont(string fontFamily, bool requestedBold = false, bool requestedItalic = false, string requestedStyle = null)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fontFamily* |  |
| `System.Boolean` | *requestedBold* |  |
| `System.Boolean` | *requestedItalic* |  |
| `System.String` | *requestedStyle* |  |

##### Returns

[Aurigma.DesignAtoms.Model.Items.FontSettings](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Items/FontSettings.md)

### GetBytes

```csharp
IEnumerable<byte> GetBytes()
```

##### Returns

`System.Collections.Generic.IEnumerable<System.Byte>`

### CreateProductAvailableFontsAsync

```csharp
Task<Dictionary<string, IEnumerable<FontService.ExtendedFontData>>> CreateProductAvailableFontsAsync(IProductHandler productHandler, Product product, IList<string> requestedFonts, string requestedDefaultFont)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Model.IProductHandler](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model/IProductHandler.md) | *productHandler* |  |
| [Aurigma.DesignAtoms.Model.Product](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model/Product.md) | *product* |  |
| `System.Collections.Generic.IList<System.String>` | *requestedFonts* |  |
| `System.String` | *requestedDefaultFont* |  |

##### Returns

`System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.IEnumerable<Aurigma.DesignAtoms.Services.FontService.ExtendedFontData>>>`

### CreateProductAvailableFonts1

```csharp
[Obsolete]
Dictionary<string, IEnumerable<FontService.ExtendedFontData>> CreateProductAvailableFonts1(IProductHandler productHandler, Product product, IList<string> requestedFonts, string requestedDefaultFont)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Model.IProductHandler](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model/IProductHandler.md) | *productHandler* |  |
| [Aurigma.DesignAtoms.Model.Product](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model/Product.md) | *product* |  |
| `System.Collections.Generic.IList<System.String>` | *requestedFonts* |  |
| `System.String` | *requestedDefaultFont* |  |

##### Returns

`System.Collections.Generic.Dictionary<System.String,System.Collections.Generic.IEnumerable<Aurigma.DesignAtoms.Services.FontService.ExtendedFontData>>`

### GetCssPsName

```csharp
string GetCssPsName(FontService.FontData requestedFont)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Services.FontService.FontData](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/FontService.FontData.md) | *requestedFont* |  |

##### Returns

`System.String`

### GetCssFamilyName

```csharp
string GetCssFamilyName(FontService.FontData requestedFont)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Services.FontService.FontData](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/FontService.FontData.md) | *requestedFont* |  |

##### Returns

`System.String`

### RecognizeFontStyle

```csharp
FontService.FontStyle RecognizeFontStyle(string style)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *style* |  |

##### Returns

[Aurigma.DesignAtoms.Services.FontService.FontStyle](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/FontService.FontStyle.md)

### FilterMissedFontsByPsNames

```csharp
IEnumerable<string> FilterMissedFontsByPsNames(IEnumerable<string> requestedFontsByPsName)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Collections.Generic.IEnumerable<System.String>` | *requestedFontsByPsName* |  |

##### Returns

`System.Collections.Generic.IEnumerable<System.String>`

### FilterMissedFontsByFontFamilyAndStyle&gt;)

```csharp
IEnumerable<string> FilterMissedFontsByFontFamilyAndStyle(IEnumerable<(string, string)> requestedFonts)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.Collections.Generic.IEnumerable<System.ValueTuple<System.String,System.String>>` | *requestedFonts* |  |

##### Returns

`System.Collections.Generic.IEnumerable<System.String>`

### UpdateLocalFonts

```csharp
[Obsolete("This method is obsolete, use InitializeAsync instead.")]
void UpdateLocalFonts()
```

### GetFontStreamByPostscriptNameAsync

```csharp
Task<Stream> GetFontStreamByPostscriptNameAsync(string psName)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *psName* |  |

##### Returns

`System.Threading.Tasks.Task<System.IO.Stream>`

### GetFontStreamByPostscriptName

```csharp
[Obsolete("This method is obsolete, use GetFontStreamByPostscriptNameAsync instead.")]
Task<Stream> GetFontStreamByPostscriptName(string psName)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *psName* |  |

##### Returns

`System.Threading.Tasks.Task<System.IO.Stream>`

### GetFontPath

```csharp
string GetFontPath(string fontKey)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fontKey* |  |

##### Returns

`System.String`

### GetFontStreamByPathAsync

```csharp
Task<Stream> GetFontStreamByPathAsync(string fontPath)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fontPath* |  |

##### Returns

`System.Threading.Tasks.Task<System.IO.Stream>`

### GetFontStreamByPath

```csharp
[Obsolete("This method is obsolete, use GetFontStreamByPathAsync instead.")]
Task<Stream> GetFontStreamByPath(string fontPath)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *fontPath* |  |

##### Returns

`System.Threading.Tasks.Task<System.IO.Stream>`

### FixFontPsName

```csharp
string FixFontPsName(string psName)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *psName* |  |

##### Returns

`System.String`

### CreateFont

```csharp
Font CreateFont(FontRegistry fontRegistry, string postScriptName, float size, float dpiX, float dpiY)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry` | *fontRegistry* |  |
| `System.String` | *postScriptName* |  |
| `System.Single` | *size* |  |
| `System.Single` | *dpiX* |  |
| `System.Single` | *dpiY* |  |

##### Returns

`Aurigma.GraphicsMill.AdvancedDrawing.Font`
