class ffw::GuiFont

Class List > ffw :: GuiFont

Inherited by the following classes: ffw::GuiFontFineGraphics, ffw::GuiFontNanoVG

Classes

Type Name
struct Chunk

Public Functions

Type Name
GuiFont () = default
virtual ~GuiFont () = default
virtual bool isCreated () const = 0
virtual void destroy () = 0
virtual ffw::Pointf getStringSize (const std::string & str, float maxWidth, float lineHeight = 1.25f) const = 0
virtual float getEmptyLineHeight (float lineHeight = 1.25f) const = 0
virtual float getCharAdvance (unsigned int c) const = 0
Returns the advance of the codepoint.
virtual std::vector< Chunk > splitString (const std::string & str, float maxWidth, float lineHeight = 1.25f) const
virtual size_t getCharIndex (const std::string::value_type * str, size_t len, const Pointf & pos, float * x) const
virtual float getCharPos (const std::string::value_type * str, size_t len, size_t index) const

Public Functions Documentation

function GuiFont

ffw::GuiFont::GuiFont () = default

function ~GuiFont

virtual ffw::GuiFont::~GuiFont () = default

function isCreated

virtual bool ffw::GuiFont::isCreated () const = 0

function destroy

virtual void ffw::GuiFont::destroy () = 0

function getStringSize

virtual ffw::Pointf ffw::GuiFont::getStringSize (
    const std::string & str,
    float maxWidth,
    float lineHeight = 1.25f
) const = 0

function getEmptyLineHeight

virtual float ffw::GuiFont::getEmptyLineHeight (
    float lineHeight = 1.25f
) const = 0

function getCharAdvance

virtual float ffw::GuiFont::getCharAdvance (
    unsigned int c
) const = 0

Returns the advance of the codepoint.

Note:

This method is not needed if you use your custom implementation of splitString(), getCharIndex(), and getCharPos(). The default implementations use GuiTextWrapper class which uses this method.

function splitString

virtual std::vector< Chunk > ffw::GuiFont::splitString (
    const std::string & str,
    float maxWidth,
    float lineHeight = 1.25f
) const

function getCharIndex

virtual size_t ffw::GuiFont::getCharIndex (
    const std::string::value_type * str,
    size_t len,
    const Pointf & pos,
    float * x
) const

function getCharPos

virtual float ffw::GuiFont::getCharPos (
    const std::string::value_type * str,
    size_t len,
    size_t index
) const

The documentation for this class was generated from the following file: include/ffw/gui/guifont.h