diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-05-27 23:02:23 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-06-05 11:46:00 +0200 |
commit | 825b474363167cfd91509e15b8846e11b8560dac (patch) | |
tree | 01733590bceeb7303fbc0547962982c18d5aa1a7 /src/platformsupport/fontdatabases/windows | |
parent | 87ca7c96880c3da48fef894987333fdaf7caac8b (diff) |
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 <allan.jensen@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases/windows')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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); |