diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-08-17 14:47:42 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-19 01:21:13 +0200 |
commit | 1e0d1c5f2996da33db1e3e4c1f7c6ef3e1f29416 (patch) | |
tree | 74bfdea5132323d9d1db36d1a34579655522f8d9 /src/gui/text/qfontdatabase_qpa.cpp | |
parent | b0c1c98f76e2006a67da0b8455b44205753be30b (diff) |
Fixed broken lookup of fallback fonts on qpa
Loading of fallback fonts from the font cache was broken.
While iterating through fallback fonts, we would incorrectly skip any
fonts which were already in the cache. This would cause unstable lookup
results for some fonts, depending on the order in which fonts were
loaded during the current process.
Change-Id: I56a6a07e93196ed14f33f4cc181e41c5b8f19498
Reviewed-on: http://codereview.qt.nokia.com/3059
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/gui/text/qfontdatabase_qpa.cpp')
-rw-r--r-- | src/gui/text/qfontdatabase_qpa.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 6b6f4f1a54..032a42b9b1 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -292,7 +292,7 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp, if (!engine) { if (!request.family.isEmpty()) { QStringList fallbacks = fallbackFamilies(request.family,QFont::Style(request.style),QFont::StyleHint(request.styleHint),QUnicodeTables::Script(script)); - for (int i = 0; i < fallbacks.size(); i++) { + for (int i = 0; !engine && i < fallbacks.size(); i++) { QFontDef def = request; def.family = fallbacks.at(i); QFontCache::Key key(def,script); @@ -306,7 +306,6 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp, engine = loadEngine(script, def, desc.family, desc.foundry, desc.style, desc.size); if (engine) { initFontDef(desc, def, &engine->fontDef); - break; } } } |