Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
GuiFont Class Reference

Text font class. More...

Classes

struct  FontDesc
 

Public Types

enum  Style {
  STYLE_NORMAL = 0,
  STYLE_ITALIC,
  STYLE_COUNT
}
 
enum  Weight {
  WEIGHT_NORMAL = 0,
  WEIGHT_BOLD,
  WEIGHT_COUNT
}
 

Public Member Functions

 GuiFont ()
 Constructor.
 
 GuiFont (const CoreString &family, const int &size, const Weight &weight=WEIGHT_NORMAL, const Style &style=STYLE_NORMAL)
 Constructor.
 
 GuiFont (const GuiFont &src)
 Copy Constructor.
 
virtual ~GuiFont ()
 Destructor.
 
const Style & get_style () const
 Gets font style.
 
const Weight & get_weight () const
 Gets font weigth.
 
const int & get_size () const
 Gets font size.
 
const CoreStringget_font_name () const
 Gets font name.
 
void set_style (const Style &style)
 Sets font style.
 
void set_weight (const Weight &weight)
 Sets font weigth.
 
void set_size (const int &size)
 Sets font size.
 
void reset (const CoreString &family, const int &size, const Weight &weight=WEIGHT_NORMAL, const Style &style=STYLE_NORMAL)
 Modify font with incoming family, size, weight and style.
 
void set_face (const GuiFont::Weight &weight, const GuiFont::Style &style, const CoreString &alt_family, const int &alt_size, const GuiFont::Weight &alt_weight, const GuiFont::Style &alt_style)
 
void get_text_size (const CoreString &text, int &w, int &h) const
 Gets incoming text size, using the font parameters (size, weight...)
 
void get_text_size (const char *text, int &w, int &h) const
 Gets incoming text size, using the font parameters (size, weight...)
 
GuiFontoperator= (const GuiFont &font)
 
void make_current ()
 Makes this font current font.
 
const int & get_index () const
 
int get_height () const
 Gets font height.
 
int get_descent () const
 Gets font descent (how far a character can descend below the baseline)
 
int get_total_height () const
 

Static Public Member Functions

static CoreString get_style_name (const Style &style)
 Gets style name (STYLE_NORMAL, STYLE_ITALIC)
 
static CoreString get_weight_name (const Weight &weight)
 Gets weigth name (WEIGHT_NORMAL, WEIGHT_BOLD)
 
static const CoreStringget_face_name (const int &index)
 Get a human-readable string describing the family of the face with incoming index.
 
static const GuiFontget_default ()
 Gets default font.
 
static void load_pregenerated_rasterized_font_data_if_exists ()
 Loads pre-generated images for font texture sheets, if they exist.
 
static FontDescget_rasterized_font_data (GuiFont &font)
 Get rasterized font data.
 

Detailed Description

Text font class.

Constructor & Destructor Documentation

GuiFont::GuiFont ( const CoreString family,
const int &  size,
const Weight &  weight = WEIGHT_NORMAL,
const Style &  style = STYLE_NORMAL 
)

Constructor.

Parameters
[in]familyfont family
[in]sizefont size
[in]weigthfont height
[in]stylefont style

Member Function Documentation

void GuiFont::get_text_size ( const CoreString text,
int &  w,
int &  h 
) const

Gets incoming text size, using the font parameters (size, weight...)

Parameters
[in]textto compute size for
[out]woutgoing text width
[out]houtgoing text height
void GuiFont::get_text_size ( const char *  text,
int &  w,
int &  h 
) const

Gets incoming text size, using the font parameters (size, weight...)

Parameters
[in]textto compute size for
[out]woutgoing text width
[out]houtgoing text height