summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-03-30 14:51:42 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-03 10:45:02 +0200
commit108e708e7068bcd402c7f3202e76ab2c2ebd9a68 (patch)
tree053975f573aef6bdea711a2dbb5ca557181a7c42 /src/plugins/platforms/windows
parentdb347ec2f8949da0bcbc28f2d2c43c213bd89cfe (diff)
Windows: Improve Freetype font database registry check for fonts
Some non-scalable fonts like "Courier" list some numbers after the font name in Windows registry, e.g. "Courier 10,12,15". These are not part of the font name and therefore confused the algorithm looking for font files. Improved the algorithm to ignore this kind of number list. Single numbers are still expected to be part of the font name. Task-number: QTBUG-24970 Change-Id: I3fe45b798f44bee962e5b3aa748fc4717f723353 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index 500a1eeccb..e84f0c7630 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -195,9 +195,11 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
const QStringList allKeys = fontRegistry.allKeys();
allFonts.reserve(allKeys.size());
const QString trueType = QStringLiteral("(TrueType)");
+ const QRegExp sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+"));
foreach (const QString &key, allKeys) {
QString realKey = key;
realKey.remove(trueType);
+ realKey.remove(sizeListMatch);
QStringList fonts;
const QStringList fontNames = realKey.trimmed().split(QLatin1Char('&'));
foreach (const QString &fontName, fontNames)