Font
Inherited: None
Description
The basic element of a font is a glyph. All required glyphs are contained in a special texture - Atlas. If at the moment of accessing the font the glyph is not present in the atlas, the glyph will be loaded there dynamically.
Public Methods
int |
atlasIndex (int glyph) const |
float |
cursorWidth () const |
int |
length (const std::string & characters) const |
float |
lineHeight () const |
void |
requestCharacters (const std::string & characters) |
int |
requestKerning (int glyph, int previous) const |
float |
spaceWidth () const |
Static Methods
None
Methods Description
int Font::atlasIndex (int glyph) const
Returns the index of the glyph in the atlas.
float Font::cursorWidth () const
Returns visual width of the cursor for the font in world units.
int Font::length (std::string & characters) const
Returns the number of characters in the string.
float Font::lineHeight () const
Returns visual height for the font in world units.
void Font::requestCharacters (std::string & characters)
Requests characters to be added to the font atlas.
int Font::requestKerning (int glyph, int previous) const
Returns the kerning offset between a glyph and previous glyph.
Note: In case of font doesn’t support kerning this method will return 0.
float Font::spaceWidth () const
Returns visual width of space character for the font in world units.