summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics/rbfont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/graphics/rbfont.cpp')
-rw-r--r--utils/themeeditor/graphics/rbfont.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp
index 48e0f304be..71c6ff3fc1 100644
--- a/utils/themeeditor/graphics/rbfont.cpp
+++ b/utils/themeeditor/graphics/rbfont.cpp
@@ -21,6 +21,9 @@
#include "rbfont.h"
+#include <QFont>
+#include <QBrush>
+
RBFont::RBFont(QString file): filename(file)
{
}
@@ -28,3 +31,15 @@ RBFont::RBFont(QString file): filename(file)
RBFont::~RBFont()
{
}
+
+QGraphicsSimpleTextItem* RBFont::renderText(QString text, QColor color,
+ QGraphicsItem *parent)
+{
+ QGraphicsSimpleTextItem* retval = new QGraphicsSimpleTextItem(text, parent);
+ QFont font;
+ font.setFixedPitch(true);
+ font.setPixelSize(8);
+ retval->setFont(font);
+ retval->setBrush(QBrush(color));
+ return retval;
+}