# LoadFontFace

> Load a source font file.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.TextCore.LowLevel](/engine/6000.5/script-reference/unityengine/textcore/lowlevel.md)
* **Assembly:** UnityEngine.TextCoreFontEngineModule

## LoadFontFace(string)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(string filePath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The path of the source font file relative to the project.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(string, int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(string filePath, int pointSize)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The path of the source font file relative to the project.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The point size used to scale the font face.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(string, float, int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(string filePath, float pointSize, int faceIndex)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The path of the source font file relative to the project.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The point size used to scale the font face.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0).

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(byte\[])

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(byte[] sourceFontFile)
```

### Parameters

**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The byte array that contains the source font file.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(byte\[], int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(byte[] sourceFontFile, int pointSize)
```

### Parameters

**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The byte array that contains the source font file.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The point size used to scale the font face.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(byte\[], float, int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(byte[] sourceFontFile, float pointSize, int faceIndex)
```

### Parameters

**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The byte array that contains the source font file.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The point size used to scale the font face.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0).

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(Font)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(Font font)
```

### Parameters

**** (\[Font]\(/engine/6000.5/script-reference/unityengine/font)): The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(Font, int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(Font font, int pointSize)
```

### Parameters

**** (\[Font]\(/engine/6000.5/script-reference/unityengine/font)): The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The point size used to scale the font face.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(Font, float, int)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(Font font, float pointSize, int faceIndex)
```

### Parameters

**** (\[Font]\(/engine/6000.5/script-reference/unityengine/font)): The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The point size used to scale the font face.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The face index of the font face to load. When the font file is a TrueType collection (.TTC), this specifies the face index of the font face to load. If the font file is a TrueType Font (.TTF) or OpenType Font (.OTF) file, the face index is always zero (0).

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(string, string)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(string familyName, string styleName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The family name of the font face to load.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The style name of the font face to load.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |

## LoadFontFace(string, string, float)

Load a source font file.

```csharp
public static FontEngineError LoadFontFace(string familyName, string styleName, float pointSize)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The family name of the font face to load.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The style name of the font face to load.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The point size used to scale the font face.

### Returns

| Type                                                                                                | Description                                                   |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [FontEngineError](/engine/6000.5/script-reference/unityengine/textcore/lowlevel/fontengineerror.md) | A value of zero (0) if the font face was loaded successfully. |
