LoadFontFace
Load a source font file.
Read time 4 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine.TextCore.LowLevel
- Assembly: UnityEngine.TextCoreFontEngineModule
LoadFontFace(string)
Load a source font file.
public static FontEngineError LoadFontFace(string filePath)
Parameters
The path of the source font file relative to the project.
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(string, int)
Load a source font file.
public static FontEngineError LoadFontFace(string filePath, int pointSize)
Parameters
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(string, float, int)
Load a source font file.
public static FontEngineError LoadFontFace(string filePath, float pointSize, int faceIndex)
Parameters
The path of the source font file relative to the project.
The point size used to scale the font face.
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 | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(byte[])
Load a source font file.
public static FontEngineError LoadFontFace(byte[] sourceFontFile)
Parameters
The byte array that contains the source font file.
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(byte[], int)
Load a source font file.
public static FontEngineError LoadFontFace(byte[] sourceFontFile, int pointSize)
Parameters
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(byte[], float, int)
Load a source font file.
public static FontEngineError LoadFontFace(byte[] sourceFontFile, float pointSize, int faceIndex)
Parameters
The byte array that contains the source font file.
The point size used to scale the font face.
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 | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(Font)
Load a source font file.
public static FontEngineError LoadFontFace(Font font)
Parameters
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 | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(Font, int)
Load a source font file.
public static FontEngineError LoadFontFace(Font font, int pointSize)
Parameters
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(Font, float, int)
Load a source font file.
public static FontEngineError LoadFontFace(Font font, float pointSize, int faceIndex)
Parameters
The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.
The point size used to scale the font face.
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 | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(string, string)
Load a source font file.
public static FontEngineError LoadFontFace(string familyName, string styleName)
Parameters
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |
LoadFontFace(string, string, float)
Load a source font file.
public static FontEngineError LoadFontFace(string familyName, string styleName, float pointSize)
Parameters
Returns
Type | Description |
|---|---|
| FontEngineError | A value of zero (0) if the font face was loaded successfully. |