#include <defaultfont.hpp>
Inheritance diagram for gcn::DefaultFont:
It is used by default merely to show that no font have been set.
Definition at line 67 of file defaultfont.hpp.
Public Member Functions | |
virtual | ~DefaultFont () |
Destructor. | |
virtual int | drawGlyph (Graphics *graphics, unsigned char glyph, int x, int y) |
Draws a glyph as a rectangle. | |
virtual void | drawString (Graphics *graphics, const std::string &text, int x, int y) |
Draws a string. | |
virtual int | getWidth (const std::string &text) const |
Gets the width of a string. | |
virtual int | getHeight () const |
Gets the height of the glyphs in the font. | |
virtual int | getStringIndexAt (const std::string &text, int x) |
Gets a string index in a string providing an x coordinate. |
|
Draws a glyph as a rectangle. The glyphs always be drawn as rectangles no matter the glyph. NOTE: You normally won't use this function to draw text since the Graphics class contains better functions for drawing text.
Definition at line 74 of file defaultfont.cpp. Referenced by drawString(). |
|
Draws a string. NOTE: You normally won't use this function to draw text since Graphics contains better functions for drawing text.
Implements gcn::Font. Definition at line 81 of file defaultfont.cpp. References drawGlyph(), and getWidth(). |
|
Gets the height of the glyphs in the font.
Implements gcn::Font. Definition at line 64 of file defaultfont.cpp. |
|
Gets a string index in a string providing an x coordinate. Used to retrive a string index (for a character in a string) at a certain x position. It is especially useful when a mouse clicks in a TextField and you want to know which character was clicked.
Reimplemented from gcn::Font. Definition at line 92 of file defaultfont.cpp. |
|
Gets the width of a string. The width of a string is not necesserily the sum of all the widths of it's glyphs.
Implements gcn::Font. Definition at line 69 of file defaultfont.cpp. Referenced by drawString(). |