zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Font_FT Class Reference

#include <Font.h>

Inherits Zeni::Font.

Public Member Functions

 Font_FT ()
 Instantiate a new Font with a call to get_Video().create_Font() More...
 
 Font_FT (const String &filepath, const float &glyph_height, const float &virtual_screen_height)
 Instantiate a new Font with a call to get_Video().create_Font() More...
 
virtual float get_text_width (const String &text) const
 Get the width of text rendering using this font. Approximately text_height * text.length() / 2.0f. More...
 
virtual void render_text (const String &text, const Point2f &position, const Color &color, const JUSTIFY &justify=ZENI_LEFT) const
 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
 Render text with greater control over position and orientation, with justification JUSTIFY. More...
 
- Public Member Functions inherited from Zeni::Font
 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 Stringget_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...
 
float get_virtual_screen_height () const
 Get the intended virtual screen height for the rendering of this Font. More...
 

Detailed Description

Definition at line 99 of file Font.h.

Constructor & Destructor Documentation

Zeni::Font_FT::Font_FT ( )

Instantiate a new Font with a call to get_Video().create_Font()

Definition at line 124 of file Font.cpp.

Zeni::Font_FT::Font_FT ( const String filepath,
const float &  glyph_height,
const float &  virtual_screen_height 
)

Instantiate a new Font with a call to get_Video().create_Font()

Definition at line 131 of file Font.cpp.

References Zeni::ftoa(), and ZENI_LOGD().

Member Function Documentation

float Zeni::Font_FT::get_text_width ( const String text) const
virtual

Get the width of text rendering using this font. Approximately text_height * text.length() / 2.0f.

Implements Zeni::Font.

Definition at line 151 of file Font.cpp.

References int, max, and Zeni::String::size().

void Zeni::Font_FT::render_text ( const String text,
const Point2f position,
const Color color,
const JUSTIFY justify = ZENI_LEFT 
) const
virtual
void Zeni::Font_FT::render_text ( const String text,
const Point3f position,
const Vector3f right,
const Vector3f down,
const Color color,
const JUSTIFY justify = ZENI_DEFAULT_JUSTIFY 
) const
virtual

Render text with greater control over position and orientation, with justification JUSTIFY.

Implements Zeni::Font.

Definition at line 219 of file Font.cpp.

References Zeni::Video::apply_Texture(), Zeni::Video::get_Color(), Zeni::get_Video(), i, int, j, Zeni::Video::set_Color(), Zeni::String::size(), u, Zeni::Video::unapply_Texture(), Zeni::ZENI_CENTER, Zeni::ZENI_LEFT, and Zeni::ZENI_RIGHT.


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