#include <Font.h>
Collaboration diagram for Teddy::Graphics::Font:
Public Methods | |
Font (const char *fname, const int mode=0) | |
Font constructor. More... | |
Font () | |
Dummy font constructor for font which is used for default font while none is loaded. More... | |
void | drawString (const Teddy::Maths::Vector2 &pos, const char *str, View *v) |
int | getWidth () |
Return font width in pixels. More... | |
int | getHeight () |
Return font height in pixels. More... | |
Static Public Attributes | |
Font * | default_font = &Font::dummy_font |
Font | dummy_font |
const int | MODE_NORMAL = 0 |
const int | MODE_NO_BLEND = 1 |
Private Attributes | |
Texture * | texture |
Texture object. More... | |
Teddy::Maths::Vector2 | tx [256] |
Texture coordinates, char = index. More... | |
Teddy::Maths::Vector2 | tsize [4] |
Teddy::Maths::Vector2 | psize [4] |
Teddy::Maths::Vector2 | pos |
int | mode |
int | cw |
Char width in pixels. More... | |
int | ch |
Char height. More... | |
float | tw |
Char width in texture coords. More... | |
float | th |
Char height in texture coords. More... |
Variable width font.
This class implements glyph storing and rendering code (but it is not Renderable).
Implementation is very primitive at the moment. Later, FreeType library could be intergrated here.
Definition at line 51 of file Font.h.
|
Font constructor.
Definition at line 76 of file Font.cpp. References ch, cw, Teddy::Graphics::DIV_256, IntVector2, Teddy::SysSupport::M_INIT, mode, MODE_NO_BLEND, MODE_NORMAL, Teddy::SysSupport::msg, psize, texture, th, tsize, tw, tx, and Vector2. |
|
Dummy font constructor for font which is used for default font while none is loaded.
Definition at line 55 of file Font.cpp. References ch, cw, pos, psize, texture, th, tsize, tw, tx, and Vector2. |
|
|
|
Return font height in pixels.
Definition at line 230 of file Font.cpp. References ch. |
|
Return font width in pixels.
Definition at line 221 of file Font.cpp. References cw. |
|
Char height.
|
|
Char width in pixels.
|
|
|
|
|
|
Definition at line 73 of file Font.h. Referenced by Font. |
|
Definition at line 45 of file Font.cpp. Referenced by Font. |
|
Definition at line 44 of file Font.cpp. Referenced by Font. |
|
Definition at line 72 of file Font.h. Referenced by Font. |
|
Definition at line 71 of file Font.h. Referenced by Font. |
|
Texture object.
Definition at line 68 of file Font.h. Referenced by Font. |
|
Char height in texture coords.
Definition at line 77 of file Font.h. Referenced by Font. |
|
Definition at line 70 of file Font.h. Referenced by Font. |
|
Char width in texture coords.
Definition at line 76 of file Font.h. Referenced by Font. |
|
Texture coordinates, char = index.
Definition at line 69 of file Font.h. Referenced by Font. |