raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | List of all members
raylib::Font Class Reference

Font type, includes texture and charSet array data. More...

Public Member Functions

 Font (const ::Font &font)
 
 Font (const ::Image &image, ::Color key, int firstChar)
 
 Font (const std::string &fileName)
 
 Font (const std::string &fileName, int fontSize, int *fontChars, int charCount)
 
 Font (const std::string &fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount)
 
Font & DrawText (const std::string &text, ::Rectangle rec, float fontSize, float spacing, bool wordWrap, ::Color tint, int selectStart, int selectLength, ::Color selectText, ::Color selectBack)
 Draw text using font inside rectangle limits with support for text selection.
 
Font & DrawText (const std::string &text, ::Rectangle rec, float fontSize, float spacing, bool wordWrap=false, ::Color tint=WHITE)
 
Font & DrawText (const std::string &text, ::Vector2 position, float fontSize, float spacing, ::Color tint=WHITE)
 Draw text using font and additional parameters.
 
Font & DrawText (int codepoint, ::Vector2 position, float fontSize, ::Color tint={ 255, 255, 255, 255 })
 Draw one character (codepoint)
 
int GetBaseSize () const
 Retrieves the baseSize value for the object. More...
 
::CharInfo * GetChars () const
 Retrieves the chars value for the object. More...
 
int GetCharsCount () const
 Retrieves the charsCount value for the object. More...
 
int GetCharsPadding () const
 Retrieves the charsPadding value for the object. More...
 
int GetGlyphIndex (int character) const
 Get index position for a unicode character on font.
 
::Rectangle * GetRecs () const
 Retrieves the recs value for the object. More...
 
::Texture2D GetTexture () const
 Retrieves the texture value for the object. More...
 
inline ::Image ImageText (const std::string &text, float fontSize, float spacing, ::Color tint) const
 Create an image from text (custom sprite font)
 
Vector2 MeasureText (const std::string &text, float fontSize, float spacing) const
 Measure string size for Font.
 
Font & operator= (const ::Font &font)
 
void SetBaseSize (int value)
 Sets the baseSize value for the object. More...
 
void SetChars (::CharInfo *value)
 Sets the chars value for the object. More...
 
void SetCharsCount (int value)
 Sets the charsCount value for the object. More...
 
void SetCharsPadding (int value)
 Sets the charsPadding value for the object. More...
 
void SetRecs (::Rectangle *value)
 Sets the recs value for the object. More...
 
void SetTexture (::Texture2D value)
 Sets the texture value for the object. More...
 
void Unload ()
 

Detailed Description

Font type, includes texture and charSet array data.

Definition at line 13 of file Font.hpp.

Member Function Documentation

◆ GetBaseSize()

int raylib::Font::GetBaseSize ( ) const
inline

Retrieves the baseSize value for the object.

Returns
The baseSize value of the object.

Definition at line 49 of file Font.hpp.

◆ GetChars()

::CharInfo* raylib::Font::GetChars ( ) const
inline

Retrieves the chars value for the object.

Returns
The chars value of the object.

Definition at line 54 of file Font.hpp.

◆ GetCharsCount()

int raylib::Font::GetCharsCount ( ) const
inline

Retrieves the charsCount value for the object.

Returns
The charsCount value of the object.

Definition at line 50 of file Font.hpp.

◆ GetCharsPadding()

int raylib::Font::GetCharsPadding ( ) const
inline

Retrieves the charsPadding value for the object.

Returns
The charsPadding value of the object.

Definition at line 51 of file Font.hpp.

◆ GetRecs()

::Rectangle* raylib::Font::GetRecs ( ) const
inline

Retrieves the recs value for the object.

Returns
The recs value of the object.

Definition at line 53 of file Font.hpp.

◆ GetTexture()

::Texture2D raylib::Font::GetTexture ( ) const
inline

Retrieves the texture value for the object.

Returns
The texture value of the object.

Definition at line 52 of file Font.hpp.

◆ SetBaseSize()

void raylib::Font::SetBaseSize ( int  value)
inline

Sets the baseSize value for the object.

Parameters
valueThe value of which to set baseSize to.

Definition at line 49 of file Font.hpp.

◆ SetChars()

void raylib::Font::SetChars ( ::CharInfo *  value)
inline

Sets the chars value for the object.

Parameters
valueThe value of which to set chars to.

Definition at line 54 of file Font.hpp.

◆ SetCharsCount()

void raylib::Font::SetCharsCount ( int  value)
inline

Sets the charsCount value for the object.

Parameters
valueThe value of which to set charsCount to.

Definition at line 50 of file Font.hpp.

◆ SetCharsPadding()

void raylib::Font::SetCharsPadding ( int  value)
inline

Sets the charsPadding value for the object.

Parameters
valueThe value of which to set charsPadding to.

Definition at line 51 of file Font.hpp.

◆ SetRecs()

void raylib::Font::SetRecs ( ::Rectangle *  value)
inline

Sets the recs value for the object.

Parameters
valueThe value of which to set recs to.

Definition at line 53 of file Font.hpp.

◆ SetTexture()

void raylib::Font::SetTexture ( ::Texture2D  value)
inline

Sets the texture value for the object.

Parameters
valueThe value of which to set texture to.

Definition at line 52 of file Font.hpp.