IFFont

Main interface for a type of font in the engine, allowing drawing onto the 2D viewport and textures. More...

#include

Public Member Functions

virtual void Release ()=0
Releases the font object.
virtual bool Load (const char *pFontFilePath, unsigned int width, unsigned int height, unsigned int flags)=0
Loads a font from a TTF file.
virtual bool Load (const char *pXMLFile)=0
Loads a font from a XML file.
virtual void Free ()=0
Frees internally memory internally allocated by Load().
virtual void DrawString (float x, float y, const char *pStr, const bool asciiMultiLine, const STextDrawContext &ctx)=0
Draws a formatted string (UTF-8).
virtual void DrawString (float x, float y, float z, const char *pStr, const bool asciiMultiLine, const STextDrawContext &ctx)=0
Draws a formatted string (UTF-8), taking z into account.
virtual Vec2 GetTextSize (const char *pStr, const bool asciiMultiLine, const STextDrawContext &ctx)=0
Computes the text size (UTF-8).
virtual size_t GetTextLength (const char *pStr, const bool asciiMultiLine) const =0
Computes virtual text-length (UTF-8) (because of special chars...).
virtual void WrapText (string &result, float maxWidth, const char *pStr, const STextDrawContext &ctx)=0
Wraps text based on specified maximum line width (UTF-8)
virtual void GetMemoryUsage (ICrySizer *pSizer) const =0
Puts the memory used by this font into the given sizer.
virtual void GetGradientTextureCoord (float &minU, float &minV, float &maxU, float &maxV) const =0
useful for special feature rendering interleaved with fonts (e.g. box behind the text)
virtual unsigned int GetEffectId (const char *pEffectName) const =0
virtual void RenderCallback (float x, float y, float z, const char *pStr, const bool asciiMultiLine, const STextDrawContext &ctx, IRenderAuxGeom *pAux)=0
Only to be used by renderer, from the render thread.

Detailed Description

Main interface for a type of font in the engine, allowing drawing onto the 2D viewport and textures.