From 825b474363167cfd91509e15b8846e11b8560dac Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 27 May 2019 23:02:23 +0200 Subject: Windows: Use the first entry in the requested families if available If the font request has the families list set then it should use the first entry in that if the face name is empty as this will be more accurate than just the whole family setting which may contain a comma separated list of family names. Fixes: QTBUG-75333 Change-Id: Iccc9cde741544af5263cb318da56178adf34299b Reviewed-by: Allan Sandfeld Jensen --- src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index c456f01b28..c523e799e6 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1818,7 +1818,7 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request, const QS QString fam = faceName; if (fam.isEmpty()) - fam = request.family; + fam = request.families.size() > 0 ? request.families.at(0) : request.family; if (Q_UNLIKELY(fam.size() >= LF_FACESIZE)) { qCritical("%s: Family name '%s' is too long.", __FUNCTION__, qPrintable(fam)); fam.truncate(LF_FACESIZE - 1); -- cgit v1.2.3