Kanzi  3.9.4
Kanzi Engine API
kanzi::GlyphCacheManager Class Reference

GlyphCacheManager creates and maintains glyph caches for different font file and font size combinations. More...

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

Public Member Functions

GlyphCacheSharedPtr acquireGlyphCache (FontFileSharedPtr font, float fontSize)
 Retrieves the glyph cache associated with the given font file and font size. More...
 
 GlyphCacheManager (Domain &domain)
 Constructor. More...
 
void purgeGlyphCaches ()
 Removes glyph caches that have no external references. More...
 
void setGlyphCacheSize (unsigned int glyphCacheWidth, unsigned int glyphCacheHeight)
 Sets the size of the textures in glyph caches created by the glyph cache manager. More...
 
 ~GlyphCacheManager ()
 Destructor. More...
 

Detailed Description

GlyphCacheManager creates and maintains glyph caches for different font file and font size combinations.

Constructor & Destructor Documentation

◆ GlyphCacheManager()

kanzi::GlyphCacheManager::GlyphCacheManager ( Domain domain)
explicit

Constructor.

Parameters
domainThe domain to which you want the glyph cache manager to belong.

◆ ~GlyphCacheManager()

kanzi::GlyphCacheManager::~GlyphCacheManager ( )

Destructor.

Member Function Documentation

◆ setGlyphCacheSize()

void kanzi::GlyphCacheManager::setGlyphCacheSize ( unsigned int  glyphCacheWidth,
unsigned int  glyphCacheHeight 
)

Sets the size of the textures in glyph caches created by the glyph cache manager.

Parameters
glyphCacheWidthWidth of textures.
glyphCacheHeightHeight of textures.

◆ acquireGlyphCache()

GlyphCacheSharedPtr kanzi::GlyphCacheManager::acquireGlyphCache ( FontFileSharedPtr  font,
float  fontSize 
)

Retrieves the glyph cache associated with the given font file and font size.

If a glyph cache does not yet exist, this function creates a glyph cache. Even if the there are no users for the glyph cache, the GlyphCacheManager keeps the glyph cache alive until purgeGlyphCaches() is called.

Parameters
fontFont used for rendering glyphs in the glyph cache.
fontSizeSize of the Font used for rendering glyphs in the glyph cache.
Returns
Pointer to the glyph cache.

◆ purgeGlyphCaches()

void kanzi::GlyphCacheManager::purgeGlyphCaches ( )

Removes glyph caches that have no external references.


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