Font

The Font class extends the base Item class to manage font resources within the engine, providing methods for creating and manipulating font objects, allowing developers to customize fonts according to their needs while ensuring type safety through internal assertions. Typically used in scenarios where text rendering with specific styling is required, such as in user interfaces or game texts, Font facilitates the creation of visually consistent and customizable textual elements within applications.

Inherits from

Usage

To use this class, add the following require at the top of your script:

local Font = require 'engine/items/font'

Reference

class Font
module:
create(attributes)

Create a new font

Parameters:

attributes (table) – list of attributes. without, the font will be created with default values

Returns:

the created font

Return type:

Font