1 |
dpavlin |
1 |
/* |
2 |
|
|
* PearPC |
3 |
|
|
* font.h |
4 |
|
|
* |
5 |
|
|
* Copyright (C) 1999-2003 Sebastian Biallas (sb@biallas.net) |
6 |
|
|
* |
7 |
|
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
|
* it under the terms of the GNU General Public License version 2 as |
9 |
|
|
* published by the Free Software Foundation. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
|
|
*/ |
20 |
|
|
#ifndef __FONT_H__ |
21 |
|
|
#define __FONT_H__ |
22 |
|
|
|
23 |
|
|
#include "tools/data.h" |
24 |
|
|
#include "display.h" |
25 |
|
|
|
26 |
|
|
class Font: public Object { |
27 |
|
|
int mCharWidth; |
28 |
|
|
int mCharHeight; |
29 |
|
|
int mRealWidth; |
30 |
|
|
int mRealHeight; |
31 |
|
|
int mPadX; |
32 |
|
|
int mPadY; |
33 |
|
|
int mBytes; |
34 |
|
|
byte *mData; |
35 |
|
|
public: |
36 |
|
|
Font(); |
37 |
|
|
bool loadFromFile(File &file); |
38 |
|
|
void setPadding(int px, int py); |
39 |
|
|
~Font(); |
40 |
|
|
|
41 |
|
|
void drawChar(int x, int y, byte c, uint fgcolor, uint bgcolor, byte *tobuf, int bufwidth, int bufheight, int bufcolorbytes); |
42 |
|
|
void drawFixedChar(int x, int y, int dx, int dy, byte c, uint fgcolor, uint bgcolor, byte *tobuf, int bufwidth, int bufheight, int bufcolorbytes); |
43 |
|
|
|
44 |
|
|
void drawChar2(SystemDisplay *toDisplay, int x, int y, byte c, RGBA fgcolor, RGBA bgcolor); |
45 |
|
|
void drawFixedChar2(SystemDisplay *toDisplay, int x, int y, int dx, int dy, byte c, RGBA fgcolor, RGBA bgcolor); |
46 |
|
|
}; |
47 |
|
|
|
48 |
|
|
#endif |