Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Helper class for measuring sizes of text. More...
#include <FontMetrics.h>
Public Member Functions | |
CFontMetrics (CStrIntern font) | |
int | GetLineSpacing () const |
int | GetHeight () const |
int | GetCharacterWidth (wchar_t c) const |
void | CalculateStringSize (const wchar_t *string, int &w, int &h) const |
Private Attributes | |
std::shared_ptr< CFont > | m_Font |
Helper class for measuring sizes of text.
This will load the font when necessary, and will return plausible values if loading fails (since misrendering is better than crashing).
CFontMetrics::CFontMetrics | ( | CStrIntern | font | ) |
void CFontMetrics::CalculateStringSize | ( | const wchar_t * | string, |
int & | w, | ||
int & | h | ||
) | const |
int CFontMetrics::GetCharacterWidth | ( | wchar_t | c | ) | const |
int CFontMetrics::GetHeight | ( | ) | const |
int CFontMetrics::GetLineSpacing | ( | ) | const |
|
private |