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

Encapsulation of the raylib font. More...

#include <RlFont.hpp>

Collaboration diagram for raylib::text::RlFont:
Collaboration graph

Public Member Functions

 RlFont ()
 Create a RlFont, using default parameters. More...
 
 RlFont (const std::string &fontPath)
 Create a RlFont, using a font path Load font from file into GPU memory (VRAM) More...
 
 RlFont (const int &fontSize)
 Create a RlFont, with custom font size. More...
 
 RlFont (const std::string &fontPath, const int &fontSize=20, int *fontChars=nullptr, const int &glyphCount=0)
 Create a RlFont, using a font path and a font size Load font from file with extended parameters. More...
 
 RlFont (const image::RlImage &image, const RlColor &key, const int &firstChar)
 Create a RlFont, using an iamge, key color and first character Load font from Image (XNA style) More...
 
 RlFont (const std::string &fileType, const unsigned char *fileData, int dataSize, const int &fontSize=20, int *fontChars=nullptr, const int &glyphCount=0)
 Create a RlFont, using a file type and a file data Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. More...
 
 ~RlFont ()
 Destroy the RlFont. More...
 
const Font & getFont () const
 Get the raylib font. More...
 
const std::string & getFontPath () const
 Get the font path. More...
 
int getFontSize () const
 Get the font size. More...
 

Static Public Member Functions

static std::shared_ptr< RlFontgetDefaultFont ()
 Get the default font (FontSize: 20) More...
 

Detailed Description

Encapsulation of the raylib font.

Constructor & Destructor Documentation

◆ RlFont() [1/6]

raylib::text::RlFont::RlFont ( )

Create a RlFont, using default parameters.

◆ RlFont() [2/6]

raylib::text::RlFont::RlFont ( const std::string &  fontPath)
explicit

Create a RlFont, using a font path Load font from file into GPU memory (VRAM)

Parameters
fontPaththe font path

◆ RlFont() [3/6]

raylib::text::RlFont::RlFont ( const int &  fontSize)
inlineexplicit

Create a RlFont, with custom font size.

Parameters
fontSizethe font size

◆ RlFont() [4/6]

raylib::text::RlFont::RlFont ( const std::string &  fontPath,
const int &  fontSize = 20,
int *  fontChars = nullptr,
const int &  glyphCount = 0 
)
explicit

Create a RlFont, using a font path and a font size Load font from file with extended parameters.

Parameters
fontPaththe font path
fontSizethe font size
fontCharsthe font characters
glyphCountthe glyph count

◆ RlFont() [5/6]

raylib::text::RlFont::RlFont ( const image::RlImage image,
const RlColor key,
const int &  firstChar 
)
explicit

Create a RlFont, using an iamge, key color and first character Load font from Image (XNA style)

Parameters
imagethe image
keythe key color
firstCharthe first character
Here is the call graph for this function:

◆ RlFont() [6/6]

raylib::text::RlFont::RlFont ( const std::string &  fileType,
const unsigned char *  fileData,
int  dataSize,
const int &  fontSize = 20,
int *  fontChars = nullptr,
const int &  glyphCount = 0 
)
explicit

Create a RlFont, using a file type and a file data Load font from memory buffer, fileType refers to extension: i.e. '.ttf'.

Parameters
fileTypethe file type (ttf, otf)
fileDatathe file data
dataSizethe data size
fontSizethe font size
fontCharsthe font characters
glyphCountthe glyph count

◆ ~RlFont()

raylib::text::RlFont::~RlFont ( )

Destroy the RlFont.

Member Function Documentation

◆ getDefaultFont()

std::shared_ptr< raylib::text::RlFont > raylib::text::RlFont::getDefaultFont ( )
static

Get the default font (FontSize: 20)

Returns
the default font
Here is the caller graph for this function:

◆ getFont()

const Font & raylib::text::RlFont::getFont ( ) const

Get the raylib font.

Returns
the raylib font
Here is the caller graph for this function:

◆ getFontPath()

const std::string & raylib::text::RlFont::getFontPath ( ) const

Get the font path.

Returns
the font path

◆ getFontSize()

int raylib::text::RlFont::getFontSize ( ) const

Get the font size.

Returns
the font size
Here is the caller graph for this function:

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