summaryrefslogtreecommitdiffstats
path: root/kpacman/bitfont.h
blob: c12aa0f5dae5e085004471231bac71d30d843690 (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
#ifndef BITFONT_H
#define BITFONT_H

#include <qstring.h>
#include <qbitmap.h>
#include <qpixmap.h>
#include <qrect.h>

#include "colors.h"

class Bitfont
{
public:
    Bitfont(QString fontname, uchar firstChar, uchar lastChar);

    QPixmap text(QString str, QColor fg = BLACK, QColor bg = QColor());
    QRect rect(QString str);
    int width();
    int height();
    uchar firstChar();
    uchar lastChar();
private:
    QBitmap font;
    int fontWidth;
    int fontHeight;
    uchar fontFirstChar;
    uchar fontLastChar;
};

#endif // BITFONT_H