summaryrefslogtreecommitdiffstats
path: root/kpacman/bitfont.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-08-17 18:58:43 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-08-17 18:58:43 +0200
commit6f2c87870081718731cccee678e1e89869826de2 (patch)
tree942f97a4b9d4126d385e8bdc0aee30ff3dc6ed6d /kpacman/bitfont.h
downloadtdepacman-6f2c87870081718731cccee678e1e89869826de2.tar.gz
tdepacman-6f2c87870081718731cccee678e1e89869826de2.zip
Initial import of version 0.3.2 from the source package.
https://sourceforge.net/projects/kpacman/files/kpacman/0.3.2/kpacman-0.3.2.tar.gz Original package is licenced under GPL 2.0. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kpacman/bitfont.h')
-rw-r--r--kpacman/bitfont.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/kpacman/bitfont.h b/kpacman/bitfont.h
new file mode 100644
index 0000000..c12aa0f
--- /dev/null
+++ b/kpacman/bitfont.h
@@ -0,0 +1,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
+