Kanzi 3.9.10
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.
 
FontFileSharedPtr createFontFromFile (string_view filePath) override
 Creates a FontFile object from a file.
 
FontFileSharedPtr createFontFromMemory (const byte *data, size_t size, string_view name, bool createMemoryCopy) override
 Creates a FontFile object from the memory.
 
 FreeTypeFontLoader (Domain *domain)
 Constructor.
 
 ~FreeTypeFontLoader () override
 Destructor.
 
- Public Member Functions inherited from kanzi::FontLoader
 FontLoader (Domain *domain)
 Constructor.
 
virtual ~FontLoader ()
 Destructor.
 

Friends

class FreeTypeFontFile
 

Additional Inherited Members

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

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 Symbol Documentation

◆ FreeTypeFontFile


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