font.create
Client
Creates a new font instance from a file path
Syntax
local instance = font.create(
path
)Parameters
| Type | Name | Description |
|---|---|---|
string | path | File path to a supported font asset Refer Formats section |
Returns
| Type | Name | Description |
|---|---|---|
font | instance | Created font instance |
Formats
| Format | Extension | Description |
|---|---|---|
| TrueType | .ttf | Standard scalable font format |
| OpenType | .otf | Extended scalable font format |
| Web Open Font | .woff | Compressed web font format |
| Web Open Font 2 | .woff2 | Modern compressed web font format |
Examples
local fnt = font.create("assets/font.ttf")local fnt = font.create("assets/font.otf")local fnt = font.create("assets/font.woff2")