zenilib
0.5.3.0
|
#include <Font.h>
Inherited by Zeni::Font_FT.
Public Member Functions | |
Font () | |
Instantiate a new Font with a call to get_Video().create_Font() More... | |
Font (const float &glyph_height, const float &virtual_screen_height, const String &font_name="Untitled Font") | |
Instantiate a new Font with a call to get_Video().create_Font() More... | |
virtual | ~Font () |
const String & | get_name () const |
Get the name of the font. More... | |
float | get_text_height () const |
Get the height of the font. The width is usually half the height, by default. More... | |
virtual float | get_text_width (const String &text) const =0 |
Get the width of text rendering using this font. Approximately text_height * text.length() / 2.0f. More... | |
float | get_virtual_screen_height () const |
Get the intended virtual screen height for the rendering of this Font. More... | |
virtual void | render_text (const String &text, const Point2f &position, const Color &color, const JUSTIFY &justify=ZENI_DEFAULT_JUSTIFY) const =0 |
Render text at screen position (x, y), with justification JUSTIFY. More... | |
virtual void | render_text (const String &text, const Point3f &position, const Vector3f &right, const Vector3f &down, const Color &color, const JUSTIFY &justify=ZENI_DEFAULT_JUSTIFY) const =0 |
Render text with greater control over position and orientation, with justification JUSTIFY. More... | |
Font Abstraction.
The Font class allows one to render text using a TrueType font in both Direct3D and in OpenGL. It is done rather differently in both cases, however. In Direct3D, it is done using built in DirectX functions and rendered with screen coordinates. In OpenGL, it is done using SDL_ttf and textures. The result appears much the same.
Contact: bazal d@ze nipex .com
Zeni::Font::Font | ( | ) |
Instantiate a new Font with a call to get_Video().create_Font()
Zeni::Font::Font | ( | const float & | glyph_height, |
const float & | virtual_screen_height, | ||
const String & | font_name = "Untitled Font" |
||
) |
Instantiate a new Font with a call to get_Video().create_Font()
|
inline |
Get the height of the font. The width is usually half the height, by default.
Definition at line 29 of file Font.hxx.
Referenced by Zeni::Popup_Pause_State::render(), Zeni::Popup_Menu_State::Sound_Check_Box::render_impl(), Zeni::Text_Box::render_impl(), and Zeni::Widget_Renderer_Text::render_to().
Get the width of text rendering using this font. Approximately text_height * text.length() / 2.0f.
Implemented in Zeni::Font_FT.
Referenced by Zeni::Text_Box::on_accept(), Zeni::Popup_Menu_State::Sound_Check_Box::render_impl(), and Zeni::Text_Box::render_impl().
|
inline |
|
pure virtual |
Render text at screen position (x, y), with justification JUSTIFY.
Implemented in Zeni::Font_FT.
Referenced by Zeni::Popup_Pause_State::render(), Zeni::Popup_Menu_State::Sound_Check_Box::render_impl(), Zeni::Text_Box::render_impl(), and Zeni::Widget_Renderer_Text::render_to().
|
pure virtual |
Render text with greater control over position and orientation, with justification JUSTIFY.
Implemented in Zeni::Font_FT.