Clarisse 5.0 SP8 SDK
5.0.5.8.0
|
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 CoreString & | get_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...) | |
GuiFont & | operator= (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 CoreString & | get_face_name (const int &index) |
Get a human-readable string describing the family of the face with incoming index. | |
static const GuiFont & | get_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 FontDesc * | get_rasterized_font_data (GuiFont &font) |
Get rasterized font data. | |
Text font class.
GuiFont::GuiFont | ( | const CoreString & | family, |
const int & | size, | ||
const Weight & | weight = WEIGHT_NORMAL , |
||
const Style & | style = STYLE_NORMAL |
||
) |
Constructor.
[in] | family | font family |
[in] | size | font size |
[in] | weigth | font height |
[in] | style | font style |
void GuiFont::get_text_size | ( | const CoreString & | text, |
int & | w, | ||
int & | h | ||
) | const |
Gets incoming text size, using the font parameters (size, weight...)
[in] | text | to compute size for |
[out] | w | outgoing text width |
[out] | h | outgoing 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...)
[in] | text | to compute size for |
[out] | w | outgoing text width |
[out] | h | outgoing text height |