#include <font.h>
Public Member Functions | |
Construction | |
Font () | |
Constructs a font. More... | |
Font (Canvas &canvas, const std::string &typeface_name, int height) | |
Constructs standard font. More... | |
Font (Canvas &canvas, const FontDescription &desc) | |
Font (Canvas &canvas, const FontDescription &desc, const std::string &ttf_filename) | |
Font (Canvas &canvas, const FontDescription &desc, const std::string &ttf_filename, FileSystem fs) | |
Font (Canvas &canvas, Sprite &sprite, const std::string &glyph_list, int spacelen, bool monospace, const FontMetrics &metrics) | |
Constructs a Font based on a sprite. More... | |
Attributes | |
bool | is_null () const |
Is Null. More... | |
Operations | |
void | draw_text (Canvas &canvas, int x, int y, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc. More... | |
void | draw_text (Canvas &canvas, float x, float y, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc. More... | |
void | draw_text (Canvas &canvas, const Pointf &position, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc. More... | |
void | draw_text_ellipsis (Canvas &canvas, int x, int y, Rect content_box, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc adding ellipses if it does not fit. More... | |
void | draw_text_ellipsis (Canvas &canvas, float x, float y, Rectf content_box, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc adding ellipses if it does not fit. More... | |
void | draw_text_ellipsis (Canvas &canvas, const Pointf &position, Rectf content_box, const std::string &text, const Colorf &color=Colorf::white) |
Print text on gc adding ellipses if it does not fit. More... | |
Size | get_text_size (Canvas &canvas, const std::string &text) |
Calculate size of text string. More... | |
Size | get_glyph_size (Canvas &canvas, unsigned int glyph) |
Gets the size of a specified glyph. More... | |
FontMetrics | get_font_metrics () |
Retrieves font metrics description for the selected font. More... | |
int | get_character_index (Canvas &canvas, const std::string &text, const Point &point) |
Get the character index at a specified point. More... | |
Static Public Member Functions | |
Resources | |
static Resource< Font > | resource (Canvas &canvas, const FontDescription &desc, const ResourceManager &resources) |
Retrieves a Font resource from the resource manager. More... | |