![]() | |
![]() | ![]() |
Entire Class Index | Main Class Index | Cross Index | Global Index |
ClanLib's font class.
Contained in: global
Derived from:
none
Derived by:
none
Group: Display (Fonts)
#include <ClanLib/display.h>
public function member index: |
||
Static_init: |
||
static CL_Font* | create | (CL_Font_Description* font_desc); |
static CL_Font* | load | (const std::string& resource_id, CL_ResourceManager* resource_manager); |
Construction: |
||
CL_Font | (CL_Font_Description* provider); | |
CL_Font | (const std::string& resource_id, CL_ResourceManager* manager); | |
CL_Font | (const CL_Font& font); | |
virtual | ~CL_Font | (); |
Operations: |
||
CL_Font& | operator = | (const CL_Font& copy); |
int | get_height | (); |
int | get_text_width | (const std::string& text); |
int | get_char_width | (const char character); |
void | print_left | (int x, int y, const std::string& text, int n_height=1); |
void | print_left | (int x, int y, float scale_x, float scale_y, const std::string& text); |
void | print_center | (int x, int y, const std::string& text, int n_height=1); |
void | print_right | (int x, int y, const std::string& text, int n_height=1); |
void | put_target | (int x, int y, const std::string& text, CL_Target* target, int alignment = ALIGN_LEFT); |
int | change_size | (int size); |
unsigned int | change_colour | (unsigned char r, unsigned char g, unsigned char b, unsigned char a); |
Implementation: |
||
CL_Font | (class CL_Font_Generic* impl); | |
r - The red component
g - The green component
b - The blue component
a - The alpha component
Returns - Returns the font set in packed ARGB format.
size - The new size to use.
Returns - Returns the size set or -1 if the font size cannot be changed to size
font_desc - The font description used to construct the font.
text - Character the width should be calculated from.
Returns - Width of the character (in pixels).
Returns - Width of the font.
text - Text string the width should be calculated from.
Returns - Width of the text (in pixels).
resource_id - The resource ID of the font.
resource_manager - The resource manager used to load the
resources from.
x - X coordinate (in pixels) the text is centered at.
y - Y coordiante (in pixels) the text is centered at.
text - The text to be drawn with this font.
n_height - Adds font height + n_height pixels to Y coordinate on new line ('\n').
x - X coordinate (in pixels) the text is drawn at.
y - Y coordiante (in pixels) the text is drawn at.
text - The text to be drawn with this font.
n_height - Adds font height + n_height pixels to Y coordinate on new line ('\n').
x - X coordinate (in pixels) the text is drawn at.
y - Y coordiante (in pixels) the text is drawn at.
scale_x - Scale font width scale_x times.
scale_y - Scale font height scale_y times.
text - The text to be drawn with this font.
x - X coordinate (in pixels) the text is ends at.
y - Y coordiante (in pixels) the text is drawn at.
text - The text to be drawn with this font.
n_height - Adds font height + n_height pixels to Y coordinate on new line ('\n').
x - X coordinate (in pixels)
y - Y coordiante (in pixels)
text - The text to be drawn with this font.
target - the target surface to blit to.
alignment - the alignment of the text, CL_Font::ALIGN_LEFT, CL_Font::ALIGN_CENTER, CL_Font::ALIGN_RIGHT