#include <faith/font.h>
Public Member Functions | |
| FontMetrics (const Font &f) | |
| FontMetrics (const FontMetrics &font) | |
| ~FontMetrics () | |
| FontMetrics & | operator= (const FontMetrics &font) |
| Faith::Rect | boundingRect (const String &str, int len=-1) const |
| Faith::Size | size (const String &str, int len=-1) const |
| Faith::Size | size (const String &str, int pos, int len) const |
| int | width (const String &str, int len=-1) const |
| int | width (const String &str, int pos, int len) const |
| int | ascent (const Char &ch) const |
| int | ascent () const |
| int | descent (const Char &ch) const |
| int | descent () const |
| int | height () const |
| bool | inFont (const Char &ch) const |
| int | underlinePos () const |
| int | overlinePos () const |
| int | strikeOutPos () const |
| int | lineWidth () const |
This class is used to measure strings of text in certain fonts. You can use this class to, for example, find out where the carat goes, where selection highliting begins, or where to do word wrapping
| Faith::FontMetrics::FontMetrics | ( | const Font & | f | ) |
Makes an object for the given font
| Faith::FontMetrics::FontMetrics | ( | const FontMetrics & | font | ) |
Makes a copy of the given FontMetrics
| Faith::FontMetrics::~FontMetrics | ( | ) |
| int Faith::FontMetrics::ascent | ( | ) | const |
| int Faith::FontMetrics::ascent | ( | const Char & | ch | ) | const |
| Faith::Rect Faith::FontMetrics::boundingRect | ( | const String & | str, | |
| int | len = -1 | |||
| ) | const |
Be aware that this measures in relationship to the origin, which means that if the leftBearing() for the first character is more than 0, the rectangle's first X coordinate will be less than 0.
| int Faith::FontMetrics::descent | ( | ) | const |
| int Faith::FontMetrics::descent | ( | const Char & | ch | ) | const |
| int Faith::FontMetrics::height | ( | ) | const |
| bool Faith::FontMetrics::inFont | ( | const Char & | ch | ) | const |
| int Faith::FontMetrics::lineWidth | ( | ) | const |
| FontMetrics& Faith::FontMetrics::operator= | ( | const FontMetrics & | font | ) |
| int Faith::FontMetrics::overlinePos | ( | ) | const |
| Faith::Size Faith::FontMetrics::size | ( | const String & | str, | |
| int | pos, | |||
| int | len | |||
| ) | const |
| Faith::Size Faith::FontMetrics::size | ( | const String & | str, | |
| int | len = -1 | |||
| ) | const |
| int Faith::FontMetrics::strikeOutPos | ( | ) | const |
| int Faith::FontMetrics::underlinePos | ( | ) | const |
| int Faith::FontMetrics::width | ( | const String & | str, | |
| int | pos, | |||
| int | len | |||
| ) | const |
| int Faith::FontMetrics::width | ( | const String & | str, | |
| int | len = -1 | |||
| ) | const |
1.4.7