forked from len0rd/rockbox
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
This commit is contained in:
parent
120f3e1c10
commit
eccc2bd009
4 changed files with 82 additions and 4 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue