Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::FontManager Class Reference

Use the FontManager class to: More...

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

Public Member Functions

 FontManager (Domain *domain)
 Constructor. More...
 
BitmapFontLoadergetBitmapFontLoader ()
 Gets a bitmap font loader. More...
 
FontEnginePlugin::FontEngine getFontEngine () const
 Returns the font engine used when fetching font loaders. More...
 
FontLoadergetFontLoader ()
 Gets a font loader. More...
 
FontLoadergetFontLoader (FontEnginePlugin::FontEngine engine)
 Gets a font loader using the specified font engine type. More...
 
GlyphCacheManagergetGlyphCacheManager () const
 Returns the glyph cache manager. More...
 
FontRuntimeSharedPtr getRuntimeFont (FontFamilySharedPtr fontFamily, const FontStyleDefinition &fontStyleDefinition)
 Creates a runtime font you can use to draw text with passed fontFile and fontStyleDefinition. More...
 
TextShaperPtr getShaper (const FontRuntime &font) const
 Gets a text shaper, which can shape text rendered with given font. More...
 
void setFontEngine (FontEnginePlugin::FontEngine engine)
 Sets the font engine backend to use when fetching font loaders. More...
 
bool tryLoadFontEngine (FontEnginePlugin::FontEngine engine) const
 Automatically recognizes and loads the plugin for a font engine backend. More...
 
virtual ~FontManager ()
 Destructor. More...
 

Friends

class Domain
 
class FontRuntime
 

Detailed Description

Use the FontManager class to:

  • Set the font rasterizer engine that you want to use.
  • Access a FontLoader to create a font file object.
  • Access GlyphCacheManager and GlyphCaches.
    Since
    Kanzi 3.7.0

Constructor & Destructor Documentation

◆ FontManager()

kanzi::FontManager::FontManager ( Domain domain)
explicit

Constructor.

Parameters
domainThe domain that owns the font manager.

◆ ~FontManager()

virtual kanzi::FontManager::~FontManager ( )
virtual

Destructor.

Member Function Documentation

◆ getBitmapFontLoader()

BitmapFontLoader& kanzi::FontManager::getBitmapFontLoader ( )

Gets a bitmap font loader.

When needed, Kanzi automatically creates a bitmap font loader.

Returns
Reference to the bitmap font loader.

◆ getFontLoader() [1/2]

FontLoader& kanzi::FontManager::getFontLoader ( )

Gets a font loader.

When needed, Kanzi automatically creates a font loader.

Returns
Reference to the font loader.

◆ getFontLoader() [2/2]

FontLoader& kanzi::FontManager::getFontLoader ( FontEnginePlugin::FontEngine  engine)

Gets a font loader using the specified font engine type.

When needed, Kanzi automatically creates a font loader.

Parameters
engineThe type of font engine to use for this loader.
Returns
Reference to the font loader.

◆ setFontEngine()

void kanzi::FontManager::setFontEngine ( FontEnginePlugin::FontEngine  engine)

Sets the font engine backend to use when fetching font loaders.

If the font engine backend is not already loaded, Kanzi loads the requested backend.

Parameters
engineThe type of font engine backend to use.

◆ getFontEngine()

FontEnginePlugin::FontEngine kanzi::FontManager::getFontEngine ( ) const

Returns the font engine used when fetching font loaders.

Returns
Font engine used when fetching font loaders.

◆ getGlyphCacheManager()

GlyphCacheManager& kanzi::FontManager::getGlyphCacheManager ( ) const

Returns the glyph cache manager.

Returns
Reference to the glyph cache manager.

◆ getShaper()

TextShaperPtr kanzi::FontManager::getShaper ( const FontRuntime font) const

Gets a text shaper, which can shape text rendered with given font.

Parameters
fontFont used in the text to be shaped.
Returns
Pointer to the shaper object.

◆ tryLoadFontEngine()

bool kanzi::FontManager::tryLoadFontEngine ( FontEnginePlugin::FontEngine  engine) const

Automatically recognizes and loads the plugin for a font engine backend.

Returns
If the function successfully loads the plugins for a font engine backend, returns true, otherwise false.

◆ getRuntimeFont()

FontRuntimeSharedPtr kanzi::FontManager::getRuntimeFont ( FontFamilySharedPtr  fontFamily,
const FontStyleDefinition fontStyleDefinition 
)

Creates a runtime font you can use to draw text with passed fontFile and fontStyleDefinition.

Parameters
fontFamilyA font family the runtime font uses.
fontStyleDefinitionFont style that the returned runtime font object must use.
Returns
Pointer to the runtime font object.
Since
Kanzi 3.8.0

Friends And Related Function Documentation

◆ FontRuntime

friend class FontRuntime
friend

◆ Domain

friend class Domain
friend

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