FontLoader implementation for the Freetype rasterizer.
More...
#include <kanzi/plugins/freetype/freetype_font_loader.hpp>
FontLoader implementation for the Freetype rasterizer.
Use it to create FreetypeFontFile objects from memory or a file.
kanzi::FreeTypeFontLoader::FreeTypeFontLoader |
( |
Domain * |
domain | ) |
|
|
explicit |
Constructor.
- Parameters
-
domain | Pointer to domain object. |
kanzi::FreeTypeFontLoader::~FreeTypeFontLoader |
( |
| ) |
|
|
override |
Creates an empty FontFile object.
Load the font data using the FreetypeFontFile::loadFromKZB() function.
- Parameters
-
name | Name of the created FontFile object. |
- Returns
- Shared pointer to the created FontFile object.
Reimplemented from kanzi::FontLoader.
FontFileSharedPtr kanzi::FreeTypeFontLoader::createFontFromFile |
( |
string_view |
filePath | ) |
|
|
overridevirtual |
Creates a FontFile object 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 FontFile object.
- Exceptions
-
If | the method cannot read the font file, throws KZS_EXCEPTION_FILE_OPEN_FAILED. |
Reimplemented from kanzi::FontLoader.
FontFileSharedPtr kanzi::FreeTypeFontLoader::createFontFromMemory |
( |
const byte * |
data, |
|
|
size_t |
size, |
|
|
string_view |
name, |
|
|
bool |
createMemoryCopy |
|
) |
| |
|
overridevirtual |
Creates a FontFile object from the memory.
- Parameters
-
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 | Whether you want to create a copy of the given font data for the object. |
- Returns
- Shared pointer to the created FontFile object.
Reimplemented from kanzi::FontLoader.
The documentation for this class was generated from the following file: