summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2009-09-10 15:07:56 (GMT)
committermread <qt-info@nokia.com>2009-09-10 15:15:17 (GMT)
commit2409e4532b5742530c70431ad2967c43ef291839 (patch)
tree7f9226d96975369e7993af14b64f712289098581 /src/gui
parent2f8f1f704fb81319714a41bc7d1e4c7b22cfce63 (diff)
downloadQt-2409e4532b5742530c70431ad2967c43ef291839.zip
Qt-2409e4532b5742530c70431ad2967c43ef291839.tar.gz
Qt-2409e4532b5742530c70431ad2967c43ef291839.tar.bz2
S60 font db more tolerant of failure
This now loads the fonts it can and asserts that at least one is loaded, rather than requiring all fonts to load. Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index dd0fcb4..e1a2c47 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -221,12 +221,14 @@ static void initializeDb()
const int numTypeFaces = QS60Data::screenDevice()->NumTypefaces();
const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store);
Q_ASSERT(store);
+ bool fontAdded = false;
for (int i = 0; i < numTypeFaces; i++) {
TTypefaceSupport typefaceSupport;
QS60Data::screenDevice()->TypefaceSupport(typefaceSupport, i);
CFont *font; // We have to get a font instance in order to know all the details
TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
- qt_symbian_throwIfError(QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec));
+ if (QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec) != KErrNone)
+ continue;
if (font->TypeUid() == KCFbsFontUid) {
TOpenFontFaceAttrib faceAttrib;
const CFbsFont *cfbsFont = dynamic_cast<const CFbsFont *>(font);
@@ -264,9 +266,12 @@ static void initializeDb()
determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
foreach (const QFontDatabase::WritingSystem system, writingSystems)
family->writingSystems[system] = QtFontFamily::Supported;
+
+ fontAdded = true;
}
QS60Data::screenDevice()->ReleaseFont(font);
}
+ Q_ASSERT(fontAdded);
QS60WindowSurface::lockBitmapHeap();
#else // defined(QT_NO_FREETYPE)
QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));