-
Notifications
You must be signed in to change notification settings - Fork 0
/
font.h
32 lines (23 loc) · 703 Bytes
/
font.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __FONT_H__
#define __FONT_H__
#include <string>
#include <SDL_ttf.h>
class Font
{
private:
TTF_Font *font;
void *data;
public:
Font(const std::wstring &name, int ptsize);
~Font();
public:
void draw(SDL_Surface *s, int x, int y, int r, int g, int b,
bool shadow, const std::wstring &text);
void draw(int x, int y, int r, int g, int b, bool shadow,
const std::wstring &text);
int getWidth(const std::wstring &text);
int getWidth(wchar_t ch);
int getHeight(const std::wstring &text);
void getSize(const std::wstring &text, int &width, int &height);
};
#endif