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

Friends

class BitmapFontFile
 

Additional Inherited Members

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

Detailed Description

FontLoader implementation for bitmap fonts.

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

Constructor & Destructor Documentation

◆ BitmapFontLoader()

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

Constructor.

Parameters
domainPointer to domain object.

◆ ~BitmapFontLoader()

kanzi::BitmapFontLoader::~BitmapFontLoader ( )
override

Destructor.

Member Function Documentation

◆ createFont()

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.

◆ createFontFromFile()

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.

◆ createFontFromMemory()

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

◆ BitmapFontFile


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