![]() |
Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
|
#include <Font.hpp>
Public Member Functions | |
float | lineHeight () const |
Font (TextRenderer *textRenderer, string const &fontName, const uint fontSize) | |
virtual | ~Font () |
void | draw (string const &text, vec4 const &color, vec2 position, HAlign hAlign=HAlign::Left, VAlign vAlign=VAlign::Bottom, vec2 const &scale=vec2(1, 1)) |
vec2 | measure (string const &text) |
Private Types | |
typedef map< char, Glyph > | glyph_map |
Private Member Functions | |
void | prepare (string const &text) |
Private Attributes | |
TextRenderer * | m_textRenderer |
string | m_name |
uint | m_size |
uvec2 | m_atlasSize |
vector< char > | m_atlasData |
uint | m_atlas |
glyph_map | m_glyphs |
float | m_lineHeight |
Friends | |
class | TextRenderer |
Font | ( | TextRenderer * | textRenderer, |
string const & | fontName, | ||
const uint | fontSize | ||
) |
Constructs a Font-object. Loads the necessary data from the given file.
textRenderer | The TextRenderer that holds this font. |
fontName | The name of the font |
fontSize | The size of the font |
void draw | ( | string const & | text, |
vec4 const & | color, | ||
vec2 | position, | ||
HAlign | hAlign = HAlign::Left , |
||
VAlign | vAlign = VAlign::Bottom , |
||
vec2 const & | scale = vec2(1,1) |
||
) |
|
inline |
vec2 measure | ( | string const & | text | ) |
|
private |
|
friend |
|
private |
|
private |
|
private |
The TextRenderer that holds this font.