Provide defaultFont with fontconfig db
So that it won't just return "Helvetica" that may not exist in target system. Providing it seems to fix QTBUG-21833 as well, thus we can remove the QEXPECT_FAIL statement in qlistview test. '_' appears to reach the minimum right bearing in some fonts. Task-number: QTBUG-21833 Change-Id: I2340af6ee736083ec4f6575e469840ebec4e545e Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
parent
5bc35276fb
commit
3d063ecc5f
@ -1218,6 +1218,7 @@ static const ushort char_table[] = {
|
|||||||
88,
|
88,
|
||||||
89,
|
89,
|
||||||
91,
|
91,
|
||||||
|
95,
|
||||||
102,
|
102,
|
||||||
114,
|
114,
|
||||||
124,
|
124,
|
||||||
|
@ -715,8 +715,10 @@ QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) const
|
|||||||
if (!pattern)
|
if (!pattern)
|
||||||
return family;
|
return family;
|
||||||
|
|
||||||
QByteArray cs = family.toUtf8();
|
if (!family.isEmpty()) {
|
||||||
FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData());
|
QByteArray cs = family.toUtf8();
|
||||||
|
FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData());
|
||||||
|
}
|
||||||
FcConfigSubstitute(0, pattern, FcMatchPattern);
|
FcConfigSubstitute(0, pattern, FcMatchPattern);
|
||||||
FcDefaultSubstitute(pattern);
|
FcDefaultSubstitute(pattern);
|
||||||
|
|
||||||
@ -727,3 +729,8 @@ QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) const
|
|||||||
|
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFont QFontconfigDatabase::defaultFont() const
|
||||||
|
{
|
||||||
|
return QFont(resolveFontFamilyAlias(QString()));
|
||||||
|
}
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const;
|
QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const;
|
||||||
QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
|
QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
|
||||||
QString resolveFontFamilyAlias(const QString &family) const;
|
QString resolveFontFamilyAlias(const QString &family) const;
|
||||||
|
QFont defaultFont() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QFONTCONFIGDATABASE_H
|
#endif // QFONTCONFIGDATABASE_H
|
||||||
|
@ -1869,7 +1869,6 @@ void tst_QListView::taskQTBUG_2233_scrollHiddenItems()
|
|||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTest::qWait(50);
|
QTest::qWait(50);
|
||||||
QCOMPARE(bar->value(), bar->maximum());
|
QCOMPARE(bar->value(), bar->maximum());
|
||||||
QEXPECT_FAIL("LeftToRight", "QTBUG-21833", Abort);
|
|
||||||
QCOMPARE(bar->maximum(), rowCount/4 - nbVisibleItem);
|
QCOMPARE(bar->maximum(), rowCount/4 - nbVisibleItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user