summaryrefslogtreecommitdiff
path: root/include/font.h
blob: 3377ef092f4befba9ee0210e86ad188c2580a56f (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __FONT_H__
#define __FONT_H__

#include <SDL.h>
#include <stdarg.h>
#include <BString.h>
#include <Handle.h>
#include <texture.h>
#include <mcolor.h>

namespace mogltk {
    class font : public Base {
      public:
          font(Handle *);
	  virtual ~font();
	virtual void drawentry(Uint16, int, int, ColorP = WHITE);
	void putcursor(int, int);
	void putentry(Uint16, ColorP = WHITE);
	void putchar(char, ColorP = WHITE);
	void newline(void);
	int printf(const ugly_string &, ...);
	int printf(const char *, ...);
	int printf(const ugly_string &, va_list);
	void setcolor(ColorP);
	void setshadow(int);
	void setwspace(int);
	int getchar(char) const;
	int singletextsize(const String &) const;
	
      protected:
        Uint8 * sizes;
	Uint16 nbentries, nbcT, nbT;
	Uint8 flags, maxX, maxY, nbcU, nbcV, base, inter;
	int cx, cy, ox;
	ColorP textcolor;
	int shadow, wspace;
	texture * alloctexture();
	void Bind(int);
      private:
	texture ** fonttex;
	Uint16 * corresp;
    };
    extern font * SystemFont;
};

#endif