Skip to content

addCustomFont

Downloads and adds a custom font from a URL.

Syntax

lua
Ham.addCustomFont(fontName, fontUrl, size)

Parameters

NameTypeDescription
fontNamestringLocal filename to save as
fontUrlstringURL to download the font from
sizeintegerFont size in pixels

Returns

  • userdata|nil - Font handle or nil on failure

Example

lua
local customFont = Ham.addCustomFont("MyFont.ttf", "https://example.com/font.ttf", 16)

See Also

Released under the ISC License.