Classes | Public Member Functions

xl7::direct3d::fonts::Font Class Reference

#include <Font.h>

List of all members.

Classes

struct  CharEntry
struct  TexEntry
struct  Vertex

Public Member Functions

 Font (void)
 ~Font (void)
float GetRefWidth (const TextStyle *text_style=NULL) const
float GetRefHeight (const TextStyle *text_style=NULL) const
const ml7::Vector2GetResolution () const
const TextStyleGetDefTextStyle () const
void SetResolution (const ml7::Vector2 &resolution)
void SetDefTextStyle (const TextStyle &def_text_style)
TextStyleUpdateDefTextStyle ()
bool Create (HFONT font_handle, unsigned tex_width=256, unsigned tex_height=256)
bool Release ()
bool ContainsChar (const cl7::char_type chr) const
bool AddChar (const cl7::char_type chr)
float CalculateTextWidth (const cl7::string_type &text, const TextStyle *text_style=NULL) const
ml7::Vector2 CalculateTextSize (const cl7::string_type &text, const TextStyle *text_style=NULL) const
bool RenderText (const ml7::Vector2 &pos, const cl7::string_type &text, const TextStyle *text_style=NULL) const
bool RenderText (const ml7::Vector2 &TL, const ml7::Vector2 &BR, const cl7::string_type &text, const bool clip=true, const TextStyle *text_style=NULL) const
bool RenderText (const ml7::Vector2 &pos, const ml7::Vector2 &TL, const ml7::Vector2 &BR, const cl7::string_type &text, const bool clip=true, const TextStyle *text_style=NULL) const

Detailed Description

The class to represent, manage and draw fonts.


Constructor & Destructor Documentation

xl7::direct3d::fonts::Font::Font ( void   ) 

Default constructor.

xl7::direct3d::fonts::Font::~Font ( void   ) 

Destructor.


Member Function Documentation

bool xl7::direct3d::fonts::Font::AddChar ( const cl7::char_type  chr  ) 

Adds a given character so that it can be drawn.

ml7::Vector2 xl7::direct3d::fonts::Font::CalculateTextSize ( const cl7::string_type text,
const TextStyle text_style = NULL 
) const

Calculates the width of a given text and returns it combined with the reference height of the characters.

float xl7::direct3d::fonts::Font::CalculateTextWidth ( const cl7::string_type text,
const TextStyle text_style = NULL 
) const

Calculates the width of a given text.

bool xl7::direct3d::fonts::Font::ContainsChar ( const cl7::char_type  chr  )  const

Checks whether a given character is available so that it can be drawn.

bool xl7::direct3d::fonts::Font::Create ( HFONT  font_handle,
unsigned  tex_width = 256,
unsigned  tex_height = 256 
)

Creates this font and initially fills it with the standard character set.

const TextStyle& xl7::direct3d::fonts::Font::GetDefTextStyle (  )  const [inline]

Returns the default style for rendering text.

float xl7::direct3d::fonts::Font::GetRefHeight ( const TextStyle text_style = NULL  )  const

Returns the reference height of the characters.

float xl7::direct3d::fonts::Font::GetRefWidth ( const TextStyle text_style = NULL  )  const

Returns the reference width of the characters (the average width of the characters 'A'...'Z' and 'a'...'z').

const ml7::Vector2& xl7::direct3d::fonts::Font::GetResolution (  )  const [inline]

Returns the imaginary screen resolution.

bool xl7::direct3d::fonts::Font::Release (  ) 

Releases the resources used by this font.

bool xl7::direct3d::fonts::Font::RenderText ( const ml7::Vector2 pos,
const cl7::string_type text,
const TextStyle text_style = NULL 
) const

Draws the given text to the current render target.

bool xl7::direct3d::fonts::Font::RenderText ( const ml7::Vector2 pos,
const ml7::Vector2 TL,
const ml7::Vector2 BR,
const cl7::string_type text,
const bool  clip = true,
const TextStyle text_style = NULL 
) const

Draws the given text to the current render target.

bool xl7::direct3d::fonts::Font::RenderText ( const ml7::Vector2 TL,
const ml7::Vector2 BR,
const cl7::string_type text,
const bool  clip = true,
const TextStyle text_style = NULL 
) const

Draws the given text to the current render target.

void xl7::direct3d::fonts::Font::SetDefTextStyle ( const TextStyle def_text_style  )  [inline]

Sets the default style for rendering text.

void xl7::direct3d::fonts::Font::SetResolution ( const ml7::Vector2 resolution  )  [inline]

Sets the imaginary screen resolution.

TextStyle& xl7::direct3d::fonts::Font::UpdateDefTextStyle (  )  [inline]

Returns the default style for rendering text, so you can update it.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines