ClanLib
2.3.7
|
Bitmap Font class. More...
#include <font_system.h>
Public Member Functions | |
Construction | |
CL_Font_System () | |
Constructs a CL_Texture bitmap font. More... | |
CL_Font_System (CL_GraphicContext &context, const CL_StringRef &typeface_name, int height) | |
Constructs a Font System. More... | |
CL_Font_System (CL_GraphicContext &context, const CL_FontDescription &desc) | |
Constructs a Font System. More... | |
~CL_Font_System () | |
Attributes | |
CL_FontProvider_System * | get_provider () const |
Retrieves the font provider. More... | |
CL_Font_TextureGlyph * | get_glyph (CL_GraphicContext &gc, int glyph) |
Get a glyph. Returns NULL if the glyph was not found. More... | |
Attributes | |
bool | is_null () const |
Is Null. More... | |
Operations | |
void | draw_text (CL_GraphicContext &gc, int x, int y, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc. More... | |
void | draw_text (CL_GraphicContext &gc, float x, float y, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc. More... | |
void | draw_text (CL_GraphicContext &gc, const CL_Pointf &position, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc. More... | |
void | draw_text_ellipsis (CL_GraphicContext &gc, int x, int y, CL_Rect content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc adding elipses if it does not fit. More... | |
void | draw_text_ellipsis (CL_GraphicContext &gc, float x, float y, CL_Rectf content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc adding elipses if it does not fit. More... | |
void | draw_text_ellipsis (CL_GraphicContext &gc, const CL_Pointf &position, CL_Rectf content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white) |
Print text on gc adding elipses if it does not fit. More... | |
CL_Size | get_text_size (CL_GraphicContext &gc, const CL_StringRef &text) |
Calculate size of text string. More... | |
CL_Size | get_glyph_size (CL_GraphicContext &gc, unsigned int glyph) |
Gets the size of a specified glyph. More... | |
CL_FontMetrics | get_font_metrics () |
Retrieves font metrics description for the selected font. More... | |
int | get_character_index (CL_GraphicContext &gc, const CL_String &text, const CL_Point &point) |
Get the character index at a specified point. More... | |
Operations | |
void | set_texture_group (CL_TextureGroup &new_texture_group) |
Set the texture font to use a specified texture group. More... | |
void | load_font (CL_GraphicContext &context, const CL_FontDescription &desc) |
Load a system font (for use by insert_glyph to load text from a system font) More... | |
void | free_font () |
Free the system font when it is no longer required. More... | |
void | insert_glyph (CL_GraphicContext &gc, CL_Font_System_Position &position, CL_PixelBuffer &pixel_buffer) |
Insert a glyph from a pixel buffer. More... | |
void | insert_glyph (CL_GraphicContext &gc, const CL_StringRef &text) |
Insert glyphs from a text string (using to system font) More... | |
void | set_font_metrics (const CL_FontMetrics &metrics) |
Set the font metrics for the bitmap font. This is done automatically if the font is loaded from the system font. More... | |
static void | register_font (const CL_StringRef &font_filename, const CL_StringRef &font_typeface) |
Registers a font for lookup when creating fonts. More... | |
Bitmap Font class.
CL_Font_System::CL_Font_System | ( | ) |
Constructs a CL_Texture bitmap font.
CL_Font_System::CL_Font_System | ( | CL_GraphicContext & | context, |
const CL_StringRef & | typeface_name, | ||
int | height | ||
) |
Constructs a Font System.
context | = Graphic Context |
typeface_name | = String Ref |
height | = value |
CL_Font_System::CL_Font_System | ( | CL_GraphicContext & | context, |
const CL_FontDescription & | desc | ||
) |
Constructs a Font System.
context | = Graphic Context |
desc | = Font Description |
CL_Font_System::~CL_Font_System | ( | ) |
|
inherited |
Print text on gc.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
x | = X position |
y | = Y position |
text | = The text to draw |
color | = The text color |
|
inherited |
Print text on gc.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
x | = X position |
y | = Y position |
text | = The text to draw |
color | = The text color |
|
inherited |
Print text on gc.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
position | = Dest position |
text | = The text to draw |
color | = The text color |
|
inherited |
Print text on gc adding elipses if it does not fit.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
x | = X position |
y | = Y position |
content_box | = Rectangle the text is allowed within |
text | = The text to draw |
color | = The text color |
|
inherited |
Print text on gc adding elipses if it does not fit.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
x | = X position |
y | = Y position |
content_box | = Rectangle the text is allowed within |
text | = The text to draw |
color | = The text color |
|
inherited |
Print text on gc adding elipses if it does not fit.
Multiline text (seperated by /n) is supported
gc | = Graphic Context |
position | = Dest position |
content_box | = Rectangle the text is allowed within |
text | = The text to draw |
color | = The text color |
void CL_Font_System::free_font | ( | ) |
Free the system font when it is no longer required.
|
inherited |
Get the character index at a specified point.
Multiline text (seperated by /n) is supported
gc | = The Graphic Context |
text | = The string |
point | = The point |
|
inherited |
Retrieves font metrics description for the selected font.
CL_Font_TextureGlyph* CL_Font_System::get_glyph | ( | CL_GraphicContext & | gc, |
int | glyph | ||
) |
Get a glyph. Returns NULL if the glyph was not found.
|
inherited |
Gets the size of a specified glyph.
The size is the increment value to the next glyph
glyph | = The glyph to get |
CL_FontProvider_System* CL_Font_System::get_provider | ( | ) | const |
Retrieves the font provider.
|
inherited |
Calculate size of text string.
Multiline text (seperated by /n) is supported
Note: The height also includes whitespace (to give the maximum font height), so "." and "X" returns the same height.
The width is the pixel width
The size is the increment value to the next glyph
void CL_Font_System::insert_glyph | ( | CL_GraphicContext & | gc, |
CL_Font_System_Position & | position, | ||
CL_PixelBuffer & | pixel_buffer | ||
) |
Insert a glyph from a pixel buffer.
param: gc = The graphic context param: position = The bitmap font position param: pixel_buffer = Pixel buffer containing the glyph.
void CL_Font_System::insert_glyph | ( | CL_GraphicContext & | gc, |
const CL_StringRef & | text | ||
) |
Insert glyphs from a text string (using to system font)
param: gc = The graphic context param: text = The text to use
|
inherited |
Is Null.
void CL_Font_System::load_font | ( | CL_GraphicContext & | context, |
const CL_FontDescription & | desc | ||
) |
Load a system font (for use by insert_glyph to load text from a system font)
|
static |
Registers a font for lookup when creating fonts.
void CL_Font_System::set_font_metrics | ( | const CL_FontMetrics & | metrics) |
Set the font metrics for the bitmap font. This is done automatically if the font is loaded from the system font.
void CL_Font_System::set_texture_group | ( | CL_TextureGroup & | new_texture_group) |
Set the texture font to use a specified texture group.