FontManager
The font manager lets you manage fonts and get them.
Structures
SCFont
A SCFont (SCF
in short, ScrapComputers Font
for full name) is a font that has a fixed with and height for EVERY singular character.
Fields
- fontWidth [ integer ] The width of the font.
- fontHeight [ integer ] The height of the font.
- characters [ string ] All characters that are usable in the font.
- errorChar [ string[] ] The character used for a gylph that doesn't exist.
- charset [ table<string, string[]> ] Contains all gylph data for all characters.
Functions
getFont
sm.scrapcomputers.fontManager.getFont(fontName)
Retrieves a font by name.
Arguments:
- fontName [ string ] The name of the font to retrieve.
Returns:
- [ SCFont? ] The requested font, or nil if not found.
- [ string? ] The error message, or nil if the font was found successfully.
getFontNames
sm.scrapcomputers.fontManager.getFontNames()
Retrieves all font names currently loaded.
Returns:
- [ string[] ] A list of all font names currently loaded.
getDefaultFontName
sm.scrapcomputers.fontManager.getDefaultFontName()
Retrieves the name of the default font.
Returns:
- [ string ] The name of the default font.
getDefaultFont
sm.scrapcomputers.fontManager.getDefaultFont()
Retrieves the default font used by ScrapComputers.
Returns:
- [ SCFont ] The default font.