Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Graphics::UI::FontGenerator Class Reference

Class for font generator. More...

#include <font_generator.h>

Public Member Functions

 FontGenerator (const std::string &font_path="", const unsigned int pixels_per_unit=32)
 Font generator constructor. More...
 
 ~FontGenerator ()
 Destroys the font generator. More...
 
void setFontPath (const std::string &font_path) noexcept
 Sets the font path. More...
 
std::string getFontPath () const noexcept
 Gets the font path. More...
 
void loadFont (const std::string &ttf_file, const unsigned int size, const std::string &name="")
 Loads a font. More...
 
std::shared_ptr< FontgetFont (const std::string &name) const noexcept
 Gets the font. More...
 

Detailed Description

Class for font generator.

Constructor & Destructor Documentation

Graphics::UI::FontGenerator::FontGenerator ( const std::string &  font_path = "",
const unsigned int  pixels_per_unit = 32 
)

Font generator constructor.

Parameters
[in]font_pathThe font path
[in]pixels_per_unitThe pixels per unit
Graphics::UI::FontGenerator::~FontGenerator ( )

Destroys the font generator.

Member Function Documentation

std::shared_ptr< Font > Graphics::UI::FontGenerator::getFont ( const std::string &  name) const
noexcept

Gets the font.

Parameters
[in]nameThe name
Returns
The font.

Referenced by generated::getFontGeneratorModule().

std::string Graphics::UI::FontGenerator::getFontPath ( ) const
noexcept

Gets the font path.

Returns
The font path.

Referenced by generated::getFontGeneratorModule().

void Graphics::UI::FontGenerator::loadFont ( const std::string &  ttf_file,
const unsigned int  size,
const std::string &  name = "" 
)

Loads a font.

Parameters
[in]ttf_fileThe ttf file
[in]sizeThe size
[in]nameThe name

References Graphics::VertexData::addIndices(), Graphics::VertexData::addVec(), and Graphics::VertexData::generateVertexArrayObject().

Referenced by generated::getFontGeneratorModule().

void Graphics::UI::FontGenerator::setFontPath ( const std::string &  font_path)
noexcept

Sets the font path.

Parameters
[in]font_pathThe font path

Referenced by generated::getFontGeneratorModule().


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