diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-02-01 21:29:47 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-02-01 21:33:38 +0100 |
commit | 5a64033f89e07505bb77d3c172597b8df3cbd762 (patch) | |
tree | 88eeeaf93d6d1c4071d21953470010699f86e38e /src/gui/text/qfontengine_s60_p.h | |
parent | cecc68ee98e4258b63c3c798cdbf230f09dc0e77 (diff) |
Fixed text rendering via scaled QPainter on rasterPaintEngine / Symbian
Text rendering in Qt for Symbian looks very bad on a scaled QPainter.
Instead of simply using a Symbian font with the right size it followed
the code path that is usually used for "tricky transformation":
Use the glyph outlines and rasterize them in Qt as QPainterPath.
That's slow and especially ugly on Symbian since we do not (yet)
get the glyph outlines from Symbian.
This patch adds QFontEngineS60::setFontScale() so that QFontEngineS60
has one additional native font handle with the scaled size. The raster
paint engine will call that function in case that the painter is scaled.
Since we already have QFontEngineS60 specific code in the raster paint
engine, this patch did not have to add #ifdefs.
http://bugreports.qt.nokia.com/browse/QTBUG-7614
Task-number: QTBUG-7614
Reviewed-by: Jason Barron
modified: gui/painting/qpaintengine_raster.cpp
modified: gui/text/qfontengine_s60.cpp
modified: gui/text/qfontengine_s60_p.h
Diffstat (limited to 'src/gui/text/qfontengine_s60_p.h')
-rw-r--r-- | src/gui/text/qfontengine_s60_p.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 4748497d90..78f8a9a2fc 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -117,15 +117,21 @@ public: Type type() const; void getCharacterData(glyph_t glyph, TOpenFontCharMetrics& metrics, const TUint8*& bitmap, TSize& bitmapSize) const; + void setFontScale(qreal scale); private: friend class QFontPrivate; QFixed glyphAdvance(HB_Glyph glyph) const; + CFont *fontWithSize(qreal size) const; + static void releaseFont(CFont *&font); - CFont* m_font; const QFontEngineS60Extensions *m_extensions; - qreal m_fontSizeInPixels; + CFont* m_originalFont; + const qreal m_originalFontSizeInPixels; + CFont* m_scaledFont; + qreal m_scaledFontSizeInPixels; + CFont* m_activeFont; }; class QFontEngineMultiS60 : public QFontEngineMulti |