Kanzi 4.0.0-beta2
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.
 
GraphicsFormat getColorFontGraphicsFormat () const
 Returns the GraphicsFormat required to render colored glyphs.
 
 GlyphCacheManager (Domain &domain)
 Constructor.
 
void purgeGlyphCaches ()
 Removes glyph caches that have no external references.
 
void setGlyphCacheSize (size_t glyphCacheWidth, size_t glyphCacheHeight)
 Sets the size of the textures in glyph caches created by the glyph cache manager.
 
 ~GlyphCacheManager ()
 Destructor.
 

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 ( size_t glyphCacheWidth,
size_t glyphCacheHeight )

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

Parameters
glyphCacheWidthWidth of textures.
glyphCacheHeightHeight of textures.
Since
Kanzi 4.0.0 Changed parameters type to size_t.

◆ 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.

◆ getColorFontGraphicsFormat()

GraphicsFormat kanzi::GlyphCacheManager::getColorFontGraphicsFormat ( ) const

Returns the GraphicsFormat required to render colored glyphs.

Returns
GraphicsFormat required to render colored glyphs.
Since
Kanzi 4.0.0

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