dxCreateFont
Client
Creates a font from a font file in the resource, for the text functions.
element|false dxCreateFont(string filepath [, int size = 9, bool bold = false, string quality = proof, string name = ""])
Parameters
| Name | Type | Description |
|---|---|---|
| filepath | string | Path of the font file (for example .ttf). |
| size | int | Size, from 5 to 150. Values outside are clamped.default 9 |
| bold | bool | Use bold.default false |
| quality | string | Quality: default, draft, proof, nonantialiased, antialiased, cleartype or cleartype_natural. Only nonantialiased turns smoothing off.default proof |
| name | string | Name to use the font by in the text functions, as a string. Empty makes an unnamed font.default "" |
Returns
The font element, or false when the file could not be read or the font could not be made.
Example
local title = dxCreateFont("fonts/Montserrat-Bold.ttf", 18, false, "antialiased", "title")
addEventHandler("onClientRender", root, function()
dxDrawText("MYMP", 20, 20, 0, 0, tocolor(255, 255, 255), 1, title)
dxDrawText("Roleplay", 20, 60, 0, 0, tocolor(255, 255, 255), 1, "title")
end)