Use FontLoader to create FontFile objects from memory or a file. More...
#include <kanzi/core.ui/font/font_loader.hpp>
Public Member Functions | |
virtual FontFileSharedPtr | createFont (string_view name) |
Creates an empty font file object. | |
virtual FontFileSharedPtr | createFontFromFile (string_view filePath) |
Creates a font from a file. | |
virtual FontFileSharedPtr | createFontFromMemory (const byte *data, size_t size, string_view name, bool createMemoryCopy) |
Creates a FontFile object from the memory. | |
FontLoader (Domain *domain) | |
Constructor. | |
virtual | ~FontLoader () |
Destructor. | |
Protected Member Functions | |
Domain * | getDomain () |
Returns the domain used to construct the FontLoader. | |
Use FontLoader to create FontFile objects from memory or a file.
You can create pure FontFile objects using the base class. However, in most cases, use the derived classes specific to a rasterizer.
|
explicit |
Constructor.
domain | Pointer to domain object. |
|
virtual |
Destructor.
|
virtual |
Creates an empty font file object.
Load the font data using the FontFile::loadFromKZB() function.
name | Name of the created font file object. |
Reimplemented in kanzi::BitmapFontLoader, kanzi::FreeTypeFontLoader, and kanzi::ItypeFontLoader.
|
virtual |
Creates a font from a file.
filePath | Full path to the font file, including the file name. Kanzi uses the file name to set the font name. |
KZS_EXCEPTION_FILE_OPEN_FAILED | if font file cannot be read. |
Reimplemented in kanzi::BitmapFontLoader, kanzi::FreeTypeFontLoader, and kanzi::ItypeFontLoader.
|
virtual |
Creates a FontFile object from the memory.
data | Pointer to the font data in the memory. |
size | Size of the font data in the memory. |
name | Name of the created FontFile object. |
createMemoryCopy | True if you want to create for the object a new copy of the given font data. |
Reimplemented in kanzi::BitmapFontLoader, kanzi::FreeTypeFontLoader, and kanzi::ItypeFontLoader.
|
protected |
Returns the domain used to construct the FontLoader.