Kanzi 3.9.10
kanzi::FontRuntime Class Reference

Runtime font. More...

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

Public Member Functions

float getAdvance (unsigned int glyphIndex) const
 Returns the advance metric of the given glyph.
 
float getAscender () const
 Returns the ascender of a font.
 
RectangleFloat getBoundingBox (unsigned int glyphIndex) const
 Returns the bounding box of the given glyph.
 
float getDescender () const
 Returns the descender of a font.
 
FontFamilySharedPtr getFontFamily () const
 Gets the font family the runtime font object uses.
 
FontFilegetFontFile () const
 Returns the font file that this runtime font is using.
 
const FontStyleDefinitiongetFontStyleDefinition () const
 Returns the font style definition of the runtime font.
 
GlyphCachegetGlyphCache () const
 Gets the glyph cache that the runtime font object uses.
 
FontFile::GlyphDataSharedPtr getGlyphData (unsigned int glyphIndex) const
 Returns the bitmap data for the given glyph.
 
unsigned int getGlyphIndex (char32_t character) const
 Returns the glyph index in a font for the given unicode code point.
 
float getKerning (unsigned int previousGlyphIndex, unsigned int glyphIndex) const
 Returns the kerning between the given pair of glyphs.
 
float getLineHeight () const
 Returns the line height of a runtime font.
 
void setupFontFile () const
 Sets the size of the underlying font file object.
 
 ~FontRuntime ()
 Destructor.
 

Friends

class FontManager
 

Detailed Description

Runtime font.

Use FontRuntime to draw text using TextFormat. To acquire the runtime font, use FontManager::getRuntimeFont.

Since
Kanzi 3.8.0

Constructor & Destructor Documentation

◆ ~FontRuntime()

kanzi::FontRuntime::~FontRuntime ( )

Destructor.

Member Function Documentation

◆ getFontFile()

FontFile & kanzi::FontRuntime::getFontFile ( ) const

Returns the font file that this runtime font is using.

Returns
The font file that this runtime font is using.

◆ getFontStyleDefinition()

const FontStyleDefinition & kanzi::FontRuntime::getFontStyleDefinition ( ) const

Returns the font style definition of the runtime font.

Returns
Reference to the font style definition that the runtime font holds.

◆ getLineHeight()

float kanzi::FontRuntime::getLineHeight ( ) const

Returns the line height of a runtime font.

Returns
Line height of the font.

◆ getAscender()

float kanzi::FontRuntime::getAscender ( ) const

Returns the ascender of a font.

Returns
Ascender of the font.

◆ getDescender()

float kanzi::FontRuntime::getDescender ( ) const

Returns the descender of a font.

Returns
Descender of the font.

◆ getGlyphIndex()

unsigned int kanzi::FontRuntime::getGlyphIndex ( char32_t character) const

Returns the glyph index in a font for the given unicode code point.

Parameters
characterThe unicode code point to use.
Returns
Glyph index for the given code point.

◆ getAdvance()

float kanzi::FontRuntime::getAdvance ( unsigned int glyphIndex) const

Returns the advance metric of the given glyph.

Parameters
glyphIndexIndex of the font glyph data acquired from getGlyphIndex().
Returns
Advance for the given glyph.

◆ getBoundingBox()

RectangleFloat kanzi::FontRuntime::getBoundingBox ( unsigned int glyphIndex) const

Returns the bounding box of the given glyph.

Parameters
glyphIndexIndex of the font glyph data acquired from getGlyphIndex().
Returns
Bounding box of the given glyph.

◆ getKerning()

float kanzi::FontRuntime::getKerning ( unsigned int previousGlyphIndex,
unsigned int glyphIndex ) const

Returns the kerning between the given pair of glyphs.

Parameters
previousGlyphIndexIndex of the font glyph data of the preceding glyph.
glyphIndexIndex of the font glyph data acquired from getGlyphIndex().
Returns
Kerning between the given glyph pair.

◆ getGlyphData()

FontFile::GlyphDataSharedPtr kanzi::FontRuntime::getGlyphData ( unsigned int glyphIndex) const

Returns the bitmap data for the given glyph.

Parameters
glyphIndexIndex of the font glyph data acquired from getGlyphIndex().
Returns
Bitmap data for the given glyph.

◆ setupFontFile()

void kanzi::FontRuntime::setupFontFile ( ) const

Sets the size of the underlying font file object.

Several font and font family objects can share the same font file object. Call this function before all other operations.

◆ getFontFamily()

FontFamilySharedPtr kanzi::FontRuntime::getFontFamily ( ) const

Gets the font family the runtime font object uses.

Returns
The font family the runtime font object uses.

◆ getGlyphCache()

GlyphCache & kanzi::FontRuntime::getGlyphCache ( ) const

Gets the glyph cache that the runtime font object uses.

Returns
The glyph cache that the runtime font object uses.

Friends And Related Symbol Documentation

◆ FontManager


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