From be681e71510de948dfc32a647ecef5def6c01118 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 16 Jun 2011 23:40:56 +0200 Subject: Revert "Symbian: Fix QFontInfo::pixelSize()" This reverts commit fcfc19878a0a1a48194a786bba64da11606077d2. I am happy that this commit fixed three bugs at once. But Actually, I am not sure if QTBUG-15513 should be fixed at this point. Fact is that the patch as it is would have changed the point->pixels calculation back to how it was in Qt 4.6. This means that the fonts which are defined with pointSize would now (in Qt 4.7.4) suddenly be bigger than they were in Qt 4.7.3. Imho this is unacceptable, as it would break all layouts which were developed for Qt 4.7 apps, when point size (instead of pixle size) was used. I will need to fix QTBUG-17844 without fixing QTBUG-13009 If QTBUG-13009 will be fixed for 4.8 will be discussed. --- src/gui/text/qfontdatabase_s60.cpp | 4 ++++ src/gui/text/qfontengine_s60.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 6ede1f1..1eb4242 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -1014,6 +1014,10 @@ QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *d, const QF 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) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 6b93efa..36eb7c0 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -294,7 +294,6 @@ QFontEngineS60::QFontEngineS60(const QFontDef &request, const QSymbianTypeFaceEx , m_activeFont(0) { QFontEngine::fontDef = request; - QFontEngine::fontDef.pixelSize = m_originalFontSizeInPixels; // Needs a valid pixel size. QTBUG-13009, QTBUG-17844 setFontScale(1.0); cache_cost = sizeof(QFontEngineS60); } -- cgit v0.12