sc.fontmanager
The font manager lets youi 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.
- 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
sc.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
sc.fontmanager.getFontNames()
Retrieves all font names currently loaded.
Returns:
- [ string[] ] A list of all font names currently loaded.
getDefaultFontName
sc.fontmanager.getDefaultFontName()
Retrieves the name of the default font.
Returns:
- [ string ] The name of the default font.
getDefaultFont
sc.fontmanager.getDefaultFont()
Retrieves the default font used by ScrapComputers.
Returns:
- [ SCFont ] The default font.