engineData should be cached solely based on QFontDef
authorJiang Jiang <jiang.jiang@nokia.com>
Wed, 30 Nov 2011 10:28:30 +0000 (11:28 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Dec 2011 08:12:00 +0000 (09:12 +0100)
commit13eba9ddf47d570fc4562c20fcfbacd1dfa4a61a
treea0752f31e8b4b688a1c38863c02e717855bdfcba
parent98ebac7ede5aa4c16e6f204e0d37d9835a6fad6c
engineData should be cached solely based on QFontDef

Each QFontPrivate points to a QFontEngineData instance, which is
essentially a mapping from different scripts to QFontEngines. Let's
say we have QFont("Waree") and trying to use that for one text in
Thai and another text in English, there should be only one
QFontEngineData: [ QUnicodeTables::Common -> QFontEngineMulti(1),
QUnicodeTables::Thai -> QFontEngineMulti(2) ]. If we cache
QFontEngineData using QFontCache::Key (which includes QFontDef,
script and screen) as the key, then we will create two
QFontEngineData: [ QUnicodeTables::Common -> QFontEngineMulti(1) ]
and [ QUnicodeTables::Thai -> QFontEngineMulti(2) ], so it will be
pointless to have QFontEngineData at all.

This bug was introduced in a 2005 refactoring (512f0e8c in history
repo).

Change-Id: I14677507e97682472cde9a0e1b594e903ec9e718
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/gui/text/qfont.cpp
src/gui/text/qfont_p.h
src/gui/text/qfontdatabase.cpp
src/gui/text/qfontdatabase_qpa.cpp