2004-08-28 00:08:30 +02:00
|
|
|
#ifndef _FONT_H
|
|
|
|
#define _FONT_H
|
|
|
|
|
2004-10-06 16:12:10 +02:00
|
|
|
#include "lib/res/handle.h"
|
2004-08-28 00:08:30 +02:00
|
|
|
|
2007-01-13 23:44:42 +01:00
|
|
|
class CStrW;
|
2004-08-28 00:08:30 +02: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 12:10:43 +02:00
|
|
|
int GetHeight();
|
2005-12-12 20:19:30 +01:00
|
|
|
int GetCharacterWidth(wchar_t c);
|
2004-09-06 04:24:34 +02:00
|
|
|
void CalculateStringSize(const CStrW& string, int& w, int& h);
|
2004-08-28 00:08:30 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Handle h;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-06 13:18:22 +02:00
|
|
|
#endif // _FONT_H
|