diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-04-23 09:59:52 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-04-23 11:25:12 +0200 |
commit | 763897702dfc22075a0366df8dfd8f381103a60b (patch) | |
tree | ed4d5299c746f8a9287d1037bf9bfcdcf8e24738 /src/quick/scenegraph | |
parent | 4601cd23f6c90372edbd4145833041bd7cf227cb (diff) |
Fix using fonts inside .ttc with render type QtRendering
The file name of a font is not identification in itself, because
the file may be a font collection (.ttc). In this case, we also
have to use the index of the font inside the .ttc as part of
the cache key.
[ChangeLog][QtQuick][Text] Fixed a bug where we would sometimes
resolve the wrong fonts inside .ttc font collections.
Pick-to: 5.15
Fixes: QTBUG-81810
Change-Id: I40ded703bcdd22dce2be58c5a481f0918e6d352b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrendercontext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 696801cc88..a5d352b7f1 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -389,7 +389,7 @@ QString QSGDefaultRenderContext::fontKey(const QRawFont &font) { QFontEngine *fe = QRawFontPrivate::get(font)->fontEngine; if (!fe->faceId().filename.isEmpty()) { - QByteArray keyName = fe->faceId().filename; + QByteArray keyName = fe->faceId().filename + ' ' + QByteArray::number(fe->faceId().index); if (font.style() != QFont::StyleNormal) keyName += QByteArray(" I"); if (font.weight() != QFont::Normal) |