Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::TextHelper Class Reference

Helper class for Text. More...

#include <TextHelper.hpp>

Collaboration diagram for raylib::helper::TextHelper:
Collaboration graph

Static Public Member Functions

static int measureText (const std::string &text, int fontSize)
 Measure string width for default font. More...
 
static Vector2f measureText (const raylib::text::RlFont &font, const std::string &text)
 Measure string width for custom font. More...
 
static Vector2f measureText (const raylib::text::RlFont &font, const std::string &text, float fontSize, float spacing=1)
 Measure string width for custom font. More...
 
static int getGlyphIndex (const raylib::text::RlFont &font, int codepoint)
 Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found. More...
 
static GlyphInfo getGlyphInfo (const raylib::text::RlFont &font, int codepoint)
 Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found. More...
 
static Rectangle getGlyphAtlasRec (const raylib::text::RlFont &font, int codepoint)
 Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found. More...
 

Detailed Description

Helper class for Text.

Member Function Documentation

◆ getGlyphAtlasRec()

Rectangle raylib::helper::TextHelper::getGlyphAtlasRec ( const raylib::text::RlFont font,
int  codepoint 
)
static

Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found.

Parameters
fontthe font to use
codepointthe codepoint to get the rectangle for
Returns
the rectangle of the codepoint
Here is the call graph for this function:

◆ getGlyphIndex()

int raylib::helper::TextHelper::getGlyphIndex ( const raylib::text::RlFont font,
int  codepoint 
)
static

Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found.

Parameters
fontthe font to use
codepointthe codepoint to get the index for
Returns
the index of the codepoint
Here is the call graph for this function:

◆ getGlyphInfo()

GlyphInfo raylib::helper::TextHelper::getGlyphInfo ( const raylib::text::RlFont font,
int  codepoint 
)
static

Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found.

Parameters
fontthe font to use
codepointthe codepoint to get the info for
Returns
the info of the codepoint
Here is the call graph for this function:

◆ measureText() [1/3]

Vector2f raylib::helper::TextHelper::measureText ( const raylib::text::RlFont font,
const std::string &  text 
)
static

Measure string width for custom font.

Parameters
fontthe font to use
textthe text to measure
Returns
the width of the text
Here is the call graph for this function:

◆ measureText() [2/3]

Vector2f raylib::helper::TextHelper::measureText ( const raylib::text::RlFont font,
const std::string &  text,
float  fontSize,
float  spacing = 1 
)
static

Measure string width for custom font.

Parameters
fontthe font to use
textthe text to measure
fontSizethe font size
spacingthe spacing between characters
Returns
the width of the text
Here is the call graph for this function:

◆ measureText() [3/3]

int raylib::helper::TextHelper::measureText ( const std::string &  text,
int  fontSize 
)
static

Measure string width for default font.

Parameters
textthe text to measure
fontSizethe font size
Returns
the width of the text
Here is the caller graph for this function:

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