summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbfont.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-06 20:23:27 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-06 20:23:27 +0000
commiteccc2bd009e967e45d38a573080d13a1339eb0a6 (patch)
tree810341f795f88ab63147d3ed545c1eb812347ebc /utils/themeeditor/graphics/rbfont.cpp
parent120f3e1c10c36fd5d174741d0da81ba84fc79ae3 (diff)
downloadrockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.zip
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.gz
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.bz2
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.xz
Theme Editor: Added font directory option in preferences dialog, renderer will now search that directory for fonts if they're not found in the project directory
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27322 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbfont.cpp')
-rw-r--r--utils/themeeditor/graphics/rbfont.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp
index e59c79a..1c2739d 100644
--- a/utils/themeeditor/graphics/rbfont.cpp
+++ b/utils/themeeditor/graphics/rbfont.cpp
@@ -27,6 +27,7 @@
#include <QPainter>
#include <QBitmap>
#include <QImage>
+#include <QSettings>
quint16 RBFont::maxFontSizeFor16BitOffsets = 0xFFDB;
@@ -36,7 +37,19 @@ RBFont::RBFont(QString file)
/* Attempting to locate the correct file name */
if(!QFile::exists(file))
- file = ":/fonts/08-Schumacher-Clean.fnt";
+ {
+ /* Checking in the fonts repository */
+ QSettings settings;
+ settings.beginGroup("RBFont");
+
+ file = file.split("/").last();
+ file = settings.value("fontDir", "").toString() + "/" + file;
+
+ settings.endGroup();
+
+ if(!QFile::exists(file))
+ file = ":/fonts/08-Schumacher-Clean.fnt";
+ }
header.insert("filename", file);
/* Opening the file */