Private
Initializes a new instance of the FontManager
class.
Private
cachedA cache of fonts keyed by font name and size.
Private
fontA label node used for retrieving system fonts.
Private
getRetrieves a font based on the provided name and size. If the font is not cached, it will be created and cached.
The name or path of the font.
Optional
size: numberThe size of the font.
The font object if found or created, otherwise undefined.
Retrieves a font based on the provided key. The key can be a font name, a size, or both separated by a comma. If the size is missing, the font name must be one of the system fonts. If the font name is missing, it will use the system default font.
The key representing the font name and/or size.
The font object if found, otherwise undefined.
Manages font caching and retrieval for the application.
FontManager
Method
constructor Initializes a new instance of the FontManager class.
Method
getFontWithKey Retrieves a font based on the provided key. The key can be a font name, a size, or both separated by a comma. If the size is missing, the font name must be one of the system fonts. If the font name is missing, it will use the system default font.
Param: key
The key representing the font name and/or size.
Returns
Method
private getFont Retrieves a font based on the provided name and size. If the font is not cached, it will be created and cached.
Param: name
The name of the font.
Param: size
The size of the font.
Returns
Throws