VAPOR3 3.9.4
Classes | Public Member Functions | List of all members
VAPoR::Font Class Reference

Renders charachter glyphs using FreeType2 This class does not do any transformation, formatting, etc., please use the TextLabel class for that. More...

#include <Font.h>

Inheritance diagram for VAPoR::Font:
Wasp::MyBase

Public Member Functions

 Font (GLManager *glManager, const std::string &path, int size, FT_Library library=nullptr)
 
 ~Font ()
 
void DrawText (const std::string &text, const glm::vec4 &color=glm::vec4(1))
 
glm::vec2 TextDimensions (const std::string &text)
 
float LineHeight () const
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Additional Inherited Members

- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- Static Public Member Functions inherited from Wasp::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message.
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 
static bool GetEnableErrMsg ()
 
- Static Public Attributes inherited from Wasp::MyBase
static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 

Detailed Description

Renders charachter glyphs using FreeType2 This class does not do any transformation, formatting, etc., please use the TextLabel class for that.

Author
Stanislaw Jaroszynski

Definition at line 24 of file Font.h.

Constructor & Destructor Documentation

◆ Font()

VAPoR::Font::Font ( GLManager glManager,
const std::string &  path,
int  size,
FT_Library  library = nullptr 
)

◆ ~Font()

VAPoR::Font::~Font ( )

Member Function Documentation

◆ DrawText()

void VAPoR::Font::DrawText ( const std::string &  text,
const glm::vec4 &  color = glm::vec4(1) 
)

Draws text in pixel coordinates i.e. if font is 10px, text will be 10 OpenGL units tall.

Parameters
[in]text
[in]colordefault is white

◆ LineHeight()

float VAPoR::Font::LineHeight ( ) const

◆ TextDimensions()

glm::vec2 VAPoR::Font::TextDimensions ( const std::string &  text)

Returns pixel dimensions of text


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