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.
◆ FreeTypeFontLoader()
kanzi::FreeTypeFontLoader::FreeTypeFontLoader |
( |
Domain * |
domain | ) |
|
|
explicit |
Constructor.
- Parameters
-
domain | Pointer to domain object. |
◆ ~FreeTypeFontLoader()
kanzi::FreeTypeFontLoader::~FreeTypeFontLoader |
( |
| ) |
|
|
override |
◆ createFont()
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.
◆ createFontFromFile()
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.
◆ createFontFromMemory()
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.
◆ FreeTypeFontFile
The documentation for this class was generated from the following file: