2007-05-07 09:33:24 -07:00
|
|
|
#ifndef INCLUDED_FONT
|
|
|
|
|
#define INCLUDED_FONT
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2004-10-06 07:12:10 -07:00
|
|
|
#include "lib/res/handle.h"
|
2004-08-27 15:08:30 -07:00
|
|
|
|
2007-01-13 14:44:42 -08:00
|
|
|
class CStrW;
|
2004-08-27 15:08:30 -07:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
To use CFont:
|
|
|
|
|
|
|
|
|
|
CFont font("name");
|
|
|
|
|
font.Bind();
|
|
|
|
|
glwprintf(L"Hello world");
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class CFont
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CFont(const char* name);
|
|
|
|
|
~CFont();
|
|
|
|
|
|
|
|
|
|
void Bind();
|
|
|
|
|
int GetLineSpacing();
|
2004-10-14 03:10:43 -07:00
|
|
|
int GetHeight();
|
2005-12-12 11:19:30 -08:00
|
|
|
int GetCharacterWidth(wchar_t c);
|
2004-09-05 19:24:34 -07:00
|
|
|
void CalculateStringSize(const CStrW& string, int& w, int& h);
|
2004-08-27 15:08:30 -07:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Handle h;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 09:33:24 -07:00
|
|
|
#endif // INCLUDED_FONT
|