Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CL_Font Class Reference

#include <font.h>

Collaboration diagram for CL_Font:

Collaboration graph
[legend]
List of all members.

Public Types

enum  alignments { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }

Public Methods

 CL_Font (CL_Font_Description *provider)
 param: resource_id - The resource ID of the font.param: resource_manager - The resource manager used to load theparam: resources from.construction:.

 CL_Font (const char *resource_id, CL_ResourceManager *manager)
 CL_Font (const CL_Font &font)
virtual ~CL_Font ()
int get_height ()
 functions:.

int get_text_width (const char *text)
 retval: Width of the font.

int get_char_width (const char character)
 param: text - Text string the width should be calculated from.retval: Width of the text (in pixels).

void print_left (int x, int y, const char *text, int n_height=1)
 param: text - Character the width should be calculated from.retval: Width of the character (in pixels).

void print_left (int x, int y, float scale_x, float scale_y, const char *text)
 param: x - X coordinate (in pixels) the text is drawn at.param: y - Y coordiante (in pixels) the text is drawn at.param: text - The text to be drawn with this font.param: n_height - Adds font height + n_height pixels to Y coordinate on new line ('
').


void print_center (int x, int y, const char *text)
 param: x - X coordinate (in pixels) the text is drawn at.param: y - Y coordiante (in pixels) the text is drawn at.param: scale_x - Scale font width scale_x times.param: scale_y - Scale font height scale_y times.param: text - The text to be drawn with this font.

void print_right (int x, int y, const char *text)
 param: x - X coordinate (in pixels) the text is centered at.param: y - Y coordiante (in pixels) the text is centered at.param: text - The text to be drawn with this font.

void put_target (int x, int y, const char *text, CL_Target *target, int alignment=ALIGN_LEFT)
 param: x - X coordinate (in pixels) the text is ends at.param: y - Y coordiante (in pixels) the text is drawn at.param: text - The text to be drawn with this font.

int change_size (int size)
 param: x - X coordinate (in pixels)param: y - Y coordiante (in pixels)param: text - The text to be drawn with this font.param: target - the target surface to blit to.param: alignment - the alignment of the text, CL_Font::ALIGN_LEFT, CL_Font::ALIGN_CENTER, CL_Font::ALIGN_RIGHT.

unsigned int change_colour (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 param: size - The new size to use.retval: Returns the size set or -1 if the font size cannot be changed to size.

 CL_Font (class CL_Font_Generic *impl)
 param: r - The red componentparam: g - The green componentparam: b - The blue componentparam: a - The alpha componentretval: Returns the font set in packed ARGB format.implementation:.


Public Attributes

class CL_Font_Genericimpl

Static Public Methods

CL_Font* create (CL_Font_Description *font_desc)
 static_init:.

CL_Font* load (const char *resource_id, CL_ResourceManager *resource_manager)
 param: font_desc - The font description used to construct the font.


Member Enumeration Documentation

enum CL_Font::alignments
 

Enumeration values:
ALIGN_LEFT  
ALIGN_CENTER  
ALIGN_RIGHT  

Definition at line 43 of file font.h.


Constructor & Destructor Documentation

CL_Font::CL_Font ( CL_Font_Description * provider )
 

param: resource_id - The resource ID of the font.param: resource_manager - The resource manager used to load theparam: resources from.construction:.

CL_Font::CL_Font ( const char * resource_id,
CL_ResourceManager * manager )
 

CL_Font::CL_Font ( const CL_Font & font )
 

virtual CL_Font::~CL_Font ( ) [virtual]
 

CL_Font::CL_Font ( class CL_Font_Generic * impl )
 

param: r - The red componentparam: g - The green componentparam: b - The blue componentparam: a - The alpha componentretval: Returns the font set in packed ARGB format.implementation:.


Member Function Documentation

unsigned int CL_Font::change_colour ( unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a )
 

param: size - The new size to use.retval: Returns the size set or -1 if the font size cannot be changed to size.

int CL_Font::change_size ( int size )
 

param: x - X coordinate (in pixels)param: y - Y coordiante (in pixels)param: text - The text to be drawn with this font.param: target - the target surface to blit to.param: alignment - the alignment of the text, CL_Font::ALIGN_LEFT, CL_Font::ALIGN_CENTER, CL_Font::ALIGN_RIGHT.

CL_Font* CL_Font::create ( CL_Font_Description * font_desc ) [static]
 

static_init:.

int CL_Font::get_char_width ( const char character )
 

param: text - Text string the width should be calculated from.retval: Width of the text (in pixels).

int CL_Font::get_height ( )
 

functions:.

int CL_Font::get_text_width ( const char * text )
 

retval: Width of the font.

CL_Font* CL_Font::load ( const char * resource_id,
CL_ResourceManager * resource_manager ) [static]
 

param: font_desc - The font description used to construct the font.

Referenced by BORDER_SIZE(), and Y_TEXT_OFFSET().

void CL_Font::print_center ( int x,
int y,
const char * text )
 

param: x - X coordinate (in pixels) the text is drawn at.param: y - Y coordiante (in pixels) the text is drawn at.param: scale_x - Scale font width scale_x times.param: scale_y - Scale font height scale_y times.param: text - The text to be drawn with this font.

void CL_Font::print_left ( int x,
int y,
float scale_x,
float scale_y,
const char * text )
 

param: x - X coordinate (in pixels) the text is drawn at.param: y - Y coordiante (in pixels) the text is drawn at.param: text - The text to be drawn with this font.param: n_height - Adds font height + n_height pixels to Y coordinate on new line ('
').

void CL_Font::print_left ( int x,
int y,
const char * text,
int n_height = 1 )
 

param: text - Character the width should be calculated from.retval: Width of the character (in pixels).

void CL_Font::print_right ( int x,
int y,
const char * text )
 

param: x - X coordinate (in pixels) the text is centered at.param: y - Y coordiante (in pixels) the text is centered at.param: text - The text to be drawn with this font.

void CL_Font::put_target ( int x,
int y,
const char * text,
CL_Target * target,
int alignment = ALIGN_LEFT )
 

param: x - X coordinate (in pixels) the text is ends at.param: y - Y coordiante (in pixels) the text is drawn at.param: text - The text to be drawn with this font.


Member Data Documentation

class CL_Font_Generic* CL_Font::impl
 

Definition at line 152 of file font.h.


The documentation for this class was generated from the following file:
Generated at Wed Apr 4 19:56:55 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001