Yukino::Font Class Reference

Class to store one font. More...

#include <Font.h>

List of all members.

Public Member Functions

 Font ()
 Constructor of the Font class.
 Font (const char *file, int ptsize, long index=0)
 Constructor of the Font class.
 Font (const string &file, int ptsize, long index=0)
 Constructor of the Font class.
 Font (const Font &obj)
 Copy constructor of the Font class.
Fontoperator= (Font &obj)
 Operator = of the Font class.
 ~Font ()
 Destructor of the Font class.
UINT Load (const char *file, int ptsize, long index=0)
 Function to load a font from a file.
UINT Load (const string &file, int ptsize, long index=0)
 Function to load a font from a file.
void Free (void)
 Function to release the data of the Font object.
int GetStyle (void)
 Function to obtain the style of the font.
void SetStyle (int style)
 Function to change the style of the font.
int GetHeight (void)
 Function to obtain the height of the font.
int GetAscent (void)
 Function to obtain the ascent of the font.
int GetDescent (void)
 Function to obtain the descent of the font.
int GetLineSkip (void)
 Function to obtain the distance between two lines of the font.
int GetSize (void)
 Function to obtain the size of the font.
int GetSizeText (const char *text, int *w=NULL, int *h=NULL)
 Function to obtain the size of a string.
SDL_Surface * RenderText (const char *text, dword fc)
 Function to render a string.
SDL_Surface * RenderText2 (const char *text, SDL_Color color)
 Function to render a string.
SDL_Surface * RenderUNICODE (const word *text, dword fc)
 Function to render a string.
SDL_Surface * RenderUNICODE2 (const word *text, SDL_Color color)
 Function to render a string.


Detailed Description

Class to store one font.

The Font class serves to store in memory a type of True-Type font.


Constructor & Destructor Documentation

Yukino::Font::Font (  ) 

Constructor of the Font class.

Constructor by defect of the Font class.

See also:
operator=(), ~Font().

Yukino::Font::Font ( const char *  file,
int  ptsize,
long  index = 0 
)

Constructor of the Font class.

Constructor of the Font class, that loads a file.

Parameters:
file Path of the file.
ptsize Size of the font.
index Index of the font.
See also:
operator=(), ~Font().

Yukino::Font::Font ( const string &  file,
int  ptsize,
long  index = 0 
)

Constructor of the Font class.

Constructor of the Font class, that loads a file.

Parameters:
file Path of the file.
ptsize Size of the font.
index Index of the font.
See also:
operator=(), ~Font().

Yukino::Font::Font ( const Font obj  ) 

Copy constructor of the Font class.

Parameters:
obj Font object to copy.
See also:
operator=(), ~Font().

Yukino::Font::~Font (  ) 

Destructor of the Font class.

See also:
Font(), operator=().


Member Function Documentation

void Yukino::Font::Free ( void   ) 

Function to release the data of the Font object.

This function serves to release the content of the Font object.

See also:
Load().

int Yukino::Font::GetAscent ( void   )  [inline]

Function to obtain the ascent of the font.

This function serves to obtain the ascent of the font.

See also:
GetDescent().
Returns:
The ascent of the font.

int Yukino::Font::GetDescent ( void   )  [inline]

Function to obtain the descent of the font.

This function serves to obtain the descent of the font.

See also:
GetAscent().
Returns:
The descent of the font.

int Yukino::Font::GetHeight ( void   )  [inline]

Function to obtain the height of the font.

This function serves to obtain the height of the font.

Returns:
The height of the font.

int Yukino::Font::GetLineSkip ( void   )  [inline]

Function to obtain the distance between two lines of the font.

This function serves to obtain the distance between two lines.

Returns:
The distance between two lines.

int Yukino::Font::GetSize ( void   )  [inline]

Function to obtain the size of the font.

This function serves to obtain the size of the font.

Returns:
The size of the font.

int Yukino::Font::GetSizeText ( const char *  text,
int *  w = NULL,
int *  h = NULL 
) [inline]

Function to obtain the size of a string.

This function serves to obtain the size of a rendered string.

Returns:
The size of a rendered string.

int Yukino::Font::GetStyle ( void   )  [inline]

Function to obtain the style of the font.

This function serves to obtain the style of the font.

See also:
SetStyle().
Returns:
TTF_STYLE_BOLD, TTF_STYLE_ITALIC, TTF_STYLE_UNDERLINE, TTF_STYLE_NORMAL.

UINT Yukino::Font::Load ( const string &  file,
int  ptsize,
long  index = 0 
) [inline]

Function to load a font from a file.

This function serves to load a font from a file.

Parameters:
file Path of the file.
ptsize Size of the font.
index Index of the font.
See also:
Free().
Returns:
If everything goes well returns 0, on errors returns: FONT_ERROR_OPEN.

UINT Yukino::Font::Load ( const char *  file,
int  ptsize,
long  index = 0 
)

Function to load a font from a file.

This function serves to load a font from a file.

Parameters:
file Path of the file.
ptsize Size of the font.
index Index of the font.
See also:
Free().
Returns:
If everything goes well returns 0, on errors returns: FONT_ERROR_OPEN.

Font & Yukino::Font::operator= ( Font obj  ) 

Operator = of the Font class.

The obj object is copied in the actual object, and this is given back.

See also:
Font(), ~Font().

SDL_Surface* Yukino::Font::RenderText ( const char *  text,
dword  fc 
) [inline]

Function to render a string.

This function serves to render a string with a color.

Parameters:
text String to render.
fc Color of the string.
See also:
RenderText2(), RenderUNICODE(), RenderUNICODE2().
Returns:
It gives back to a pointer to a SDL_Surface if everything has gone well, if there is no memory for the buffer, gives back NULL.

SDL_Surface* Yukino::Font::RenderText2 ( const char *  text,
SDL_Color  color 
) [inline]

Function to render a string.

This function serves to render a string with a color.

Parameters:
text String to render.
color Color of the string.
See also:
RenderText(), RenderUNICODE(), RenderUNICODE2().
Returns:
It gives back to a pointer to a SDL_Surface if everything has gone well, if there is no memory for the buffer, gives back NULL.

SDL_Surface* Yukino::Font::RenderUNICODE ( const word text,
dword  fc 
) [inline]

Function to render a string.

This function serves to render a string with a color.

Parameters:
text String to render.
fc Color of the string.
See also:
RenderText(), RenderText2(), RenderUNICODE2().
Returns:
It gives back to a pointer to a SDL_Surface if everything has gone well, if there is no memory for the buffer, gives back NULL.

SDL_Surface* Yukino::Font::RenderUNICODE2 ( const word text,
SDL_Color  color 
) [inline]

Function to render a string.

This function serves to render a string with a color.

Parameters:
text String to render.
color Color of the string.
See also:
RenderText(), RenderText2(), RenderUNICODE().
Returns:
It gives back to a pointer to a SDL_Surface if everything has gone well, if there is no memory for the buffer, gives back NULL.

void Yukino::Font::SetStyle ( int  style  )  [inline]

Function to change the style of the font.

This function serves to change the style of the font.

Parameters:
style Style of the font.
See also:
GetStyle().


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7