diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 04:21:32 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 04:21:32 (GMT) |
commit | 5171bb1613ecc537f3f0d0962532e3ee059b8870 (patch) | |
tree | 02d0e565d8fc397573a2d35845c11ba74b912c8d /src/gui/text | |
parent | c372896c5293633d75674a320a9b715a0501a42d (diff) | |
parent | 33b76a659b2f44fa7038e375bbfb4cfd449ae617 (diff) | |
download | Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.zip Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.tar.gz Qt-5171bb1613ecc537f3f0d0962532e3ee059b8870.tar.bz2 |
Merge remote branch 'origin/4.7' into master-from-4.7
Conflicts:
doc/src/snippets/code/doc_src_qmake-manual.qdoc
src/corelib/arch/symbian/arch.pri
src/declarative/graphicsitems/qdeclarativeflickable.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
tests/auto/qfontmetrics/tst_qfontmetrics.cpp
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfont_s60.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase_s60.cpp | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp index d39f30a..80a3bb2 100644 --- a/src/gui/text/qfont_s60.cpp +++ b/src/gui/text/qfont_s60.cpp @@ -57,6 +57,16 @@ Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, { }); #endif // QT_NO_FREETYPE +QString QFont::lastResortFont() const +{ + // Symbian's font Api does not distinguish between font and family. + // Therefore we try to get a "Family" first, then fall back to "Sans". + static QString font = lastResortFamily(); + if (font.isEmpty()) + font = QLatin1String("Sans"); + return font; +} + QString QFont::lastResortFamily() const { #ifdef QT_NO_FREETYPE diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index ec252cd..5e168c6 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -453,7 +453,7 @@ QFontDef cleanedFontDef(const QFontDef &req) return result; } -QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFontDef &req) +QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *d, const QFontDef &req) { const QFontCache::Key key(cleanedFontDef(req), script); @@ -498,8 +498,14 @@ QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFo static_cast<const QSymbianFontDatabaseExtrasImplementation*>(db->symbianExtras); const QSymbianTypeFaceExtras *typeFaceExtras = dbExtras->extras(fontFamily, request.weight > QFont::Normal, request.style != QFont::StyleNormal); + + // We need a valid pixelSize, e.g. for lineThickness() + if (request.pixelSize < 0) + request.pixelSize = request.pointSize * d->dpi / 72; + fe = new QFontEngineS60(request, typeFaceExtras); #else // QT_NO_FREETYPE + Q_UNUSED(d) QFontEngine::FaceId faceId; const QtFontFamily * const reqQtFontFamily = db->family(fontFamily); faceId.filename = reqQtFontFamily->fontFilename; |