summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp15
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.h1
2 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 1c5b114efd..b1bb944fc6 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -933,7 +933,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
}
static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric,
- int type, LPARAM)
+ int type, LPARAM registerAlias)
{
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
const uchar charSet = f->elfLogFont.lfCharSet;
@@ -943,13 +943,13 @@ static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetr
// NEWTEXTMETRICEX is a NEWTEXTMETRIC, which according to the documentation is
// identical to a TEXTMETRIC except for the last four members, which we don't use
// anyway
- addFontToDatabase(familyName, charSet, (TEXTMETRIC *)textmetric, &signature, type, false);
+ addFontToDatabase(familyName, charSet, (TEXTMETRIC *)textmetric, &signature, type, registerAlias);
// keep on enumerating
return 1;
}
-void QWindowsFontDatabase::populateFamily(const QString &familyName)
+void QWindowsFontDatabase::populateFamily(const QString &familyName, bool registerAlias)
{
qCDebug(lcQpaFonts) << familyName;
if (familyName.size() >= LF_FACESIZE) {
@@ -962,10 +962,15 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName)
familyName.toWCharArray(lf.lfFaceName);
lf.lfFaceName[familyName.size()] = 0;
lf.lfPitchAndFamily = 0;
- EnumFontFamiliesEx(dummy, &lf, (FONTENUMPROC)storeFont, 0, 0);
+ EnumFontFamiliesEx(dummy, &lf, (FONTENUMPROC)storeFont, (LPARAM)registerAlias, 0);
ReleaseDC(0, dummy);
}
+void QWindowsFontDatabase::populateFamily(const QString &familyName)
+{
+ populateFamily(familyName, false);
+}
+
namespace {
// Context for enumerating system fonts, records whether the default font has been encountered,
// which is normally not enumerated by EnumFontFamiliesEx().
@@ -1382,7 +1387,7 @@ QStringList QWindowsFontDatabase::addApplicationFont(const QByteArray &fontData,
// Fonts based on files are added via populate, as they will show up in font enumeration.
for (int j = 0; j < families.count(); ++j)
- populateFamily(families.at(j));
+ populateFamily(families.at(j), true);
}
m_applicationFonts << font;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h
index 3615612c78..efb5421996 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h
@@ -100,6 +100,7 @@ public:
static QString familyForStyleHint(QFont::StyleHint styleHint);
private:
+ void populateFamily(const QString &familyName, bool registerAlias);
void removeApplicationFonts();
struct WinApplicationFont {