Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LoadFontFace

Load a source font file.
Read time 4 minutesLast updated 10 days ago

Definition

LoadFontFace(string)

Load a source font file.
public static FontEngineError LoadFontFace(string filePath)

Parameters

filePath

The path of the source font file relative to the project.

Returns

Type

Description

FontEngineErrorA 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

filePath

The path of the source font file relative to the project.

pointSize

The point size used to scale the font face.

Returns

Type

Description

FontEngineErrorA 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

filePath

The path of the source font file relative to the project.

pointSize

The point size used to scale the font face.

faceIndex

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

FontEngineErrorA 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

sourceFontFile

The byte array that contains the source font file.

Returns

Type

Description

FontEngineErrorA 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

sourceFontFile

The byte array that contains the source font file.

pointSize

The point size used to scale the font face.

Returns

Type

Description

FontEngineErrorA 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

sourceFontFile

The byte array that contains the source font file.

pointSize

The point size used to scale the font face.

faceIndex

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

FontEngineErrorA 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

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

FontEngineErrorA 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

font

The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.

pointSize

The point size used to scale the font face.

Returns

Type

Description

FontEngineErrorA 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

font

The font to load the data from. The Unity font must be set to Dynamic mode with Include Font Data selected.

pointSize

The point size used to scale the font face.

faceIndex

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

FontEngineErrorA 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

familyName

The family name of the font face to load.

styleName

The style name of the font face to load.

Returns

Type

Description

FontEngineErrorA 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

familyName

The family name of the font face to load.

styleName

The style name of the font face to load.

pointSize

The point size used to scale the font face.

Returns

Type

Description

FontEngineErrorA value of zero (0) if the font face was loaded successfully.