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>
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)