Revert "Fix fallbacks for adapted common script"

This reverts 1dd9a0af4f. It was
a band-aid for a change in the unicode itemizing algorithm
which caused the script of a script item to become unreliable.
This change has since been reverted, so the band-aid is no longer
needed, and it also causes problems for WebKit on Windows when
it ends up preferring Arial Unicode MS as the font for Uchen
script, even though the font does not support this script.

The autotest from the reverted commit is kept in place and still
passes.

[ChangeLog][Text] Fixed regression when rendering Uchen text in
WebKit on Windows.

Change-Id: I488c84703bb55a050d90092c6bf9e5c70a9e31c2
Task-number: QTBUG-41372
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2014-11-13 13:00:11 +01:00 committed by Jani Heikkinen
parent 70ea4e2b29
commit 9afb02412e
3 changed files with 7 additions and 7 deletions

View File

@ -593,7 +593,7 @@ struct QtFontDesc
static int match(int script, const QFontDef &request,
const QString &family_name, const QString &foundry_name, int force_encoding_id,
QtFontDesc *desc, const QList<int> &blacklisted, bool fallback);
QtFontDesc *desc, const QList<int> &blacklisted);
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
{
@ -1083,7 +1083,7 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
*/
static int match(int script, const QFontDef &request,
const QString &family_name, const QString &foundry_name, int force_encoding_id,
QtFontDesc *desc, const QList<int> &blacklistedFamilies, bool fallback = false)
QtFontDesc *desc, const QList<int> &blacklistedFamilies)
{
Q_UNUSED(force_encoding_id);
int result = -1;
@ -1136,7 +1136,7 @@ static int match(int script, const QFontDef &request,
load(test.family->name, script);
// Check if family is supported in the script we want
if (!fallback && script != QChar::Script_Common && !(test.family->writingSystems[writingSystem] & QtFontFamily::Supported))
if (script != QChar::Script_Common && !(test.family->writingSystems[writingSystem] & QtFontFamily::Supported))
continue;
// as we know the script is supported, we can be sure
@ -2454,7 +2454,7 @@ bool QFontDatabase::supportsThreadedFontRendering()
*/
QFontEngine *
QFontDatabase::findFont(int script, const QFontPrivate *fp,
const QFontDef &request, bool multi, bool fallback)
const QFontDef &request, bool multi)
{
QMutexLocker locker(fontDatabaseMutex());
@ -2482,7 +2482,7 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
QtFontDesc desc;
QList<int> blackListed;
int index = match(script, request, family_name, foundry_name, force_encoding_id, &desc, blackListed, fallback);
int index = match(script, request, family_name, foundry_name, force_encoding_id, &desc, blackListed);
if (index >= 0) {
engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size);
if (!engine)

View File

@ -152,7 +152,7 @@ private:
static void createDatabase();
static void parseFontName(const QString &name, QString &foundry, QString &family);
static QString resolveFontFamilyAlias(const QString &family);
static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request, bool multi = false, bool fallback = false);
static QFontEngine *findFont(int script, const QFontPrivate *fp, const QFontDef &request, bool multi = false);
static void load(const QFontPrivate *d, int script);
friend struct QFontDef;

View File

@ -2037,7 +2037,7 @@ void QFontEngineMultiBasicImpl::loadEngine(int at)
request.family = fallbackFamilies.at(at-1);
engines[at] = QFontDatabase::findFont(script,
/*fontprivate = */0,
request, /*multi = */false, true);
request, /*multi = */false);
Q_ASSERT(engines[at]);
engines[at]->ref.ref();
engines[at]->fontDef = request;