Kanzi  3.9.9
Kanzi Engine C++ 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 fontFamily and fontStyleDefinition. More...
 
TextShaperPtr getShaper (const FontRuntime &font) const
 Gets a text shaper, which can shape text rendered with given font. More...
 
void setBackendProperties (FontEnginePlugin::FontEngine engine, const FontEnginePlugin::BackendProperties &properties)
 Sets the font backend properties that are used by FontEngine. 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

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

Constructor.

Parameters
domainThe domain that owns the font manager.
virtual kanzi::FontManager::~FontManager ( )
virtual

Destructor.

Member Function Documentation

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.
FontLoader& kanzi::FontManager::getFontLoader ( )

Gets a font loader.

When needed, Kanzi automatically creates a font loader.

Returns
Reference to the font loader.
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.
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.
FontEnginePlugin::FontEngine kanzi::FontManager::getFontEngine ( ) const

Returns the font engine used when fetching font loaders.

Returns
Font engine used when fetching font loaders.
GlyphCacheManager& kanzi::FontManager::getGlyphCacheManager ( ) const

Returns the glyph cache manager.

Returns
Reference to the glyph cache manager.
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.
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.
FontRuntimeSharedPtr kanzi::FontManager::getRuntimeFont ( FontFamilySharedPtr  fontFamily,
const FontStyleDefinition fontStyleDefinition 
)

Creates a runtime font you can use to draw text with passed fontFamily 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
void kanzi::FontManager::setBackendProperties ( FontEnginePlugin::FontEngine  engine,
const FontEnginePlugin::BackendProperties properties 
)

Sets the font backend properties that are used by FontEngine.

Parameters
engineFontEngine for which to set the backend properties.
propertiesFont backend properties to set, such as optional dictionaries.
Since
Kanzi 3.9.4

Friends And Related Function Documentation

friend class FontRuntime
friend
friend class Domain
friend

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