2004-08-28 00:08:30 +02:00
|
|
|
#ifndef _FONT_H
|
|
|
|
#define _FONT_H
|
|
|
|
|
|
|
|
#include "ps/Singleton.h"
|
|
|
|
#include "ps/CStr.h"
|
|
|
|
|
2004-10-06 16:12:10 +02:00
|
|
|
#include "lib/res/handle.h"
|
2004-08-28 00:08:30 +02:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
To use CFont:
|
|
|
|
|
|
|
|
CFont font("name");
|
|
|
|
font.Bind();
|
|
|
|
glwprintf(L"Hello world");
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2004-12-28 00:27:26 +01:00
|
|
|
// MFC has nicked all the good names :-(
|
|
|
|
#define CFont PS_CFont
|
|
|
|
|
2004-08-28 00:08:30 +02:00
|
|
|
class CFont
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CFont(const char* name);
|
|
|
|
~CFont();
|
|
|
|
|
|
|
|
void Bind();
|
|
|
|
int GetLineSpacing();
|
2004-10-14 12:10:43 +02:00
|
|
|
int GetHeight();
|
2004-11-25 00:47:48 +01:00
|
|
|
int GetCharacterWidth(const 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
|