Use FontLoader to create FontFile objects from memory or a file.
More...
#include <kanzi/core.ui/font/font_loader.hpp>
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.
◆ FontLoader()
kanzi::FontLoader::FontLoader |
( |
Domain * |
domain | ) |
|
|
explicit |
Constructor.
- Parameters
-
domain | Pointer to domain object. |
◆ ~FontLoader()
virtual kanzi::FontLoader::~FontLoader |
( |
| ) |
|
|
virtual |
◆ createFont()
◆ createFontFromFile()
virtual FontFileSharedPtr kanzi::FontLoader::createFontFromFile |
( |
string_view |
filePath | ) |
|
|
virtual |
Creates a font from a file.
- Parameters
-
filePath | Full path to the font file, including the file name. Kanzi uses the file name to set the font name. |
- Returns
- Shared pointer to the created font file object.
- Exceptions
-
KZS_EXCEPTION_FILE_OPEN_FAILED | if font file cannot be read. |
Reimplemented in kanzi::FreeTypeFontLoader, kanzi::ItypeFontLoader, and kanzi::BitmapFontLoader.
◆ createFontFromMemory()
virtual FontFileSharedPtr kanzi::FontLoader::createFontFromMemory |
( |
const byte * |
data, |
|
|
size_t |
size, |
|
|
string_view |
name, |
|
|
bool |
createMemoryCopy |
|
) |
| |
|
virtual |
◆ getDomain()
Domain* kanzi::FontLoader::getDomain |
( |
| ) |
|
|
protected |
Returns the domain used to construct the FontLoader.
- Returns
- Pointer to the domain.
The documentation for this class was generated from the following file: