RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | List of all members
ramses::IFontInstance Class Referenceabstract

Interface for font instance that can be used to query glyph metadata and bitmaps. More...

#include <IFontInstance.h>

Public Member Functions

virtual ~IFontInstance ()=default
 Empty destructor. More...
 
virtual bool supportsCharacter (char32_t character) const =0
 Check if font instance supports a char using it's UTF32 char code and cache the result. More...
 
virtual std::unordered_set< unsigned long > getAllSupportedCharacters ()=0
 Get all characters that are supported (mapped to a glyph) by IFontInstance. More...
 
virtual int getHeight () const =0
 Get the line height of the font instance. More...
 
virtual int getAscender () const =0
 Get the line ascender of the font instance (see Freetype2 docs) More...
 
virtual int getDescender () const =0
 Get the line descender of the font instance (see Freetype2 docs) More...
 
virtual void loadAndAppendGlyphMetrics (std::u32string::const_iterator charsBegin, std::u32string::const_iterator charsEnd, GlyphMetricsVector &positionedGlyphs)=0
 Load the glyphs metrics for all characters in a string and appends them to the provided vector of GLYPHS. More...
 
virtual GlyphData loadGlyphBitmapData (GlyphId glyphId, uint32_t &sizeX, uint32_t &sizeY)=0
 Load the glyph data for a specific glyph id. More...
 

Detailed Description

Interface for font instance that can be used to query glyph metadata and bitmaps.

Constructor & Destructor Documentation

◆ ~IFontInstance()

virtual ramses::IFontInstance::~IFontInstance ( )
virtualdefault

Empty destructor.

Member Function Documentation

◆ getAllSupportedCharacters()

virtual std::unordered_set<unsigned long> ramses::IFontInstance::getAllSupportedCharacters ( )
pure virtual

Get all characters that are supported (mapped to a glyph) by IFontInstance.

Returns
set with all supported UTF32 char codes

◆ getAscender()

virtual int ramses::IFontInstance::getAscender ( ) const
pure virtual

Get the line ascender of the font instance (see Freetype2 docs)

Returns
Line ascender (in rasterized texels of glyphs)

◆ getDescender()

virtual int ramses::IFontInstance::getDescender ( ) const
pure virtual

Get the line descender of the font instance (see Freetype2 docs)

Returns
Line descender (in rasterized texels of glyphs)

◆ getHeight()

virtual int ramses::IFontInstance::getHeight ( ) const
pure virtual

Get the line height of the font instance.

Returns
Line height (in rasterized texels of glyphs)

◆ loadAndAppendGlyphMetrics()

virtual void ramses::IFontInstance::loadAndAppendGlyphMetrics ( std::u32string::const_iterator  charsBegin,
std::u32string::const_iterator  charsEnd,
GlyphMetricsVector positionedGlyphs 
)
pure virtual

Load the glyphs metrics for all characters in a string and appends them to the provided vector of GLYPHS.

Parameters
[in]charsBeginIterator for the beginning of characters from UTF32 string that should be loaded
[in]charsEndIterator for the end of characters from UTF32 string that should be loaded
[out]positionedGlyphsVector of glyphs to which newly loaded glyph metrics are appended

◆ loadGlyphBitmapData()

virtual GlyphData ramses::IFontInstance::loadGlyphBitmapData ( GlyphId  glyphId,
uint32_t &  sizeX,
uint32_t &  sizeY 
)
pure virtual

Load the glyph data for a specific glyph id.

Parameters
[in]glyphIdId of glyph for which to load data
[out]sizeXWidth of glyph data
[out]sizeYHeight of glyph data
Returns
The glyph data if glyphId is found, or empty glyph data otherwise

◆ supportsCharacter()

virtual bool ramses::IFontInstance::supportsCharacter ( char32_t  character) const
pure virtual

Check if font instance supports a char using it's UTF32 char code and cache the result.

Parameters
[in]characterThe UTF32 char code of the character
Returns
True if the character is supported, false otherwise

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