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

# Class TextUtils

> **Inheritance:** `System.Object` -> TextUtils

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

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

```csharp title="Syntax"
public static class TextUtils
```

## Inherited Members

* `System.Object.ToString`
* `System.Object.Equals(System.Object)`
* `System.Object.Equals(System.Object,System.Object)`
* `System.Object.ReferenceEquals(System.Object,System.Object)`
* `System.Object.GetHashCode`
* `System.Object.GetType`
* `System.Object.MemberwiseClone`

## Methods

### IsEmpty

```csharp
public static bool IsEmpty(string text)
```

##### Parameters

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

##### Returns

`System.Boolean`

### IsEmptyXmlText

```csharp
public static bool IsEmptyXmlText(string text)
```

##### Parameters

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

##### Returns

`System.Boolean`

### IsValidXml

```csharp
public static bool IsValidXml(string text)
```

##### Parameters

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

##### Returns

`System.Boolean`

### ConvertXmlToPlain

```csharp
public static string ConvertXmlToPlain(string xml)
```

##### Parameters

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

##### Returns

`System.String`

### ProcessXmlTexts

```csharp
public static string ProcessXmlTexts(string gmXml, Action<XText> processTextNode)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *gmXml* |  |
| `System.Action<System.Xml.Linq.XText>` | *processTextNode* |  |

##### Returns

`System.String`

### ScaleTextFontSize

```csharp
public static string ScaleTextFontSize(string gmXml, float scale, float? minFontSize, float? maxFontSize)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *gmXml* |  |
| `System.Single` | *scale* |  |
| `System.Nullable<System.Single>` | *minFontSize* |  |
| `System.Nullable<System.Single>` | *maxFontSize* |  |

##### Returns

`System.String`

### ProcessSpanStyles

```csharp
public static string ProcessSpanStyles(string gmXml, Func<Dictionary<string, string[]>, bool> processStyle = null, Func<Dictionary<string, string[]>, Tuple<string, string>> createExtraAttribute = null)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *gmXml* |  |
| `System.Func<System.Collections.Generic.Dictionary<System.String,System.String[]>,System.Boolean>` | *processStyle* |  |
| `System.Func<System.Collections.Generic.Dictionary<System.String,System.String[]>,System.Tuple<System.String,System.String>>` | *createExtraAttribute* |  |

##### Returns

`System.String`

### RemoveSpanAttribute

```csharp
public static string RemoveSpanAttribute(string gmXml, string attributeName)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *gmXml* |  |
| `System.String` | *attributeName* |  |

##### Returns

`System.String`

### GetMaxFontSize

```csharp
public static float GetMaxFontSize(BaseTextItemHandler textItemHandler, bool isFormatted)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Canvas.ItemHandlers.BaseTextItemHandler](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Canvas.ItemHandlers/BaseTextItemHandler.md) | *textItemHandler* |  |
| `System.Boolean` | *isFormatted* |  |

##### Returns

`System.Single`

### GetGmXmlFonts

```csharp
public static IEnumerable<string> GetGmXmlFonts(string xml, IFontService fontService)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `System.String` | *xml* |  |
| [Aurigma.DesignAtoms.Services.IFontService](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/IFontService.md) | *fontService* |  |

##### Returns

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

### GetItemFonts

```csharp
public static IEnumerable<string> GetItemFonts(BaseTextItem item, IFontService fontService)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Model.Items.BaseTextItem](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Items/BaseTextItem.md) | *item* |  |
| [Aurigma.DesignAtoms.Services.IFontService](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Services/IFontService.md) | *fontService* |  |

##### Returns

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

### GetItemFontsExtended

```csharp
public static IEnumerable<FontInfo> GetItemFontsExtended(BaseTextItem item)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Model.Items.BaseTextItem](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Model.Items/BaseTextItem.md) | *item* |  |

##### Returns

`System.Collections.Generic.IEnumerable<Aurigma.GraphicsMill.AdvancedDrawing.FontInfo>`

### ContainsRtlChars

```csharp
public static bool ContainsRtlChars(string itemText)
```

##### Parameters

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

##### Returns

`System.Boolean`

### IsSingleLineText

```csharp
public static bool IsSingleLineText(string text)
```

##### Parameters

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

##### Returns

`System.Boolean`
