From eccc2bd009e967e45d38a573080d13a1339eb0a6 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Tue, 6 Jul 2010 20:23:27 +0000 Subject: 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 --- utils/themeeditor/graphics/rbfont.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor/graphics') diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp index e59c79a970..1c2739d118 100644 --- a/utils/themeeditor/graphics/rbfont.cpp +++ b/utils/themeeditor/graphics/rbfont.cpp @@ -27,6 +27,7 @@ #include #include #include +#include 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 */ -- cgit v1.2.3