Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::FreeTypeFontLoader Class Reference

FontLoader implementation for the Freetype rasterizer. More...

#include <kanzi/plugins/freetype/freetype_font_loader.hpp>

Inheritance diagram for kanzi::FreeTypeFontLoader:
[legend]

Public Member Functions

FontFileSharedPtr createFont (string_view name) override
 Creates an empty FontFile object. More...
 
FontFileSharedPtr createFontFromFile (string_view filePath) override
 Creates a FontFile object from a file. More...
 
FontFileSharedPtr createFontFromMemory (const byte *data, size_t size, string_view name, bool createMemoryCopy) override
 Creates a FontFile object from the memory. More...
 
 FreeTypeFontLoader (Domain *domain)
 Constructor. More...
 
 ~FreeTypeFontLoader () override
 Destructor. More...
 
- Public Member Functions inherited from kanzi::FontLoader
 FontLoader (Domain *domain)
 Constructor. More...
 
virtual ~FontLoader ()
 Destructor. More...
 

Friends

class FreeTypeFontFile
 

Additional Inherited Members

- Protected Member Functions inherited from kanzi::FontLoader
DomaingetDomain ()
 Returns the domain used to construct the FontLoader. More...
 

Detailed Description

FontLoader implementation for the Freetype rasterizer.

Use it to create FreetypeFontFile objects from memory or a file.

Constructor & Destructor Documentation

◆ FreeTypeFontLoader()

kanzi::FreeTypeFontLoader::FreeTypeFontLoader ( Domain domain)
explicit

Constructor.

Parameters
domainPointer to domain object.

◆ ~FreeTypeFontLoader()

kanzi::FreeTypeFontLoader::~FreeTypeFontLoader ( )
override

Destructor.

Member Function Documentation

◆ createFont()

FontFileSharedPtr kanzi::FreeTypeFontLoader::createFont ( string_view  name)
overridevirtual

Creates an empty FontFile object.

Load the font data using the FreetypeFontFile::loadFromKZB() function.

Parameters
nameName 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
filePathFull 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
Ifthe 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
dataPointer to the font data in the memory.
sizeSize of the font data in the memory.
nameName of the created FontFile object.
createMemoryCopyWhether 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.

Friends And Related Function Documentation

◆ FreeTypeFontFile

friend class FreeTypeFontFile
friend

The documentation for this class was generated from the following file: