Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::BitmapFontLoader Class Reference

FontLoader implementation for bitmap fonts. More...

#include <kanzi/core.ui/font/bitmap_font_loader.hpp>

Inheritance diagram for kanzi::BitmapFontLoader:
[legend]

Public Member Functions

 BitmapFontLoader (Domain *domain)
 Constructor. More...
 
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...
 
 ~BitmapFontLoader () override
 Destructor. More...
 
- Public Member Functions inherited from kanzi::FontLoader
 FontLoader (Domain *domain)
 Constructor. More...
 
virtual ~FontLoader ()
 Destructor. More...
 

Friends

class BitmapFontFile
 

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 bitmap fonts.

Use it to create BitmapFontFile objects from the memory or a file.

Constructor & Destructor Documentation

kanzi::BitmapFontLoader::BitmapFontLoader ( Domain domain)
explicit

Constructor.

Parameters
domainPointer to domain object.
kanzi::BitmapFontLoader::~BitmapFontLoader ( )
override

Destructor.

Member Function Documentation

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

Creates an empty FontFile object.

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

Parameters
nameName of the created FontFile object.
Returns
Shared pointer to the created FontFile object.

Reimplemented from kanzi::FontLoader.

FontFileSharedPtr kanzi::BitmapFontLoader::createFontFromFile ( string_view  filePath)
overridevirtual

Creates a FontFile object from a file.

You must load bitmap files separately by calling BitmapFontFile::loadTexturesFromPath() after you create a FontFile object using this function.

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.

Reimplemented from kanzi::FontLoader.

FontFileSharedPtr kanzi::BitmapFontLoader::createFontFromMemory ( const byte data,
size_t  size,
string_view  name,
bool  createMemoryCopy 
)
overridevirtual

Creates a FontFile object from the memory.

You must load bitmap files separately by calling BitmapFontFile::loadTexturesFromPath() after you create a font using this function.

Parameters
dataPointer to the font data in the memory.
sizeSize of the font data in the memory.
nameName of the created FontFile object.
createMemoryCopyTrue if you want to create for the object a new copy of the given font data.
Returns
Shared pointer to the created FontFile object.

Reimplemented from kanzi::FontLoader.

Friends And Related Function Documentation

friend class BitmapFontFile
friend

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